fedora-cvs-commits@redhat.com
[Top] [All Lists]

rpms/xorg-x11-drv-mga/devel dri-locking.patch,NONE,1.1

Subject: rpms/xorg-x11-drv-mga/devel dri-locking.patch,NONE,1.1
From:
Date: Mon, 21 Aug 2006 18:46:17 -0400
Author: krh

Update of /cvs/dist/rpms/xorg-x11-drv-mga/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv1298

Added Files:
        dri-locking.patch 
Log Message:
* Fri Aug 18 2006 Kristian Høgsberg <krh@xxxxxxxxxx> 1.4.1-5.fc6
- Add Tilman Sauerbecks patch to fix DRI locking.


dri-locking.patch:
 mga_dri.c |   59 +++++------------------------------------------------------
 1 files changed, 5 insertions(+), 54 deletions(-)

--- NEW FILE dri-locking.patch ---
From: Tilman Sauerbeck <tilman@xxxxxxxxxxxxxx>
Date: Wed, 9 Aug 2006 19:59:42 +0000 (+0200)
Subject: Bug #7265: Fix MGA DRI locking.
X-Git-Url: 
http://gitweb.freedesktop.org/?p=xorg/driver/xf86-video-mga.git;a=commitdiff;h=bde592047cd62194d7ef67520a9fdbaf269a8b90

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.
---

--- 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;
@@ -442,7 +439,11 @@ static void MGASwapContextShared( Screen
    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, DR
                   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 pScre
                          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;
 

-- 
fedora-cvs-commits mailing list
fedora-cvs-commits@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-cvs-commits

<Prev in Thread] Current Thread [Next in Thread>
  • rpms/xorg-x11-drv-mga/devel dri-locking.patch,NONE,1.1, fedora-cvs-commits <=