summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@jbarnes-t61.(none)>2008-03-06 13:47:44 -0800
committerJesse Barnes <jbarnes@jbarnes-t61.(none)>2008-03-06 13:50:58 -0800
commitca616b902b2c5d0f046c7a042c11f045479e373a (patch)
tree584864c7d618b4b5dcdd3d3fe967c2c26cc7f2cd /hw
parent34b69e3bc0e6462eb60029fbcb4f5479494007a2 (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 'hw')
-rw-r--r--hw/xfree86/modes/xf86Crtc.h23
-rw-r--r--hw/xfree86/modes/xf86RandR12.c17
2 files changed, 40 insertions, 0 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index cc045b229..b87a32548 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -215,8 +215,15 @@ typedef struct _xf86CrtcFuncs {
Rotation rotation, int x, int y);
} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
+#define XF86_CRTC_VERSION 1
+
struct _xf86Crtc {
/**
+ * ABI versioning
+ */
+ int version;
+
+ /**
* Associated ScrnInfo
*/
ScrnInfoPtr scrn;
@@ -410,6 +417,14 @@ typedef struct _xf86OutputFuncs {
Atom property,
RRPropertyValuePtr value);
#endif
+#ifdef RANDR_13_INTERFACE
+ /**
+ * Callback to get an updated property value
+ */
+ Bool
+ (*get_property)(xf86OutputPtr output,
+ Atom property);
+#endif
/**
* Clean up driver-specific bits of the output
*/
@@ -417,8 +432,16 @@ typedef struct _xf86OutputFuncs {
(*destroy) (xf86OutputPtr output);
} xf86OutputFuncsRec, *xf86OutputFuncsPtr;
+
+#define XF86_OUTPUT_VERSION 1
+
struct _xf86Output {
/**
+ * ABI versioning
+ */
+ int version;
+
+ /**
* Associated ScrnInfo
*/
ScrnInfoPtr scrn;
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index e2668fbbc..8b13758af 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -848,6 +848,20 @@ xf86RandR12OutputSetProperty (ScreenPtr pScreen,
}
static Bool
+xf86RandR13OutputGetProperty (ScreenPtr pScreen,
+ RROutputPtr randr_output,
+ Atom property)
+{
+ xf86OutputPtr output = randr_output->devPrivate;
+
+ if (output->funcs->get_property == NULL)
+ return TRUE;
+
+ /* Should be safe even w/o vtSema */
+ return output->funcs->get_property(output, property);
+}
+
+static Bool
xf86RandR12OutputValidateMode (ScreenPtr pScreen,
RROutputPtr randr_output,
RRModePtr randr_mode)
@@ -1126,6 +1140,9 @@ xf86RandR12Init12 (ScreenPtr pScreen)
rp->rrCrtcSetGamma = xf86RandR12CrtcSetGamma;
rp->rrOutputSetProperty = xf86RandR12OutputSetProperty;
rp->rrOutputValidateMode = xf86RandR12OutputValidateMode;
+#if RANDR_13_INTERFACE
+ rp->rrOutputGetProperty = xf86RandR13OutputGetProperty;
+#endif
rp->rrModeDestroy = xf86RandR12ModeDestroy;
rp->rrSetConfig = NULL;
pScrn->PointerMoved = xf86RandR12PointerMoved;