[PATCH xserver 1/8] glx: Remove default server glx extension string

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


This existed only to be strdup'd and then immediately freed.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 glx/glxdri2.c            |  2 --
 glx/glxdriswrast.c       |  2 --
 glx/glxscreens.c         | 20 +-------------------
 hw/xquartz/GL/indirect.c |  2 --
 hw/xwin/glx/indirect.c   |  2 --
 5 files changed, 1 insertion(+), 27 deletions(-)

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 58e60b9..948d653 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -1003,8 +1003,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
      */
     buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
     if (buffer_size > 0) {
-        free(screen->base.GLXextensions);
-
         screen->base.GLXextensions = xnfalloc(buffer_size);
         (void) __glXGetExtensionString(screen->glx_enable_bits,
                                        screen->base.GLXextensions);
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 924067c..cb57e9a 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -495,8 +495,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
      */
     buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
     if (buffer_size > 0) {
-        free(screen->base.GLXextensions);
-
         screen->base.GLXextensions = xnfalloc(buffer_size);
         (void) __glXGetExtensionString(screen->glx_enable_bits,
                                        screen->base.GLXextensions);
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index b0ad3b7..6a17016 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -154,26 +154,8 @@ static const char GLServerExtensions[] =
     "GL_SGIX_shadow_ambient "
     "GL_SUN_slice_accum ";
 
-/*
-** We have made the simplifying assuption that the same extensions are
-** supported across all screens in a multi-screen system.
-*/
 unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION;
 unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION;
-static char GLXServerExtensions[] =
-    "GLX_ARB_multisample "
-    "GLX_EXT_visual_info "
-    "GLX_EXT_visual_rating "
-    "GLX_EXT_import_context "
-    "GLX_EXT_texture_from_pixmap "
-    "GLX_OML_swap_method "
-    "GLX_SGI_make_current_read "
-#ifndef __APPLE__
-    "GLX_SGIS_multisample "
-#endif
-    "GLX_SGIX_fbconfig "
-    "GLX_SGIX_pbuffer "
-    "GLX_MESA_copy_sub_buffer ";
 
 static Bool
 glxCloseScreen(ScreenPtr pScreen)
@@ -329,7 +311,7 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
 
     pGlxScreen->pScreen = pScreen;
     pGlxScreen->GLextensions = strdup(GLServerExtensions);
-    pGlxScreen->GLXextensions = strdup(GLXServerExtensions);
+    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
diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index 4e6ab3d..4f3e2e4 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -566,8 +566,6 @@ __glXAquaScreenProbe(ScreenPtr pScreen)
         unsigned int buffer_size =
             __glXGetExtensionString(screen->glx_enable_bits, NULL);
         if (buffer_size > 0) {
-            free(screen->base.GLXextensions);
-
             screen->base.GLXextensions = xnfalloc(buffer_size);
             __glXGetExtensionString(screen->glx_enable_bits,
                                     screen->base.GLXextensions);
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index e4be642..e515d18 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -743,8 +743,6 @@ glxWinScreenProbe(ScreenPtr pScreen)
             unsigned int buffer_size =
                 __glXGetExtensionString(screen->glx_enable_bits, NULL);
             if (buffer_size > 0) {
-                free(screen->base.GLXextensions);
-
                 screen->base.GLXextensions = xnfalloc(buffer_size);
                 __glXGetExtensionString(screen->glx_enable_bits,
                                         screen->base.GLXextensions);
-- 
2.5.0



More information about the xorg-devel mailing list