diff --git a/ChangeLog b/ChangeLog index 78c98cfe7..66fcca4d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-01-06 Adam Jackson + + * hw/xfree86/dri/dri.c: + * hw/xfree86/dri/dristruct.h: + Move drawable lock acquisition into DRIClipNotify from DRIValidateTree, so we only take it when + clipping a DRI drawable instead of on every tree update. Note drawable lock acquisition per- + screen instead of globally, and drop it in BlockHandler if necessary. + 2006-01-06 Adam Jackson * hw/xfree86/loader/misym.c: diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 424a21c68..fdfa57557 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -1405,6 +1405,11 @@ DRIDoBlockHandler(int screenNum, pointer blockData, DRI_2D_CONTEXT, pDRIPriv->partial3DContextStore); } + + if (pDRIPriv->windowsTouched) + DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1); + pDRIPriv->windowsTouched = FALSE; + DRIUnlock(pScreen); } @@ -1751,13 +1756,6 @@ DRILockTree(ScreenPtr pScreen) } } -/* 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) { @@ -1768,15 +1766,6 @@ DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) 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 */ @@ -1817,12 +1806,6 @@ DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; pScreen->PostValidateTree = DRIPostValidateTree; } - - if (DRIWindowsTouched) { - /* Release spin lock */ - DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1); - DRIWindowsTouched = FALSE; - } } void @@ -1836,12 +1819,10 @@ DRIClipNotify(WindowPtr pWin, int dx, int dy) 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++; diff --git a/hw/xfree86/dri/dristruct.h b/hw/xfree86/dri/dristruct.h index b47afba3a..6dc86d5c4 100644 --- a/hw/xfree86/dri/dristruct.h +++ b/hw/xfree86/dri/dristruct.h @@ -99,6 +99,7 @@ typedef struct _DRIScreenPrivRec Bool grabbedDRILock; Bool drmSIGIOHandlerInstalled; Bool wrapped; + Bool windowsTouched; int lockRefCount; } DRIScreenPrivRec, *DRIScreenPrivPtr;