sna: Cancel the backlight change if set-property(DPMS) fails
If the kernel reports an error from setting the DPMS property, we need to undo the local changes and propagate back the error to the caller. Although the latter is prevented by the RandR API, we can at least restore the backlight. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
47effa1854
commit
b99c8cbefd
|
|
@ -2418,11 +2418,12 @@ sna_output_dpms(xf86OutputPtr output, int dpms)
|
|||
sna_output->dpms_mode,
|
||||
dpms);
|
||||
|
||||
if (output->crtc)
|
||||
drmModeConnectorSetProperty(sna->kgem.fd,
|
||||
sna_output->id,
|
||||
sna_output->dpms_id,
|
||||
dpms);
|
||||
if (output->crtc &&
|
||||
drmModeConnectorSetProperty(sna->kgem.fd,
|
||||
sna_output->id,
|
||||
sna_output->dpms_id,
|
||||
dpms))
|
||||
dpms = sna_output->dpms_mode;
|
||||
|
||||
if (dpms == DPMSModeOn)
|
||||
sna_output_dpms_backlight(output,
|
||||
|
|
|
|||
Loading…
Reference in New Issue