GNOME Bugzilla – Bug 769505
Set correct output scale on hot plug
Last modified: 2016-08-12 07:28:37 UTC
We didn't calculate a style when reading the current configuration because the connected output had not been assigned a crtc yet. The result was that external HiDPI monitors would get the wrong scale on hot-plug. While debugging the issue I decided to clean up the KMS configuration reading code splitting up the mega function into chunks that were easier to reason about. The other two fixes the issue of this bug.
Created attachment 332700 [details] [review] MetaMonitorManagerKms: Split up read_current() into logical chunks Instead of reading all the different state in one huge function, split it up into logical chunks, making it easier to read.
Created attachment 332701 [details] [review] monitor-manager: Always set the monitor info scale
Created attachment 332702 [details] [review] MetaMonitorManagerKms: Set output scale when assigning crtc The scale will have been set to 1 no matter what when initializing the MetaOutput since it at the time didn't have an CRTC assigned to it. Now, when we assign the CRTC to the output, we need to update the scale.
Created attachment 332709 [details] [review] MetaMonitorManagerKms: Set output scale when assigning crtc The scale will have been set to 1 no matter what when initializing the MetaOutput since it at the time didn't have an CRTC assigned to it. Now, when we assign the CRTC to the output, we need to update the scale. -- Moved the for loop under the crtc setup and fixed the get_output_scale() call. My wip state had leaked over onto the patch.
Comment on attachment 332700 [details] [review] MetaMonitorManagerKms: Split up read_current() into logical chunks Yay! I'd use the opportunity to kill some tabs leftovers in indentation, I see some esp. in the chunks that remained unchanged across the refactor.
Comment on attachment 332701 [details] [review] monitor-manager: Always set the monitor info scale Makes sense
Comment on attachment 332709 [details] [review] MetaMonitorManagerKms: Set output scale when assigning crtc Indeed
(In reply to Carlos Garnacho from comment #5) > Comment on attachment 332700 [details] [review] [review] > MetaMonitorManagerKms: Split up read_current() into logical chunks > > Yay! I'd use the opportunity to kill some tabs leftovers in indentation, I > see some esp. in the chunks that remained unchanged across the refactor. Tabs killed with fire. Attachment 332700 [details] pushed as 6940169 - MetaMonitorManagerKms: Split up read_current() into logical chunks Attachment 332701 [details] pushed as 1f657d2 - monitor-manager: Always set the monitor info scale Attachment 332709 [details] pushed as 9f6f778 - MetaMonitorManagerKms: Set output scale when assigning crtc