[Mesa-dev] [mesa 7/9] glx/dri2: Add DRI2GetParam()
Chris Wilson
chris at chris-wilson.co.uk
Mon Jan 19 03:00:43 PST 2015
Available since the inclusion of dri2proto 1.4 is a DRI2 request to
query and set certain parameters about the X/DDX configuration. This
implements the getter request.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
src/glx/dri2.c | 29 +++++++++++++++++++++++++++++
src/glx/dri2.h | 4 ++++
2 files changed, 33 insertions(+)
diff --git a/src/glx/dri2.c b/src/glx/dri2.c
index cc6c164..6d9403e 100644
--- a/src/glx/dri2.c
+++ b/src/glx/dri2.c
@@ -546,4 +546,33 @@ DRI2CopyRegion(Display * dpy, XID drawable, XserverRegion region,
SyncHandle();
}
+Bool
+DRI2GetParam(Display * dpy, XID drawable, CARD32 param, CARD64 *value)
+{
+ XExtDisplayInfo *info = DRI2FindDisplay(dpy);
+ xDRI2GetParamReply rep;
+ xDRI2GetParamReq *req;
+
+ XextCheckExtension(dpy, info, dri2ExtensionName, False);
+
+ LockDisplay(dpy);
+ GetReq(DRI2GetParam, req);
+ req->reqType = info->codes->major_opcode;
+ req->dri2ReqType = X_DRI2GetParam;
+ req->drawable = drawable;
+ req->param = param;
+
+ if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ *value = (CARD64)rep.value_hi << 32 | rep.value_lo;
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return rep.is_param_recognized;
+}
+
#endif /* GLX_DIRECT_RENDERING */
diff --git a/src/glx/dri2.h b/src/glx/dri2.h
index 4be5bf8..a5b23f0 100644
--- a/src/glx/dri2.h
+++ b/src/glx/dri2.h
@@ -88,4 +88,8 @@ DRI2CopyRegion(Display * dpy, XID drawable,
XserverRegion region,
CARD32 dest, CARD32 src);
+extern Bool
+DRI2GetParam(Display * dpy, XID drawable,
+ CARD32 param, CARD64 *value);
+
#endif
--
2.1.4
More information about the mesa-dev
mailing list