Chromium Code Reviews| Index: chromeos/display/output_configurator.cc |
| diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc |
| index 063ddd7c77096831b074d050030ba6b8dbf1d79f..a0dc9904ab8848fdf89d2b7952c15d24878f171b 100644 |
| --- a/chromeos/display/output_configurator.cc |
| +++ b/chromeos/display/output_configurator.cc |
| @@ -604,8 +604,20 @@ bool OutputConfigurator::ScreenPowerSet(bool power_on, bool all_displays) { |
| OutputSnapshot outputs[2] = { {0}, {0} }; |
| connected_output_count_ = |
| GetDualOutputs(display, screen, &outputs[0], &outputs[1]); |
| - output_state_ = |
| - InferCurrentState(display, screen, outputs, connected_output_count_); |
| + |
| + if (all_displays && power_on) { |
| + // Resume all displays using the current state. |
| + if (EnterState(display, |
| + screen, |
| + window, |
| + output_state_, |
| + outputs, |
| + connected_output_count_)) { |
|
Josh Horwich
2012/10/23 17:12:21
Do we need to do the DPMSEnable / DPMSForceLevel c
|
| + XRRFreeScreenResources(screen); |
| + XUngrabServer(display); |
| + return true; |
| + } |
| + } |
| RRCrtc crtc = None; |
| // Set the CRTCs based on whether we want to turn the power on or off and |
| @@ -620,7 +632,7 @@ bool OutputConfigurator::ScreenPowerSet(bool power_on, bool all_displays) { |
| mode = (STATE_DUAL_MIRROR == output_state_) ? |
| outputs[i].mirror_mode : outputs[i].native_mode; |
| } else if (connected_output_count_ > 1 && !all_displays && |
| - STATE_DUAL_MIRROR != output_state_ && outputs[i].is_internal) { |
| + && outputs[i].is_internal) { |
| // Workaround for crbug.com/148365: leave internal display in native |
| // mode so user can move cursor (and hence windows) onto internal |
| // display even when dimmed |
| @@ -628,8 +640,6 @@ bool OutputConfigurator::ScreenPowerSet(bool power_on, bool all_displays) { |
| } |
| crtc = GetNextCrtcAfter(display, screen, output, crtc); |
| - // The values we are setting are already from the cache so no update |
| - // required. |
| ConfigureCrtc(display, |
| screen, |
| crtc, |