Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(957)

Unified Diff: monitor_reconfigure_main.cc

Issue 5024002: Avoid a kernel driver / X server crash situation. (Closed) Base URL: http://git.chromium.org/git/monitor_reconfig.git@master
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: monitor_reconfigure_main.cc
diff --git a/monitor_reconfigure_main.cc b/monitor_reconfigure_main.cc
index 664b05f33d279248c0e66c60441724c9f70d0ea4..bfabae7731e44a35fdf073ac7cae248300a98b1f 100644
--- a/monitor_reconfigure_main.cc
+++ b/monitor_reconfigure_main.cc
@@ -56,21 +56,28 @@ void MonitorReconfigureMain::Run() {
// Disable the LCD if we were told to do so (because we're using a higher
// resolution that'd be clipped on the LCD).
- if (!lcd_resolution.empty())
- SetDeviceResolution(lcd_output_->name, lcd_resolution);
- else
+ if (lcd_resolution.empty())
DisableDevice(lcd_output_->name);
// If there's no external output connected, disable the device before we try
// to set the screen resolution; otherwise xrandr will complain if we're
// trying to set the screen to a smaller size than what the now-unplugged
// device was using.
- if (!external_resolution.empty())
- SetDeviceResolution(external_output_->name, external_resolution);
- else
+ if (external_resolution.empty())
DisableDevice(external_output_->name);
+ // Set the fb to try to avoid the driver's "crtc has no fb" message.
+ // Doing this before enabling the display reduces the likelihood of a
+ // visible "snap" when returning to the panel.
SetScreenResolution(screen_resolution);
+
+ // Enable the LCD if appropriate.
+ if (!lcd_resolution.empty())
+ SetDeviceResolution(lcd_output_->name, lcd_resolution);
+
+ // Enable the external device if appropriate.
+ if (!external_resolution.empty())
+ SetDeviceResolution(external_output_->name, external_resolution);
}
void MonitorReconfigureMain::DetermineOutputs() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698