summaryrefslogtreecommitdiffstats
path: root/src/glx/glxext.c
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-07-19 21:15:50 -0400
committerKristian Høgsberg <[email protected]>2010-07-19 22:45:51 -0400
commite3e8196c025bd344a59b4671e473c395a6ea426b (patch)
tree3178db533025d91fa69563486c5034cf5f37e854 /src/glx/glxext.c
parent037755122e9011c768e5caa4d4cb83aba783d3e9 (diff)
glx: Move drawHash to display private
The XIDs are display wide so the natural location of the hash is here. This way we don't have to lookup in each of the screen hashes.
Diffstat (limited to 'src/glx/glxext.c')
-rw-r--r--src/glx/glxext.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 445592f1a8a..65aacc5887d 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -268,7 +268,6 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv)
psc->driver_configs = NULL;
}
if (psc->driScreen) {
- __glxHashDestroy(psc->drawHash);
psc->driScreen->destroyScreen(psc);
psc->driScreen = NULL;
} else {
@@ -302,6 +301,8 @@ __glXFreeDisplayPrivate(XExtData * extension)
priv->serverGLXversion = 0x0; /* to protect against double free's */
}
+ __glxHashDestroy(priv->drawHash);
+
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
/* Free the direct rendering per display data */
if (priv->driswDisplay)
@@ -758,10 +759,7 @@ glx_screen_init(__GLXscreenConfigs *psc,
psc->ext_list_first_time = GL_TRUE;
psc->scr = screen;
psc->dpy = priv->dpy;
- psc->drawHash = __glxHashCreate();
psc->display = priv;
- if (psc->drawHash == NULL)
- return GL_FALSE;
getVisualConfigs(psc, priv, screen);
getFBConfigs(psc, priv, screen);
@@ -815,11 +813,6 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv)
psc = (*priv->driswDisplay->createScreen) (i, priv);
if (psc == NULL)
psc = createIndirectScreen (i, priv);
-
- if (psc == NULL) {
- __glxHashDestroy(psc->drawHash);
- psc->drawHash = NULL;
- }
#endif
priv->screenConfigs[i] = psc;
}
@@ -899,6 +892,8 @@ __glXInitialize(Display * dpy)
glx_direct = (getenv("LIBGL_ALWAYS_INDIRECT") == NULL);
glx_accel = (getenv("LIBGL_ALWAYS_SOFTWARE") == NULL);
+ dpyPriv->drawHash = __glxHashCreate();
+
/*
** Initialize the direct rendering per display data and functions.
** Note: This _must_ be done before calling any other DRI routines