xserver: Branch 'glucose-2'

Jose Fonseca jrfonseca at kemper.freedesktop.org
Sat Oct 6 10:33:23 PDT 2007


 hw/xfree86/dri/dri.c |   24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

New commits:
diff-tree 498020054a9d0abd085fe030c5627f6b5cbd8a58 (from d4653198ddad5882c2646d8bbec7a1e1b6250ce7)
Author: José Fonseca <jfonseca at pegasus.(none)>
Date:   Sat Oct 6 18:32:10 2007 +0100

    Fix merge.

diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index ddce1e6..6d474a3 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -1367,7 +1367,7 @@ DRICreateDrawable(ScreenPtr pScreen, Cli
 
 	/* track this in case the client dies */
 	AddResource(FakeClientID(client->index), DRIDrawablePrivResType,
-		    (pointer)pPixmap);
+		    (pointer)pDrawable->id);
 
 	if (pDRIDrawablePriv->hwDrawable)
 	    *hHWDrawable = pDRIDrawablePriv->hwDrawable;
@@ -1434,10 +1434,9 @@ DRIDestroyDrawable(ScreenPtr pScreen, Cl
 				    (pointer)pDrawable->id);
     }
     else if (pDrawable->type == DRAWABLE_PIXMAP) {
-	PixmapPtr pPixmap = (PixmapPtr)pDrawable;
 	LookupClientResourceComplex(client, DRIDrawablePrivResType,
 				    DRIDestroyDrawableCB,
-				    (pointer)pPixmap);
+				    (pointer)pDrawable->id);
     }
     else { /* for GLX 1.3, a PBuffer */
 	/* NOT_DONE */
@@ -1471,9 +1470,17 @@ DRIDrawablePrivDelete(pointer pResource,
     pPixmap = LookupIDByType(id, RT_PIXMAP);
 
     if (pPixmap) {
-	DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pPixmap->drawable.pScreen);
 	DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPixmap);
+	ScreenPtr pScreen;
+	DRIScreenPrivPtr pDRIPriv;
+
+	if (!pDRIDrawablePriv)
+	    return FALSE;
+
+	pScreen = pPixmap->drawable.pScreen;
+	pDRIPriv = DRI_SCREEN_PRIV(pScreen);
 
+	if (--pDRIDrawablePriv->refCount == 0) {
 	if (pDRIDrawablePriv->drawableIndex != -1) {
 	    /* bump stamp to force outstanding 3D requests to resync */
 	    pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp
@@ -1483,16 +1490,15 @@ DRIDrawablePrivDelete(pointer pResource,
 	    pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL;
 	}
 
-	if (drmDestroyDrawable(pDRIPriv->drmFD,
-			       pDRIDrawablePriv->hwDrawable)) {
-	    return FALSE;
-	}
+	    drmDestroyDrawable(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable);
 
 	xfree(pDRIDrawablePriv);
 	pPixmap->devPrivates[DRIPixmapPrivIndex].ptr = NULL;
     }
 
-    { /* or for GLX 1.3, a PBuffer */
+	return TRUE;
+    }
+    else { /* or for GLX 1.3, a PBuffer */
 	/* NOT_DONE */
 	return FALSE;
     }


More information about the xorg-commit mailing list