glx: Move initialization of ext_list_first_time to where it's storage is allocated
authorBrian Paul <brianp@vmware.com>
Sat, 6 Mar 2010 00:32:36 +0000 (17:32 -0700)
committerBrian Paul <brianp@vmware.com>
Sat, 6 Mar 2010 00:32:36 +0000 (17:32 -0700)
Move the initialization of ext_list_first_time from all of the DRI loader's
CreateScreen routines, to where the storage for the screen config is
allocated.

It needs to get set in the screen-config even if DRI is forced off
using LIBGL_ALWAYS_INDIRECT, so that psc->direct_support is initialized
correctly, otherwise __glXExtensionBitIsEnabled() always returns FALSE

Specifically, this causes a problem with an X server which advertises
GLX<=1.2, and the GLX_SGIX_fbconfig extension.
glXGetFBConfigFromVisualSGIX() uses __glXExtensionBitIsEnabled() to
check if the GLX_SGIX_fbconfig extension is available, but that function
won't return correct information because that data has never been
initialized, because ext_list_first_time was never set...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 96ab4d2b84178209ee59017458d9964b32b7e183)

src/glx/dri2_glx.c
src/glx/dri_glx.c
src/glx/drisw_glx.c
src/glx/glxext.c

index d573e46296bf49fff72a0e5de5dde12490acd1bf..5b0f335db6af28190d51d89bd92988662fa145d8 100644 (file)
@@ -519,9 +519,6 @@ dri2CreateScreen(__GLXscreenConfigs * psc, int screen,
    if (psp == NULL)
       return NULL;
 
-   /* Initialize per screen dynamic client GLX extensions */
-   psc->ext_list_first_time = GL_TRUE;
-
    if (!DRI2Connect(psc->dpy, RootWindow(psc->dpy, screen),
                    &driverName, &deviceName)) {
       XFree(psp);
index f9fe9a25db428804dc1f752b84aa400ab8ff2ec9..e47db82b70f64f59c1a55e3a5fc61e765c6336b3 100644 (file)
@@ -648,9 +648,6 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
    if (psp == NULL)
       return NULL;
 
-   /* Initialize per screen dynamic client GLX extensions */
-   psc->ext_list_first_time = GL_TRUE;
-
    if (!driGetDriverName(priv->dpy, screen, &driverName)) {
       Xfree(psp);
       return NULL;
index eed9a8c472390501db6320c323bfa67eaa2eacb9..1b94a56fd1326ce33493dca5a44431241f95d355 100644 (file)
@@ -364,9 +364,6 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
    if (psp == NULL)
       return NULL;
 
-   /* Initialize per screen dynamic client GLX extensions */
-   psc->ext_list_first_time = GL_TRUE;
-
    psc->driver = driOpenDriver(driverName);
    if (psc->driver == NULL)
       goto handle_error;
index c2de1a3fff8200a39802b8c8a31a739bb4f893aa..b5657baf2e849dfc17e71d739f8c434eff8a2ec6 100644 (file)
@@ -717,6 +717,9 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv)
       if (psc->drawHash == NULL)
          continue;
 
+      /* Initialize per screen dynamic client GLX extensions */
+      psc->ext_list_first_time = GL_TRUE;
+
       if (priv->dri2Display)
          psc->driScreen = (*priv->dri2Display->createScreen) (psc, i, priv);