[Xcb-commit] xcb-demo xcb-proto

Josh Triplett josh at kemper.freedesktop.org
Thu Apr 27 14:14:57 PDT 2006


 xcb-demo/Makefile.am  |    6 +++++-
 xcb-demo/configure.ac |    1 +
 xcb-demo/xcbxf86dri.c |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 xcb-proto/TODO        |    2 +-
 4 files changed, 57 insertions(+), 2 deletions(-)

New commits:
diff-tree f585aa42bfdf5ba65b7641ab578151ed63aef807 (from fcba4bc0e68a230f820dc93c158a7a4488b8f0ae)
Author: Josh Triplett <josh at freedesktop.org>
Date:   Thu Apr 27 14:14:54 2006 -0700

    Add test program for XFree86-DRI extension to xcb-demo.  Mark XFree86-DRI extension as tested and working.

diff --git a/xcb-demo/Makefile.am b/xcb-demo/Makefile.am
index 67b6a44..21793ed 100644
--- a/xcb-demo/Makefile.am
+++ b/xcb-demo/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = autogen.sh README
 INCLUDES = $(XCB_CFLAGS)
 LDADD = $(XCB_LIBS)
 
-bin_PROGRAMS = hypnomoire xdpyinfo xcb-test dpms rendertest xcbrandr
+bin_PROGRAMS = hypnomoire xdpyinfo xcb-test dpms rendertest xcbrandr xcbxf86dri
 
 hypnomoire_CFLAGS = $(XCBAUX_CFLAGS)
 hypnomoire_LDADD = $(XCBAUX_LIBS) -lm -lpthread
@@ -31,3 +31,7 @@ rendertest_SOURCES = rendertest.c
 xcbrandr_CFLAGS = $(XCBAUX_CFLAGS) $(XCBRANDR_CFLAGS)
 xcbrandr_LDADD = $(XCBAUX_LIBS) $(XCBRANDR_LIBS)
 xcbrandr_SOURCES = xcbrandr.c
+
+xcbxf86dri_CFLAGS = $(XCBXF86DRI_CFLAGS)
+xcbxf86dri_LDADD = $(XCBXF86DRI_LIBS)
+xcbxf86dri_SOURCES = xcbxf86dri.c
diff --git a/xcb-demo/configure.ac b/xcb-demo/configure.ac
index 35f9584..d989498 100644
--- a/xcb-demo/configure.ac
+++ b/xcb-demo/configure.ac
@@ -17,5 +17,6 @@ PKG_CHECK_MODULES(XCBICCCM, xcb-icccm)
 PKG_CHECK_MODULES(XCBDPMS, xcb-dpms)
 PKG_CHECK_MODULES(XCBRENDER, xcb-render)
 PKG_CHECK_MODULES(XCBRANDR, xcb-randr)
+PKG_CHECK_MODULES(XCBXF86DRI, xcb-xf86dri)
 
 AC_OUTPUT([Makefile tests/Makefile])
diff --git a/xcb-demo/xcbxf86dri.c b/xcb-demo/xcbxf86dri.c
new file mode 100644
index 0000000..e471431
--- /dev/null
+++ b/xcb-demo/xcbxf86dri.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 2006 Josh Triplett. All Rights Reserved.  See the file
+ * COPYING in this directory for licensing information. */
+#include <X11/XCB/xcb.h>
+#include <X11/XCB/xf86dri.h>
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv)
+{
+    int screen;
+    XCBXF86DriQueryVersionCookie qvc;
+    XCBXF86DriQueryVersionRep *qv;
+    XCBXF86DriQueryDirectRenderingCapableCookie qdrc;
+    XCBXF86DriQueryDirectRenderingCapableRep *qdr;
+    XCBConnection *c = XCBConnect(NULL, &screen);
+
+    if(!c)
+    {
+        fprintf(stderr, "Error establishing connection to X server.");
+        return 1;
+    }
+
+    qvc  = XCBXF86DriQueryVersion(c);
+    qdrc = XCBXF86DriQueryDirectRenderingCapable(c, screen);
+
+    qv  = XCBXF86DriQueryVersionReply(c, qvc, 0);
+    if(!qv)
+    {
+        fprintf(stderr, "Error querying DRI extension version.\n");
+        return 1;
+    }
+    printf("DRI extension version: %hu.%hu.%u\n",
+           qv->dri_major_version, qv->dri_minor_version, qv->dri_minor_patch);
+    free(qv);
+
+    qdr = XCBXF86DriQueryDirectRenderingCapableReply(c, qdrc, 0);
+    if(!qdr)
+    {
+        fprintf(stderr, "Error querying direct rendering capability.\n");
+        return 1;
+    }
+    printf("Direct rendering (screen %d): %s\n",
+           screen, qdr->is_capable ? "yes" : "no");
+    free(qdr);
+
+    XCBDisconnect(c);
+
+    return 0;
+}
diff --git a/xcb-proto/TODO b/xcb-proto/TODO
index 35861e5..add693c 100644
--- a/xcb-proto/TODO
+++ b/xcb-proto/TODO
@@ -33,7 +33,7 @@ X XEVIE
 X XFIXES
   XFree86-Bigfont
   XFree86-DGA
-U XFree86-DRI
+X XFree86-DRI
   XFree86-Misc
   XFree86-VidModeExtension
   XINERAMA


More information about the xcb-commit mailing list