diff options
author | Adam Jackson <ajax@nwnk.net> | 2006-01-06 18:06:02 +0000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2006-01-06 18:06:02 +0000 |
commit | fe0c838b5d8bc8d9cf5a686bb7d3e90682d2d19a (patch) | |
tree | 95b43e6a6b6df348e15751348f1b6a0175a5331d | |
parent | 39ce5f1544029412f4060f3e89ce1d87222ef42b (diff) |
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.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | hw/xfree86/dri/dri.c | 33 | ||||
-rw-r--r-- | hw/xfree86/dri/dristruct.h | 1 |
3 files changed, 16 insertions, 26 deletions
@@ -1,5 +1,13 @@ 2006-01-06 Adam Jackson <ajax@freedesktop.org> + * 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 <ajax@freedesktop.org> + * hw/xfree86/loader/misym.c: * mi/Makefile.am: * mi/mi.h: 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; |