[mesa 7/9] glx/dri2: Add DRI2GetParam()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
---
 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

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux