Tilman Sauerbeck [2006-07-28 14:42]: > Michel Dänzer [2006-07-28 13:40]: > > Are you familiar with the X server's function wrapping mechanism? > > DRI(Do)BlockHandler() is the DRI module's wrapper of the X server's > > BlockHandler screen hook, which it calls whenever it has run out of > > requests and goes to sleep for a bit. For symmetry, there's a DRILock() > > call in DRIDoWakeupHandler(), which is a wrapper for the hook the X > > server calls before it starts processing new requests. The idea is for > > the DRI module to automatically hold the lock whenever the X server > > might need hardware access. > > I should have asked a more specific question. While DRIBlockHandler() > was called all the time, DRIDoBlockHandler() was only called once, which > led to the bad DRIUnlock() call. I wanted to know when > DRI_Do_BlockHandler() is called :) > > Looking at the code again, it seems DRIDoWakeupHandler() and > DRIDoBlockHandler() are the base functions for the job, which may be > overridden by the DDX driver. MGA overrides both in MGADRIScreenInit().
So it seems like mga_dri.c's MGAWakeupHandler should always call DRILock(). The attached patch implements this change - it makes glxinfo work again. It's probably horribly wrong though... :) glxgears still hangs in glxMakeCurrent(). Any idea what to try next? Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
diff --git a/src/mga_dri.c b/src/mga_dri.c index a43ebe4..246e87e 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 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; @@ -496,13 +493,24 @@ static void MGAWakeupHandler( int screen ScreenPtr pScreen = screenInfo.screens[screenNum]; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; MGAPtr pMga = MGAPTR(pScrn); + MGAEntPtr pMGAEnt; if ( xf86IsEntityShared( pScrn->entityList[0] ) && pMga->DualHeadEnabled) { + pMGAEnt = pMga->entityPrivate; + + if (pMGAEnt->directRenderingEnabled) + DRILock(screenInfo.screens[pMGAEnt->pScrn_1->scrnIndex], 0); + MGASwapContextShared( pScreen ); } else { + if (pMga->directRenderingEnabled) + DRILock(pScreen, 0); + MGASwapContext( pScreen ); } + + pMga->haveQuiescense = 1; } static void MGABlockHandler( int screenNum, pointer blockData, diff --git a/src/mga_driver.c b/src/mga_driver.c
pgp7e1IjyhzzM.pgp
Description: PGP signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
-- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel