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

Unified Diff: chromeos/display/output_configurator.cc

Issue 11233052: Use the current state when resuming. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months 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: chromeos/display/output_configurator.cc
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
index 063ddd7c77096831b074d050030ba6b8dbf1d79f..f4ce18c20fc8794e84116e6c173be8dc8e7ac6ea 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,
« 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