sna: When the output is off, report the cached backlight value

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-06-05 15:54:32 +01:00
parent f0b8720807
commit b545e10c50
1 changed files with 11 additions and 3 deletions

View File

@ -2646,9 +2646,17 @@ sna_output_get_property(xf86OutputPtr output, Atom property)
if (!sna_output->backlight.iface) if (!sna_output->backlight.iface)
return FALSE; return FALSE;
val = sna_output_backlight_get(output); if (sna_output->dpms_mode == DPMSModeOn) {
if (val < 0) val = sna_output_backlight_get(output);
return FALSE; if (val < 0)
return FALSE;
DBG(("%s(%s): output on, reporting actual backlight value [%d]\n",
__FUNCTION__, output->name, val));
} else {
val = sna_output->backlight_active_level;
DBG(("%s(%s): output off, reporting cached backlight value [%d]\n",
__FUNCTION__, output->name, val));
}
err = RRChangeOutputProperty(output->randr_output, property, err = RRChangeOutputProperty(output->randr_output, property,
XA_INTEGER, 32, PropModeReplace, 1, &val, XA_INTEGER, 32, PropModeReplace, 1, &val,