summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glx/x11/glxcmds.c8
-rw-r--r--src/glx/x11/glxext.c3
2 files changed, 7 insertions, 4 deletions
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index c761ddf29ff..1437ea54425 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -360,6 +360,10 @@ CreateContext(Display *dpy, XVisualInfo *vis,
Bool use_glx_1_3, int renderType)
{
GLXContext gc;
+#ifdef GLX_DIRECT_RENDERING
+ int screen = (fbconfig == NULL) ? vis->screen : fbconfig->screen;
+ __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen);
+#endif
if ( dpy == NULL )
return NULL;
@@ -373,9 +377,7 @@ CreateContext(Display *dpy, XVisualInfo *vis,
return NULL;
#ifdef GLX_DIRECT_RENDERING
- if (allowDirect) {
- int screen = (fbconfig == NULL) ? vis->screen : fbconfig->screen;
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen);
+ if (allowDirect && psc->driScreen) {
const __GLcontextModes * mode;
if (fbconfig == NULL) {
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index 47f8da04b29..bb3fc894033 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -771,7 +771,8 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
psc->scr = i;
psc->dpy = dpy;
#ifdef GLX_DIRECT_RENDERING
- psc->driScreen = (*priv->driDisplay->createScreen)(psc, i, priv);
+ if (priv->driDisplay)
+ psc->driScreen = (*priv->driDisplay->createScreen)(psc, i, priv);
#endif
}
SyncHandle();