summaryrefslogtreecommitdiffstats
path: root/src/glx/x11/glxext.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/x11/glxext.c')
-rw-r--r--src/glx/x11/glxext.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index 75b7374a3fb..777828569f4 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -194,9 +194,14 @@ static int __glXFreeDisplayPrivate(XExtData *extension)
#ifdef GLX_DIRECT_RENDERING
/* Free the direct rendering per display data */
+ if (priv->driswDisplay)
+ (*priv->driswDisplay->destroyDisplay)(priv->driswDisplay);
+ priv->driswDisplay = NULL;
+
if (priv->driDisplay)
(*priv->driDisplay->destroyDisplay)(priv->driDisplay);
priv->driDisplay = NULL;
+
if (priv->dri2Display)
(*priv->dri2Display->destroyDisplay)(priv->dri2Display);
priv->dri2Display = NULL;
@@ -596,10 +601,16 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
psc->drawHash = __glxHashCreate();
if (psc->drawHash == NULL)
continue;
+
if (priv->dri2Display)
psc->driScreen = (*priv->dri2Display->createScreen)(psc, i, priv);
+
if (psc->driScreen == NULL && priv->driDisplay)
psc->driScreen = (*priv->driDisplay->createScreen)(psc, i, priv);
+
+ if (psc->driScreen == NULL && priv->driswDisplay)
+ psc->driScreen = (*priv->driswDisplay->createScreen)(psc, i, priv);
+
if (psc->driScreen == NULL) {
__glxHashDestroy(psc->drawHash);
psc->drawHash = NULL;
@@ -693,8 +704,9 @@ _X_HIDDEN __GLXdisplayPrivate *__glXInitialize(Display* dpy)
** (e.g., those called in AllocAndFetchScreenConfigs).
*/
if (getenv("LIBGL_ALWAYS_INDIRECT") == NULL) {
- dpyPriv->dri2Display = dri2CreateDisplay(dpy);
+ dpyPriv->dri2Display = dri2CreateDisplay(dpy);
dpyPriv->driDisplay = driCreateDisplay(dpy);
+ dpyPriv->driswDisplay = driswCreateDisplay(dpy);
}
#endif