summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkem <kem>2000-02-25 22:36:14 +0000
committerkem <kem>2000-02-25 22:36:14 +0000
commit1bbe34ec8183edd52ff2646b8e78386d6146a643 (patch)
tree7239f9834948c5a933111235fd5364be819d8706
parent7e709c6553ed64723c36a47fb2401bfd320980a1 (diff)
Change DRIValidateTree() locks to use DRILock/DRIUnlock instead of callingdispatch-0-0-3-20000225dispatch-0-0-3-branch
the DRM_* macros directly.
-rw-r--r--xc/programs/Xserver/GL/dri/dri.c11
-rw-r--r--xc/programs/Xserver/GL/dri/dri.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c4
4 files changed, 10 insertions, 11 deletions
diff --git a/xc/programs/Xserver/GL/dri/dri.c b/xc/programs/Xserver/GL/dri/dri.c
index 63e3a95d2..6ec7e1189 100644
--- a/xc/programs/Xserver/GL/dri/dri.c
+++ b/xc/programs/Xserver/GL/dri/dri.c
@@ -960,7 +960,7 @@ DRIWakeupHandler(
ScreenPtr pScreen = screenInfo.screens[screenNum];
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRILock(pScreen);
+ DRILock(pScreen, 0);
if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
/* hide X context by swapping 2D component here */
(*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
@@ -1358,7 +1358,7 @@ DRIValidateTree(
}
/* Call kernel to release lock */
- DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext);
+ DRIUnlock(pScreen);
/* Grab drawable spin lock: a time out between 10 and 30 seconds is
appropriate, since this should never time out except in the case of
@@ -1367,8 +1367,7 @@ DRIValidateTree(
DRISpinLockTimeout(&pDRIPriv->pSAREA->drawable_lock, 1, 10000); /* 10 secs */
/* Call kernel flush outstanding buffers and relock */
- DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext,
- DRM_LOCK_QUIESCENT|DRM_LOCK_FLUSH_ALL);
+ DRILock(pScreen, DRM_LOCK_QUIESCENT|DRM_LOCK_FLUSH_ALL);
/* Switch back to our 2D context if the X context is hidden */
if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
@@ -1464,11 +1463,11 @@ DRIGetDrawableIndex(
}
void
-DRILock(ScreenPtr pScreen) {
+DRILock(ScreenPtr pScreen, int flags) {
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
if (!lockRefCount)
- DRM_LIGHT_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext);
+ DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext, flags);
lockRefCount++;
}
diff --git a/xc/programs/Xserver/GL/dri/dri.h b/xc/programs/Xserver/GL/dri/dri.h
index 4626ec667..653740265 100644
--- a/xc/programs/Xserver/GL/dri/dri.h
+++ b/xc/programs/Xserver/GL/dri/dri.h
@@ -218,7 +218,7 @@ void DRIClipNotify(
int dy);
CARD32 DRIGetDrawableIndex(
WindowPtr pWin);
-void DRILock(ScreenPtr pScreen);
+void DRILock(ScreenPtr pScreen, int flags);
void DRIUnlock(ScreenPtr pScreen);
void *DRIGetSAREAPrivate(ScreenPtr pScreen);
DRIContextPrivPtr
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
index de1cd5868..9691d9392 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
@@ -1395,7 +1395,7 @@ I810ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
#ifdef XF86DRI
if (pI810->directRenderingEnabled) {
- DRILock(screenInfo.screens[pScrn->scrnIndex]);
+ DRILock(screenInfo.screens[pScrn->scrnIndex], 0);
/* I810SwapContextPrivate(screenInfo.screens[pScrn->scrnIndex]); */
}
#endif
@@ -1834,7 +1834,7 @@ I810LeaveVT(int scrnIndex, int flags) {
vgaHWLock(hwp);
#ifdef XF86DRI
if (pI810->directRenderingEnabled)
- DRILock( screenInfo.screens[scrnIndex] );
+ DRILock( screenInfo.screens[scrnIndex], 0 );
#endif
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
index 55e6cd785..4ba730a5c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
@@ -1315,7 +1315,7 @@ TDFXModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
#ifdef XF86DRI
if (pTDFX->directRenderingEnabled) {
- DRILock(screenInfo.screens[pScrn->scrnIndex]);
+ DRILock(screenInfo.screens[pScrn->scrnIndex], 0);
TDFXSwapContextPrivate(screenInfo.screens[pScrn->scrnIndex]);
}
#endif
@@ -1774,7 +1774,7 @@ TDFXLeaveVT(int scrnIndex, int flags) {
#ifdef XF86DRI
pTDFX = TDFXPTR(pScrn);
if (pTDFX->directRenderingEnabled) {
- DRILock(pScreen);
+ DRILock(pScreen, 0);
}
#endif
}