[PATCH xserver 3/4] glx: Implement GLX_EXT_stereo_tree

Adam Jackson ajax at redhat.com
Thu Mar 10 18:25:05 UTC 2016


This is correct as it is, but only because we know no DRI drivers
implement stereo.

v2: Use new ATTRIB macro

Reviewed-by: James Jones <jajones at nvidia.com>
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 glx/extension_string.c |  1 +
 glx/extension_string.h |  1 +
 glx/glxcmds.c          | 10 +++++++++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/glx/extension_string.c b/glx/extension_string.c
index cf90146..c3ddc4c 100644
--- a/glx/extension_string.c
+++ b/glx/extension_string.c
@@ -84,6 +84,7 @@ static const struct extension_info known_glx_extensions[] = {
     { GLX(EXT_create_context_es2_profile), VER(0,0), N, },
     { GLX(EXT_framebuffer_sRGB),        VER(0,0), N, },
     { GLX(EXT_import_context),          VER(0,0), Y, },
+    { GLX(EXT_stereo_tree),             VER(0,0), N, },
     { GLX(EXT_texture_from_pixmap),     VER(0,0), Y, },
     { GLX(EXT_visual_info),             VER(0,0), Y, },
     { GLX(EXT_visual_rating),           VER(0,0), Y, },
diff --git a/glx/extension_string.h b/glx/extension_string.h
index ffaab07..c1df91b 100644
--- a/glx/extension_string.h
+++ b/glx/extension_string.h
@@ -46,6 +46,7 @@ enum {
     EXT_create_context_es_profile_bit,
     EXT_create_context_es2_profile_bit,
     EXT_import_context_bit,
+    EXT_stereo_tree_bit,
     EXT_texture_from_pixmap_bit,
     EXT_visual_info_bit,
     EXT_visual_rating_bit,
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index e6bae1a..d78b189 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1921,6 +1921,11 @@ __glXDisp_CopySubBufferMESA(__GLXclientState * cl, GLbyte * pc)
     return Success;
 }
 
+/* hack for old glxext.h */
+#ifndef GLX_STEREO_TREE_EXT
+#define GLX_STEREO_TREE_EXT                 0x20F5
+#endif
+
 /*
 ** Get drawable attributes
 */
@@ -1931,7 +1936,7 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
     xGLXGetDrawableAttributesReply reply;
     __GLXdrawable *pGlxDraw = NULL;
     DrawablePtr pDraw;
-    CARD32 attributes[16];
+    CARD32 attributes[18];
     int num = 0, error;
 
     if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
@@ -1964,6 +1969,9 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
         if (pGlxDraw->type == GLX_DRAWABLE_PBUFFER) {
             ATTRIB(GLX_PRESERVED_CONTENTS, GL_TRUE);
         }
+        if (pGlxDraw->type == GLX_DRAWABLE_WINDOW) {
+            ATTRIB(GLX_STEREO_TREE_EXT, 0);
+        }
     }
 
     reply = (xGLXGetDrawableAttributesReply) {
-- 
2.5.0



More information about the xorg-devel mailing list