[PATCH r128] Remove overuse of COMPOSITE_SETUP()

Connor Behan connor.behan at gmail.com
Tue Mar 4 01:50:54 PST 2014


COMPOSITE_SETUP() involves expensive register writes so
R128EnterServer() should call it once when there are 3D windows and 0
times when there are no 3D windows.

Instead the code was calling it once when there were no 3D windows and
arbitrarily many times when there were 3D windows.

Signed-off-by: Connor Behan <connor.behan at gmail.com>
---
 src/r128_dri.c        | 6 +++++-
 src/r128_exa_render.c | 7 +------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/r128_dri.c b/src/r128_dri.c
index ff7bbc2..2c905a4 100644
--- a/src/r128_dri.c
+++ b/src/r128_dri.c
@@ -308,7 +308,11 @@ static void R128EnterServer(ScreenPtr pScreen)
 #endif
 #ifdef USE_EXA
     if (info->ExaDriver) exaMarkSync(pScreen);
-    info->state_2d.composite_setup = FALSE;
+    /* EXA and DRI are fighting over control of the texture hardware.
+     * That means we need to setup compositing when the server wakes
+     * up if a 3D app is running.
+     */
+    if (info->have3DWindows) info->state_2d.composite_setup = FALSE;
 #endif
 }
 
diff --git a/src/r128_exa_render.c b/src/r128_exa_render.c
index cb9f929..f00daf7 100644
--- a/src/r128_exa_render.c
+++ b/src/r128_exa_render.c
@@ -458,12 +458,7 @@ R128CCEPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
 
     if (!info->state_2d.composite_setup) {
         COMPOSITE_SETUP();
-	/* DRI and EXA are fighting over control of the texture hardware.
-	 * That means we need to set up the compositing hardware every time
-	 * while a 3D app is running and once after it closes.
-	 */
-	if (!info->have3DWindows)
-	    info->state_2d.composite_setup = TRUE;
+        info->state_2d.composite_setup = TRUE;
     }
 
     /* We cannot guarantee that this register will stay zero - DRI needs it too. */
-- 
1.8.5.3



More information about the xorg-driver-ati mailing list