diff options
author | Simon Que <sque@chromium.org> | 2011-12-07 16:20:41 -0800 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-08 14:06:16 +0000 |
commit | bc081420a5d6d28c4e6fd5527a70caaa3a8361c4 (patch) | |
tree | bfca31a03c9a33459054fe43c390f1dc29f60ca5 /src/intel_display.c | |
parent | 84aaf1537cbd29e163346d03debc39f4623c69eb (diff) |
xf86-video-intel: change order of DPMS operations
The operations when setting dpms on should be in the order opposite
of what's done when setting dpms off.
This is because of potentially conflicting effects:
~ drmModeConnectoSetProperty() enables/disables the backlight driver.
Some backlight drivers such as intel_backlight set the backlight to 0
when disabled and to max when enabled.
~ intel_output_dpms_backlight() saves the backlight value when turning
DPMS off and restores it when turning DPMS on.
Here's the current order of operations:
xset dpms force off (backlight is nonzero)
drmModeConnectoSetProperty(DPMSModeOff)
kernel: disable backlight, backlight=0
intel_output_dpms_backlight(DPMSModeOff)
save backlight value (0) <-- it has been set to 0 by kernel
set backlight to 0
xset dpms force on
drmModeConnectoSetProperty(DPMSModeOn)
kernel: enable backlight, backlight=max
intel_output_dpms_backlight(DPMSModeOn)
set backlight to saved value (0)
The correct way to do this would be to reverse the operations during
xset dpms force off:
intel_output_dpms_backlight(DPMSModeOff)
save backlight value (nonzero)
set backlight to 0
drmModeConnectoSetProperty(DPMSModeOff)
kernel: enable backlight, backlight=0
This restores the saved nonzero backlight value during the force on.
Signed-off-by: Simon Que <sque@chromium.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_display.c')
-rw-r--r-- | src/intel_display.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/intel_display.c b/src/intel_display.c index 2183f4de..5ad8625e 100644 --- a/src/intel_display.c +++ b/src/intel_display.c @@ -944,13 +944,19 @@ intel_output_dpms(xf86OutputPtr output, int dpms) continue; if (!strcmp(props->name, "DPMS")) { + /* Make sure to reverse the order between on and off. */ + if (dpms == DPMSModeOff) + intel_output_dpms_backlight(output, + intel_output->dpms_mode, + dpms); drmModeConnectorSetProperty(mode->fd, intel_output->output_id, props->prop_id, dpms); - intel_output_dpms_backlight(output, - intel_output->dpms_mode, - dpms); + if (dpms != DPMSModeOff) + intel_output_dpms_backlight(output, + intel_output->dpms_mode, + dpms); intel_output->dpms_mode = dpms; drmModeFreeProperty(props); return; |