Mesa (master): glx: Fix compilation errors on non-GLX_DIRECT_RENDERING builds.

Ian Romanick idr at kemper.freedesktop.org
Sun Apr 4 16:56:23 PDT 2010


Module: Mesa
Branch: master
Commit: 16f568a1830ea17da82683f97e016cdc0aae0c65
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=16f568a1830ea17da82683f97e016cdc0aae0c65

Author: Vinson Lee <vlee at vmware.com>
Date:   Thu Apr  1 00:10:28 2010 -0700

glx: Fix compilation errors on non-GLX_DIRECT_RENDERING builds.

driContext field for __GLXcontextRec struct is only defined if
GLX_DIRECT_RENDERING is set.

---

 src/glx/glxcmds.c |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 49cbce7..8f809dc 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -1917,6 +1917,7 @@ __glXSwapIntervalSGI(int interval)
 #endif
    psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
 
+#ifdef GLX_DIRECT_RENDERING
    if (gc->driContext && psc->driScreen && psc->driScreen->setSwapInterval) {
       __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(gc->currentDpy,
 						  gc->currentDrawable,
@@ -1924,6 +1925,7 @@ __glXSwapIntervalSGI(int interval)
       psc->driScreen->setSwapInterval(pdraw, interval);
       return 0;
    }
+#endif
 
    dpy = gc->currentDpy;
    opcode = __glXSetupForCommand(dpy);
@@ -1974,6 +1976,7 @@ __glXSwapIntervalMESA(unsigned int interval)
    }
 #endif
 
+#ifdef GLX_DIRECT_RENDERING
    if (gc != NULL && gc->driContext) {
       __GLXscreenConfigs *psc;
 
@@ -1985,6 +1988,7 @@ __glXSwapIntervalMESA(unsigned int interval)
 	 return 0;
       }
    }
+#endif
 
    return GLX_BAD_CONTEXT;
 }
@@ -2137,9 +2141,14 @@ __glXGetVideoSyncSGI(unsigned int *count)
    __GLXscreenConfigs *psc;
    __GLXDRIdrawable *pdraw;
 
-   if (!gc || !gc->driContext)
+   if (!gc)
       return GLX_BAD_CONTEXT;
 
+#ifdef GLX_DIRECT_RENDERING
+   if (!gc->driContext)
+      return GLX_BAD_CONTEXT;
+#endif
+
    psc = GetGLXScreenConfigs(gc->currentDpy, gc->screen);
    pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
 
@@ -2177,9 +2186,14 @@ __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
    if (divisor <= 0 || remainder < 0)
       return GLX_BAD_VALUE;
 
-   if (!gc || !gc->driContext)
+   if (!gc)
       return GLX_BAD_CONTEXT;
 
+#ifdef GLX_DIRECT_RENDERING
+   if (!gc->driContext)
+      return GLX_BAD_CONTEXT;
+#endif
+
    psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
    pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
 
@@ -2494,9 +2508,14 @@ __glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable,
    __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
    __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
 
-   if (!pdraw || !gc || !gc->driContext) /* no GLX for this */
+   if (!pdraw || !gc) /* no GLX for this */
       return -1;
 
+#ifdef GLX_DIRECT_RENDERING
+   if (!gc->driContext)
+      return -1;
+#endif
+
    /* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE
     * error", but it also says "It [glXSwapBuffersMscOML] will return a value
     * of -1 if the function failed because of errors detected in the input



More information about the mesa-commit mailing list