summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Deucher <alex@samba.(none)>2006-09-18 22:30:13 -0400
committerAlex Deucher <alex@samba.(none)>2006-09-18 22:30:13 -0400
commitbaa74b10d7a1c304dba2d658e4d1336b7ee7e70e (patch)
tree6dc53d27a6e779649f7d58ad7ca9c54223cea0b5 /src
parentbb1eac0b6b0d2ab02bd7b47f3c2e4b3f40e7486f (diff)
fix DRI locking in savage driver. Based on ajax's similar patch.
Thanks to ajax and tilman for locking advice and Pascal Sclafer for tracking this down. Fixes bug 6357.
Diffstat (limited to 'src')
-rw-r--r--src/savage_dri.c10
-rw-r--r--src/savage_driver.h3
2 files changed, 10 insertions, 3 deletions
diff --git a/src/savage_dri.c b/src/savage_dri.c
index b55573e..cefe1a7 100644
--- a/src/savage_dri.c
+++ b/src/savage_dri.c
@@ -338,7 +338,9 @@ static void SAVAGEWakeupHandler( int screenNum, pointer wakeupData,
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
SavagePtr psav = SAVPTR(pScrn);
- DRILock(pScreen, 0);
+ psav->pDRIInfo->wrap.WakeupHandler = psav->coreWakeupHandler;
+ (*psav->pDRIInfo->wrap.WakeupHandler) (screenNum, wakeupData, result, pReadmask);
+ psav->pDRIInfo->wrap.WakeupHandler = SAVAGEWakeupHandler;
psav->LockHeld = 1;
if (psav->ShadowStatus) {
/* fetch the global shadow counter */
@@ -376,7 +378,9 @@ static void SAVAGEBlockHandler( int screenNum, pointer blockData,
psav->ShadowVirtual[1023] = globalShadowCounter;
}
psav->LockHeld = 0;
- DRIUnlock(pScreen);
+ psav->pDRIInfo->wrap.BlockHandler = psav->coreBlockHandler;
+ (*psav->pDRIInfo->wrap.BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
+ psav->pDRIInfo->wrap.BlockHandler = SAVAGEBlockHandler;
}
void SAVAGESelectBuffer( ScrnInfoPtr pScrn, int which )
@@ -888,7 +892,9 @@ Bool SAVAGEDRIScreenInit( ScreenPtr pScreen )
pDRIInfo->ddxDrawableTableEntry = SAVAGE_MAX_DRAWABLES;
/* override default DRI block and wakeup handler */
+ psav->coreBlockHandler = pDRIInfo->wrap.BlockHandler;
pDRIInfo->wrap.BlockHandler = SAVAGEBlockHandler;
+ psav->coreWakeupHandler = pDRIInfo->wrap.WakeupHandler;
pDRIInfo->wrap.WakeupHandler = SAVAGEWakeupHandler;
pDRIInfo->wrap.ValidateTree = NULL;
diff --git a/src/savage_driver.h b/src/savage_driver.h
index f2193c3..f963fd7 100644
--- a/src/savage_driver.h
+++ b/src/savage_driver.h
@@ -444,7 +444,8 @@ typedef struct _Savage {
__GLXvisualConfig* pVisualConfigs;
SAVAGEConfigPrivPtr pVisualConfigsPriv;
SAVAGEDRIServerPrivatePtr DRIServerInfo;
-
+ ScreenWakeupHandlerProcPtr coreWakeupHandler;
+ ScreenBlockHandlerProcPtr coreBlockHandler;
#if 0
Bool haveQuiescense;