diff options
author | Jesse Barnes <jbarnes@jbarnes-t61.(none)> | 2008-03-06 13:47:44 -0800 |
---|---|---|
committer | Jesse Barnes <jbarnes@jbarnes-t61.(none)> | 2008-03-06 13:50:58 -0800 |
commit | ca616b902b2c5d0f046c7a042c11f045479e373a (patch) | |
tree | 584864c7d618b4b5dcdd3d3fe967c2c26cc7f2cd /randr/rrproperty.c | |
parent | 34b69e3bc0e6462eb60029fbcb4f5479494007a2 (diff) |
Allow RandR get output property to call into drivers
In order to report accurate values to users of the RandR property interface,
it's sometimes necessary to ask the driver to update the value (for example
when backlight brightness changes without the server's knowledge, due to hotkey
events or direct sysfs banging).
This patch wires up the core server code with a new xf86CrtcFuncs callback,
get_property, to allow for this.
The new code is available under the RANDR_13_INTERFACE define, which in turn
depends on the RANDR_12_INTERFACE code.
Diffstat (limited to 'randr/rrproperty.c')
-rw-r--r-- | randr/rrproperty.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/randr/rrproperty.c b/randr/rrproperty.c index 4617064e4..9bb7081ca 100644 --- a/randr/rrproperty.c +++ b/randr/rrproperty.c @@ -300,13 +300,21 @@ RRPropertyValuePtr RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending) { RRPropertyPtr prop = RRQueryOutputProperty (output, property); + rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen); if (!prop) return NULL; if (pending && prop->is_pending) return &prop->pending; - else + else { +#if RANDR_13_INTERFACE + /* If we can, try to update the property value first */ + if (pScrPriv->rrOutputGetProperty) + pScrPriv->rrOutputGetProperty(output->pScreen, output, + prop->propertyName); +#endif return &prop->current; + } } int @@ -610,11 +618,10 @@ ProcRRGetOutputProperty (ClientPtr client) if (prop->immutable && stuff->delete) return BadAccess; - if (stuff->pending && prop->is_pending) - prop_value = &prop->pending; - else - prop_value = &prop->current; - + prop_value = RRGetOutputProperty(output, stuff->property, stuff->pending); + if (!prop_value) + return BadAtom; + /* If the request type and actual type don't match. Return the property information, but not the data. */ |