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>
This commit is contained in:
parent
cc930a3761
commit
33c08882c0
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue