diff options
author | Keith Packard <keithp@keithp.com> | 2010-11-17 16:37:53 +0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-11-17 16:40:47 +0800 |
commit | 33c08882c0d551afb28baef643279901dcc65fa9 (patch) | |
tree | d64506229817d70eaf0053342f00253d82aa2834 /src/intel_display.c | |
parent | cc930a37612341a1f2457adb339523c215879d82 (diff) |
Mark outputs as DPMSModeOn and restore backlight at mode set
The kernel always turns monitors on when doing mode setting, and so no
further DPMS action is required. Note this in the mode setting code by
marking the updated DPMS mode and restoring any saved backlight level.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/intel_display.c')
-rw-r--r-- | src/intel_display.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/intel_display.c b/src/intel_display.c index 7eef80bb..10bc5fd8 100644 --- a/src/intel_display.c +++ b/src/intel_display.c @@ -101,6 +101,9 @@ struct intel_output { static void intel_output_dpms(xf86OutputPtr output, int mode); +static void +intel_output_dpms_backlight(xf86OutputPtr output, int oldmode, int mode); + #define BACKLIGHT_CLASS "/sys/class/backlight" /* @@ -377,9 +380,25 @@ intel_crtc_apply(xf86CrtcPtr crtc) xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, "failed to set mode: %s\n", strerror(-ret)); ret = FALSE; - } else + } else { ret = TRUE; + /* Force DPMS to On for all outputs, which the kernel will have done + * with the mode set. Also, restore the backlight level + */ + for (i = 0; i < xf86_config->num_output; i++) { + xf86OutputPtr output = xf86_config->output[i]; + struct intel_output *intel_output; + + if (output->crtc != crtc) + continue; + + intel_output = output->driver_private; + intel_output_dpms_backlight(output, intel_output->dpms_mode, DPMSModeOn); + intel_output->dpms_mode = DPMSModeOn; + } + } + intel_set_gem_max_sizes(scrn); if (scrn->pScreen) |