[Mesa-dev] [PATCH 1/2] Some fixes for GLX_INDIRECT_RENDERING only build

Jon TURNEY jon.turney at dronecode.org.uk
Mon Aug 9 06:50:37 PDT 2010


This fixes some of the build issues with GLX_INDIRECT_RENDERING but not GLX_DIRECT_RENDERING due to recent changes.

There still remain some issues with the use of psc->dpy in indirect_glx.c.
I'm not sure if there's more cleanup coming and that should change to psc->display->dpy?

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 src/glx/glx_pbuffer.c |    6 ++++++
 src/glx/glxcmds.c     |    4 ++--
 src/glx/glxext.c      |    2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index 15bfb15..0b46870 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -86,7 +86,9 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
                         const CARD32 * attribs, size_t num_attribs)
 {
    struct glx_display *priv = __glXInitialize(dpy);
+#ifdef GLX_DIRECT_RENDERING
    __GLXDRIdrawable *pdraw;
+#endif
    CARD32 *output;
    CARD8 opcode;
    int i;
@@ -95,7 +97,9 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
       return;
    }
 
+#ifdef GLX_DIRECT_RENDERING
    pdraw = GetGLXDRIDrawable(dpy, drawable);
+#endif
 
    opcode = __glXSetupForCommand(dpy);
    if (!opcode)
@@ -133,6 +137,7 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
    UnlockDisplay(dpy);
    SyncHandle();
 
+#ifdef GLX_DIRECT_RENDERING
    for (i = 0; i < num_attribs; i++) {
       switch(attribs[i * 2]) {
       case GLX_EVENT_MASK:
@@ -141,6 +146,7 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
 	 break;
       }
    }
+#endif
 
    return;
 }
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 3d4fdc0..7016fdf 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -2163,9 +2163,9 @@ __glXWaitForMscOML(Display * dpy, GLXDrawable drawable,
 {
 #ifdef GLX_DIRECT_RENDERING
    __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
-#endif
    struct glx_screen *psc = pdraw ? pdraw->psc : NULL;
    int ret;
+#endif
 
 
    /* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE
@@ -2195,9 +2195,9 @@ __glXWaitForSbcOML(Display * dpy, GLXDrawable drawable,
 {
 #ifdef GLX_DIRECT_RENDERING
    __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
-#endif
    struct glx_screen *psc = pdraw ? pdraw->psc : NULL;
    int ret;
+#endif
 
    /* The OML_sync_control spec says this should "generate a GLX_BAD_VALUE
     * error", but the return type in the spec is Bool.
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 0f3eebb..8381c3d 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -252,9 +252,9 @@ glx_display_free(struct glx_display *priv)
    if (priv->serverGLXversion)
       Xfree((char *) priv->serverGLXversion);
 
+#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
    __glxHashDestroy(priv->drawHash);
 
-#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
    /* Free the direct rendering per display data */
    if (priv->driswDisplay)
       (*priv->driswDisplay->destroyDisplay) (priv->driswDisplay);
-- 
1.7.1



More information about the mesa-dev mailing list