summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@code-monkey.de>2006-08-09 21:59:42 +0200
committerTilman Sauerbeck <tilman@code-monkey.de>2006-08-09 21:59:42 +0200
commitbde592047cd62194d7ef67520a9fdbaf269a8b90 (patch)
tree324c786cf7b3a82864662b4b6ffa2ba24f09a6eb /src
parent7170de83762660efebff79be84f763008466ffa7 (diff)
Bug #7265: Fix MGA DRI locking.
The server expects the driver to take the DRI lock in the wakeup handler, and release it in the block handler. The old locking scheme didn't work like this, which caused problems. We now no longer override wakeup/block handler and just use the ones provided by the server. This means the DRI lock will be taken "all the time" and not just when it's needed by the driver. MGADRISwapContext* are activated again, so the wakeup handler could be removed. I didn't notice any DRI performance drop, but I didn't do serious benchmarking either.
Diffstat (limited to 'src')
-rw-r--r--src/mga_dri.c59
1 files changed, 5 insertions, 54 deletions
diff --git a/src/mga_dri.c b/src/mga_dri.c
index a43ebe4..6775cff 100644
--- a/src/mga_dri.c
+++ b/src/mga_dri.c
@@ -363,7 +363,6 @@ void MGAGetQuiescence( ScrnInfoPtr pScrn )
{
MGAPtr pMga = MGAPTR(pScrn);
- DRILock( screenInfo.screens[pScrn->scrnIndex], 0 );
pMga->haveQuiescense = 1;
if ( pMga->directRenderingEnabled ) {
@@ -401,8 +400,6 @@ void MGAGetQuiescenceShared( ScrnInfoPtr pScrn )
MGAEntPtr pMGAEnt = pMga->entityPrivate;
MGAPtr pMGA2 = MGAPTR(pMGAEnt->pScrn_2);
- DRILock( screenInfo.screens[pMGAEnt->pScrn_1->scrnIndex], 0 );
-
pMga = MGAPTR(pMGAEnt->pScrn_1);
pMga->haveQuiescense = 1;
pMGA2->haveQuiescense = 1;
@@ -442,7 +439,11 @@ static void MGASwapContextShared( ScreenPtr pScreen )
pMGA2->AccelInfoRec->NeedToSync = TRUE;
}
-/* This is really only called from validate/postvalidate as we
+/* FIXME: This comment is out of date, since we aren't overriding
+ * Block/Wakeuphandler anymore.
+ *
+ *
+ * This is really only called from validate/postvalidate as we
* override the dri lock/unlock. Want to remove validate/postvalidate
* processing, but need to remove all client-side use of drawable lock
* first (otherwise there is noone recover when a client dies holding
@@ -464,14 +465,12 @@ MGADRISwapContext( ScreenPtr pScreen, DRISyncType syncType,
DRIContextType oldContextType, void *oldContext,
DRIContextType newContextType, void *newContext )
{
-#if 0
if ( syncType == DRI_3D_SYNC &&
oldContextType == DRI_2D_CONTEXT &&
newContextType == DRI_2D_CONTEXT )
{
MGASwapContext( pScreen );
}
-#endif
}
static void
@@ -479,58 +478,12 @@ MGADRISwapContextShared( ScreenPtr pScreen, DRISyncType syncType,
DRIContextType oldContextType, void *oldContext,
DRIContextType newContextType, void *newContext )
{
-#if 0
if ( syncType == DRI_3D_SYNC &&
oldContextType == DRI_2D_CONTEXT &&
newContextType == DRI_2D_CONTEXT )
{
MGASwapContextShared( pScreen );
}
-#endif
-}
-
-
-static void MGAWakeupHandler( int screenNum, pointer wakeupData,
- unsigned long result, pointer pReadmask )
-{
- ScreenPtr pScreen = screenInfo.screens[screenNum];
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- MGAPtr pMga = MGAPTR(pScrn);
-
- if ( xf86IsEntityShared( pScrn->entityList[0] )
- && pMga->DualHeadEnabled) {
- MGASwapContextShared( pScreen );
- } else {
- MGASwapContext( pScreen );
- }
-}
-
-static void MGABlockHandler( int screenNum, pointer blockData,
- pointer pTimeout, pointer pReadmask )
-
-{
- ScreenPtr pScreen = screenInfo.screens[screenNum];
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- MGAPtr pMga = MGAPTR(pScrn);
- MGAEntPtr pMGAEnt;
-
- if ( pMga->haveQuiescense ) {
- if ( xf86IsEntityShared( pScrn->entityList[0] ) ) {
- /* Restore to first screen */
- pMga->RestoreAccelState( pScrn );
- xf86SetLastScrnFlag( pScrn->entityList[0], pScrn->scrnIndex );
- pMGAEnt = pMga->entityPrivate;
-
- if ( pMGAEnt->directRenderingEnabled ) {
- DRIUnlock( screenInfo.screens[pMGAEnt->pScrn_1->scrnIndex] );
- }
- } else {
- if ( pMga->directRenderingEnabled ) {
- DRIUnlock( pScreen );
- }
- }
- pMga->haveQuiescense = 0;
- }
}
void MGASelectBuffer( ScrnInfoPtr pScrn, int which )
@@ -1030,8 +983,6 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
pDRIInfo->frameBufferStride = pScrn->displayWidth*(pScrn->bitsPerPixel/8);
pDRIInfo->ddxDrawableTableEntry = MGA_MAX_DRAWABLES;
- pDRIInfo->wrap.BlockHandler = MGABlockHandler;
- pDRIInfo->wrap.WakeupHandler = MGAWakeupHandler;
pDRIInfo->wrap.ValidateTree = NULL;
pDRIInfo->wrap.PostValidateTree = NULL;