diff options
author | Jesse Barnes <jbarnes@jbarnes-t61.(none)> | 2008-03-06 13:55:13 -0800 |
---|---|---|
committer | Jesse Barnes <jbarnes@jbarnes-t61.(none)> | 2008-03-06 13:58:07 -0800 |
commit | be08b61540e1edbb7673f0b6add0f1e32b136b3c (patch) | |
tree | a494d3f572851d1dc6b2dc9529451dfff1014135 | |
parent | 502e41f6dff91393cfeaf08c9ba312781d1b7267 (diff) |
Implement new get_property feature for backlight control
This should keep the backlight value reported by xrandr --prop & xbacklight
consistent with changes by other software in the system (like the hotkey driver
or kernel backlight driver).
-rw-r--r-- | src/i830_lvds.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/i830_lvds.c b/src/i830_lvds.c index ef8fa4a9..8359e39f 100644 --- a/src/i830_lvds.c +++ b/src/i830_lvds.c @@ -851,6 +851,35 @@ i830_lvds_set_property(xf86OutputPtr output, Atom property, } #endif /* RANDR_12_INTERFACE */ +#ifdef RANDR_13_INTERFACE +static Bool +i830_lvds_get_property(xf86OutputPtr output, Atom property) +{ + ScrnInfoPtr pScrn = output->scrn; + I830Ptr pI830 = I830PTR(pScrn); + I830OutputPrivatePtr intel_output = output->driver_private; + struct i830_lvds_priv *dev_priv = intel_output->dev_priv; + int ret; + + /* + * Only need to update properties that might change out from under + * us. The others will be cached by the randr core code. + */ + if (property == backlight_atom) { + int val; + val = dev_priv->get_backlight(output); + dev_priv->backlight_duty_cycle = val; + ret = RRChangeOutputProperty(output->randr_output, backlight_atom, + XA_INTEGER, 32, PropModeReplace, 1, &val, + FALSE, TRUE); + if (ret != Success) + return FALSE; + } + + return TRUE; +} +#endif /* RANDR_13_INTERFACE */ + static const xf86OutputFuncsRec i830_lvds_output_funcs = { .create_resources = i830_lvds_create_resources, .dpms = i830_lvds_dpms, @@ -866,6 +895,9 @@ static const xf86OutputFuncsRec i830_lvds_output_funcs = { #ifdef RANDR_12_INTERFACE .set_property = i830_lvds_set_property, #endif +#ifdef RANDR_13_INTERFACE + .get_property = i830_lvds_get_property, +#endif .destroy = i830_lvds_destroy }; |