Index: dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/GL/dri/dri.c,v retrieving revision 1.7 diff -u -d -r1.7 dri.c --- dri.c 8 Dec 2004 05:52:20 -0000 1.7 +++ dri.c 8 Sep 2005 00:57:53 -0000 @@ -1411,6 +1411,11 @@ DRI_2D_CONTEXT, pDRIPriv->partial3DContextStore); } + + if (pDRIPriv->windowsTouched) + DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1); + pDRIPriv->windowsTouched = FALSE; + DRIUnlock(pScreen); } @@ -1757,13 +1762,6 @@ } } -/* It appears that somebody is relying on the lock being set even - if we aren't touching 3D windows */ - -#define DRI_BROKEN - -static Bool DRIWindowsTouched = FALSE; - int DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) { @@ -1774,15 +1772,6 @@ if(!pDRIPriv) return returnValue; - DRIWindowsTouched = FALSE; - -#ifdef DRI_BROKEN - if(!DRIWindowsTouched) { - DRILockTree(pScreen); - DRIWindowsTouched = TRUE; - } -#endif - /* call lower wrapped functions */ if(pDRIPriv->wrap.ValidateTree) { /* unwrap */ @@ -1823,12 +1812,6 @@ pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; pScreen->PostValidateTree = DRIPostValidateTree; } - - if (DRIWindowsTouched) { - /* Release spin lock */ - DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1); - DRIWindowsTouched = FALSE; - } } void @@ -1842,12 +1825,10 @@ if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { -#ifndef DRI_BROKEN - if(!DRIWindowsTouched) { + if(!pDRIPriv->windowsTouched) { DRILockTree(pScreen); - DRIWindowsTouched = TRUE; + pDRIPriv->windowsTouched = TRUE; } -#endif pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp = DRIDrawableValidationStamp++; Index: dristruct.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/GL/dri/dristruct.h,v retrieving revision 1.3 diff -u -d -r1.3 dristruct.h --- dristruct.h 16 Jun 2004 09:37:58 -0000 1.3 +++ dristruct.h 8 Sep 2005 00:57:53 -0000 @@ -99,6 +99,7 @@ Bool grabbedDRILock; Bool drmSIGIOHandlerInstalled; Bool wrapped; + Bool windowsTouched; } DRIScreenPrivRec, *DRIScreenPrivPtr; #endif /* DRI_STRUCT_H */