diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-23 23:14:50 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-23 23:14:50 +0000 |
commit | b68d0454ecf6d017152df8fd3c2ca775e3dcb760 (patch) | |
tree | 156814f6a74ae38c42158a9fee75e94ee7445a9e /chromeos | |
parent | ef7de1ea1bac168f213092bf2c27adf5b99569d6 (diff) | |
download | chromium_src-b68d0454ecf6d017152df8fd3c2ca775e3dcb760.zip chromium_src-b68d0454ecf6d017152df8fd3c2ca775e3dcb760.tar.gz chromium_src-b68d0454ecf6d017152df8fd3c2ca775e3dcb760.tar.bz2 |
Use the current state when resuming.
- When resuming (power_on=1, all_display=1), use the current
state to restore display.
- Don't turn off the internal display even for mirror mode.
chrome never remove the internal display and this was
confusing chrome. (I'll do right fix on 25)
BUG=chrome-os-partner:14980, 157284
TEST=manual
Review URL: https://chromiumcodereview.appspot.com/11233052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163716 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r-- | chromeos/display/output_configurator.cc | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc index 063ddd7..f4ce18c 100644 --- a/chromeos/display/output_configurator.cc +++ b/chromeos/display/output_configurator.cc @@ -604,8 +604,25 @@ 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_)) { + // Force the DPMS on since the driver doesn't always detect that it should + // turn on. + CHECK(DPMSEnable(display)); + CHECK(DPMSForceLevel(display, DPMSModeOn)); + + 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 +637,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 +645,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, |