summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2005-09-13 00:44:52 +0000
committerAdam Jackson <ajax@nwnk.net>2005-09-13 00:44:52 +0000
commitb290884719e18646326f0c2412c2494a07fe3cfd (patch)
treec559997403df39576d49ee129f740a80c018885f
parent846f797f37c1ae57a8dad981113b1139359d8c94 (diff)
Bug #3284: Make the DRI lock reference count per-screen.
-rw-r--r--hw/xfree86/dri/dri.c13
-rw-r--r--hw/xfree86/dri/dristruct.h1
2 files changed, 7 insertions, 7 deletions
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index d47001fb4..3e7d93e87 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -79,7 +79,6 @@ static int DRIScreenPrivIndex = -1;
static int DRIWindowPrivIndex = -1;
static unsigned long DRIGeneration = 0;
static unsigned int DRIDrawableValidationStamp = 0;
-static int lockRefCount=0;
/* Support cleanup for fullscreen mode,
independent of the DRICreateDrawable
@@ -565,7 +564,7 @@ DRICloseScreen(ScreenPtr pScreen)
/* Make sure signals get unblocked etc. */
drmUnlock(pDRIPriv->drmFD, pDRIPriv->myContext);
- lockRefCount=0;
+ pDRIPriv->lockRefCount = 0;
DRIDrvMsg(pScreen->myNum, X_INFO,
"[drm] unmapping %d bytes of SAREA %p at %p\n",
pDRIInfo->SAREASize,
@@ -1910,9 +1909,9 @@ DRILock(ScreenPtr pScreen, int flags)
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
if(!pDRIPriv) return;
- if (!lockRefCount)
+ if (!pDRIPriv->lockRefCount)
DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext, flags);
- lockRefCount++;
+ pDRIPriv->lockRefCount++;
}
void
@@ -1921,14 +1920,14 @@ DRIUnlock(ScreenPtr pScreen)
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
if(!pDRIPriv) return;
- if (lockRefCount > 0) {
- lockRefCount--;
+ if (pDRIPriv->lockRefCount > 0) {
+ pDRIPriv->lockRefCount--;
}
else {
ErrorF("DRIUnlock called when not locked\n");
return;
}
- if (!lockRefCount)
+ if (!pDRIPriv->lockRefCount)
DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext);
}
diff --git a/hw/xfree86/dri/dristruct.h b/hw/xfree86/dri/dristruct.h
index cf1b1eacf..b47afba3a 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;
+ int lockRefCount;
} DRIScreenPrivRec, *DRIScreenPrivPtr;
#endif /* DRI_STRUCT_H */