xserver: Branch 'master' - 2 commits

Kristian Høgsberg krh at kemper.freedesktop.org
Thu Oct 25 15:49:09 PDT 2007


 GL/glx/glxcmds.c    |    4 +---
 GL/glx/glxcontext.h |    5 -----
 GL/glx/glxdri.c     |   19 ++++++++++++++-----
 GL/glx/glxext.c     |    2 ++
 4 files changed, 17 insertions(+), 13 deletions(-)

New commits:
commit f62277d421023b3150d3a1accb00a8206ab2bde3
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Thu Oct 25 18:48:39 2007 -0400

    Clean up unused pVisual part of __GLXcontext.

diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c
index 992ddbc..4a77b3e 100644
--- a/GL/glx/glxcmds.c
+++ b/GL/glx/glxcmds.c
@@ -190,7 +190,6 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
 		__GLXscreen *pGlxScreen, GLboolean isDirect)
 {
     ClientPtr client = cl->client;
-    VisualPtr pVisual;
     __GLXcontext *glxc, *shareglxc;
 
     LEGAL_NEW_RESOURCE(gcId, client);
@@ -250,7 +249,6 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
     */
     glxc->pScreen = pGlxScreen->pScreen;
     glxc->pGlxScreen = pGlxScreen;
-    glxc->pVisual = pVisual;
     glxc->modes = config;
 
     /*
@@ -1470,7 +1468,7 @@ DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
     *pSendBuf++ = GLX_SHARE_CONTEXT_EXT;
     *pSendBuf++ = (int)(ctx->share_id);
     *pSendBuf++ = GLX_VISUAL_ID_EXT;
-    *pSendBuf++ = (int)(ctx->pVisual->vid);
+    *pSendBuf++ = (int)(ctx->modes->visualID);
     *pSendBuf++ = GLX_SCREEN_EXT;
     *pSendBuf++ = (int)(ctx->pScreen->myNum);
 
diff --git a/GL/glx/glxcontext.h b/GL/glx/glxcontext.h
index 7122647..cf944a1 100644
--- a/GL/glx/glxcontext.h
+++ b/GL/glx/glxcontext.h
@@ -89,11 +89,6 @@ struct __GLXcontext {
     __GLXscreen *pGlxScreen;
 
     /*
-    ** This context is created with respect to this visual.
-    */
-    VisualRec *pVisual;
-
-    /*
     ** The XID of this context.
     */
     XID id;
commit 30bcaa966d6b00f1630609a78db18dee683cc43d
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Thu Oct 25 18:48:06 2007 -0400

    Make glx destroy path handle cases where the X window goes away first.

diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index 3688d50..5c45cd1 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -185,10 +185,14 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
 
     (*private->driDrawable.destroyDrawable)(&private->driDrawable);
 
-    __glXenterServer(GL_FALSE);
-    DRIDestroyDrawable(drawable->pDraw->pScreen,
-		       serverClient, drawable->pDraw);
-    __glXleaveServer(GL_FALSE);
+    /* If the X window was destroyed, the dri DestroyWindow hook will
+     * aready have taken care of this, so only call if pDraw isn't NULL. */
+    if (drawable->pDraw != NULL) {
+	    __glXenterServer(GL_FALSE);
+	    DRIDestroyDrawable(drawable->pDraw->pScreen,
+			       serverClient, drawable->pDraw);
+	    __glXleaveServer(GL_FALSE);
+    }
 
     xfree(private);
 }
@@ -668,11 +672,16 @@ getDrawableInfo(__DRIdrawable *driDrawable,
 {
     __GLXDRIdrawable *drawable = containerOf(driDrawable,
 					     __GLXDRIdrawable, driDrawable);
-    ScreenPtr pScreen = drawable->base.pDraw->pScreen;
+    ScreenPtr pScreen;
     drm_clip_rect_t *pClipRects, *pBackClipRects;
     GLboolean retval;
     size_t size;
 
+    /* If the X window has been destroyed, give up here. */
+    if (drawable->base.pDraw == NULL)
+	return GL_FALSE;
+
+    pScreen = drawable->base.pDraw->pScreen;
     __glXenterServer(GL_FALSE);
     retval = DRIGetDrawableInfo(pScreen, drawable->base.pDraw, index, stamp,
 				x, y, width, height,
diff --git a/GL/glx/glxext.c b/GL/glx/glxext.c
index 546d87f..7725389 100644
--- a/GL/glx/glxext.c
+++ b/GL/glx/glxext.c
@@ -122,6 +122,8 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
 	cx->pendingState |= __GLX_PENDING_DESTROY;
     }
 
+    glxPriv->pDraw = NULL;
+    glxPriv->drawId = 0;
     __glXUnrefDrawable(glxPriv);
 
     return True;


More information about the xorg-commit mailing list