xf86-video-intel: src/intel_display.c
Keith Packard
keithp at kemper.freedesktop.org
Wed Nov 17 00:41:22 PST 2010
src/intel_display.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
New commits:
commit 33c08882c0d551afb28baef643279901dcc65fa9
Author: Keith Packard <keithp at keithp.com>
Date: Wed Nov 17 16:37:53 2010 +0800
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 at keithp.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
diff --git a/src/intel_display.c b/src/intel_display.c
index 7eef80b..10bc5fd 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)
More information about the xorg-commit
mailing list