Module: Mesa
Branch: 7.8
Commit: ae7b3a632dd3f3b005459d77b66a77948260f716
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae7b3a632dd3f3b005459d77b66a77948260f716

Author: Brian Paul <[email protected]>
Date:   Fri Mar  5 17:32:36 2010 -0700

glx: Move initialization of ext_list_first_time to where it's storage is 
allocated

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 <[email protected]>
Signed-off-by: Brian Paul <[email protected]>

(cherry picked from commit 96ab4d2b84178209ee59017458d9964b32b7e183)

---

 src/glx/dri2_glx.c  |    3 ---
 src/glx/dri_glx.c   |    3 ---
 src/glx/drisw_glx.c |    3 ---
 src/glx/glxext.c    |    3 +++
 4 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index d573e46..5b0f335 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -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);
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
index f9fe9a2..e47db82 100644
--- a/src/glx/dri_glx.c
+++ b/src/glx/dri_glx.c
@@ -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;
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index eed9a8c..1b94a56 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -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;
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index c2de1a3..b5657ba 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -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);
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to