[PATCH xserver 8/8] glx: Advertise GLX 1.4 unconditionally

Adam Jackson ajax at redhat.com
Mon Mar 21 20:29:46 UTC 2016


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 glx/glxcmds.c            | 11 +++--------
 glx/glxdri2.c            | 12 ------------
 glx/glxdriswrast.c       |  3 ---
 glx/glxext.c             |  2 --
 glx/glxscreens.c         | 12 ------------
 glx/glxscreens.h         | 11 -----------
 glx/glxserver.h          |  3 ---
 hw/xquartz/GL/indirect.c |  3 ---
 hw/xwin/glx/indirect.c   |  4 ----
 9 files changed, 3 insertions(+), 58 deletions(-)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 561faeb..d49c932 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -797,8 +797,8 @@ __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc)
         .type = X_Reply,
         .sequenceNumber = client->sequence,
         .length = 0,
-        .majorVersion = glxMajorVersion,
-        .minorVersion = glxMinorVersion
+        .majorVersion = SERVER_GLX_MAJOR_VERSION,
+        .minorVersion = SERVER_GLX_MINOR_VERSION
     };
 
     if (client->swapped) {
@@ -2454,7 +2454,6 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
     char *buf;
     __GLXscreen *pGlxScreen;
     int err;
-    char ver_str[16];
 
     REQUEST_SIZE_MATCH(xGLXQueryServerStringReq);
 
@@ -2466,11 +2465,7 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
         ptr = GLXServerVendorName;
         break;
     case GLX_VERSION:
-        /* Return to the server version rather than the screen version
-         * to prevent confusion when they do not match.
-         */
-        snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion);
-        ptr = ver_str;
+        ptr = "1.4";
         break;
     case GLX_EXTENSIONS:
         ptr = pGlxScreen->GLXextensions;
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 4c2290b..a538f23 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -1001,18 +1001,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
                                        screen->base.GLXextensions);
     }
 
-    /* We're going to assume (perhaps incorrectly?) that all DRI2-enabled
-     * drivers support the required extensions for GLX 1.4.  The extensions
-     * we're assuming are:
-     *
-     *    - GLX_SGI_make_current_read (1.3)
-     *    - GLX_SGIX_fbconfig (1.3)
-     *    - GLX_SGIX_pbuffer (1.3)
-     *    - GLX_ARB_multisample (1.4)
-     */
-    screen->base.GLXmajor = 1;
-    screen->base.GLXminor = 4;
-
     screen->enterVT = pScrn->EnterVT;
     pScrn->EnterVT = glxDRIEnterVT;
     screen->leaveVT = pScrn->LeaveVT;
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 27d1aa4..493d9c4 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -499,9 +499,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
                                        screen->base.GLXextensions);
     }
 
-    screen->base.GLXmajor = 1;
-    screen->base.GLXminor = 4;
-
     __glXsetGetProcAddress(glXGetProcAddressARB);
 
     LogMessage(X_INFO, "AIGLX: Loaded and initialized %s\n", driverName);
diff --git a/glx/glxext.c b/glx/glxext.c
index e41b881..f3d8fdd 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -380,8 +380,6 @@ GlxExtensionInit(void)
 
             glxScreen = p->screenProbe(pScreen);
             if (glxScreen != NULL) {
-                if (glxScreen->GLXminor < glxMinorVersion)
-                    glxMinorVersion = glxScreen->GLXminor;
                 LogMessage(X_INFO,
                            "GLX: Initialized %s GL provider for screen %d\n",
                            p->name, i);
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 6a17016..61b8a52 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -154,9 +154,6 @@ static const char GLServerExtensions[] =
     "GL_SGIX_shadow_ambient "
     "GL_SUN_slice_accum ";
 
-unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION;
-unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION;
-
 static Bool
 glxCloseScreen(ScreenPtr pScreen)
 {
@@ -313,15 +310,6 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
     pGlxScreen->GLextensions = strdup(GLServerExtensions);
     pGlxScreen->GLXextensions = NULL;
 
-    /* All GLX providers must support all of the functionality required for at
-     * least GLX 1.2.  If the provider supports a higher version, the GLXminor
-     * version can be changed in the provider's screen-probe routine.  For
-     * most providers, the screen-probe routine is the caller of this
-     * function.
-     */
-    pGlxScreen->GLXmajor = 1;
-    pGlxScreen->GLXminor = 2;
-
     pGlxScreen->CloseScreen = pScreen->CloseScreen;
     pScreen->CloseScreen = glxCloseScreen;
 
diff --git a/glx/glxscreens.h b/glx/glxscreens.h
index a905877..7272d18 100644
--- a/glx/glxscreens.h
+++ b/glx/glxscreens.h
@@ -143,17 +143,6 @@ struct __GLXscreen {
 
     char *GLXextensions;
 
-    /**
-     * \name GLX version supported by this screen.
-     *
-     * Since the GLX version advertised by the server is for the whole server,
-     * the GLX protocol code uses the minimum version supported on all screens.
-     */
-    /*@{ */
-    unsigned GLXmajor;
-    unsigned GLXminor;
-    /*@} */
-
     Bool (*CloseScreen) (ScreenPtr pScreen);
 };
 
diff --git a/glx/glxserver.h b/glx/glxserver.h
index 9088ec4..a8c7965 100644
--- a/glx/glxserver.h
+++ b/glx/glxserver.h
@@ -275,9 +275,6 @@ extern int __glXImageSize(GLenum format, GLenum type,
                           GLint imageHeight, GLint rowLength, GLint skipImages,
                           GLint skipRows, GLint alignment);
 
-extern unsigned glxMajorVersion;
-extern unsigned glxMinorVersion;
-
 extern int __glXEventBase;
 
 #endif                          /* !__GLX_server_h__ */
diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index c0648c4..cdb2c5a 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -547,9 +547,6 @@ __glXAquaScreenProbe(ScreenPtr pScreen)
 
     __glXScreenInit(&screen->base, pScreen);
 
-    screen->base.GLXmajor = 1;
-    screen->base.GLXminor = 4;
-
     memset(screen->glx_enable_bits, 0, __GLX_EXT_BYTES);
 
     __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_info");
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index a5a6739..2c009ab 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -727,11 +727,7 @@ glxWinScreenProbe(ScreenPtr pScreen)
             }
         }
 
-        screen->base.GLXmajor = 1;
-        screen->base.GLXminor = 4;
     }
-    LogMessage(X_INFO, "AIGLX: Set GLX version to %d.%d\n",
-               screen->base.GLXmajor, screen->base.GLXminor);
 
     wglMakeCurrent(NULL, NULL);
     wglDeleteContext(hglrc);
-- 
2.5.0



More information about the xorg-devel mailing list