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

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..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,
« 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