From 920ac1f56fad6f48a30e65836ce054815f270738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 3 Jul 2006 01:21:18 +0200 Subject: Do even less cache flushing when the previous engine mode is known. OTOH, flush everything when the previous engine mode is unknown, and mark the engine mode as unknown in a couple more cases. --- src/radeon_dri.c | 4 ++++ src/radeon_exa.c | 31 ++++++++++++++++++++----------- src/radeon_exa_funcs.c | 2 ++ 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/radeon_dri.c b/src/radeon_dri.c index 62a310d0..b1dae426 100644 --- a/src/radeon_dri.c +++ b/src/radeon_dri.c @@ -431,6 +431,10 @@ static void RADEONLeaveServer(ScreenPtr pScreen) info->CPInUse = FALSE; } + +#ifdef USE_EXA + info->engineMode = EXA_ENGINEMODE_UNKNOWN; +#endif } /* Contexts can be swapped by the X server if necessary. This callback diff --git a/src/radeon_exa.c b/src/radeon_exa.c index 0e6ff913..ea2f9b25 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -293,25 +293,34 @@ static void RADEONFinishAccess(PixmapPtr pPix, int index) #define RADEON_SWITCH_TO_2D() \ do { \ - /*if (info->engineMode == EXA_ENGINEMODE_2D)*/ \ - /*break;*/ \ BEGIN_ACCEL(1); \ - OUT_ACCEL_REG(RADEON_WAIT_UNTIL, \ - RADEON_WAIT_HOST_IDLECLEAN | \ - RADEON_WAIT_3D_IDLECLEAN); \ + CARD32 wait_until = 0; \ + switch (info->engineMode) { \ + case EXA_ENGINEMODE_UNKNOWN: \ + wait_until |= RADEON_WAIT_HOST_IDLECLEAN | RADEON_WAIT_2D_IDLECLEAN; \ + case EXA_ENGINEMODE_3D: \ + wait_until |= RADEON_WAIT_3D_IDLECLEAN; \ + case EXA_ENGINEMODE_2D: \ + break; \ + } \ + OUT_ACCEL_REG(RADEON_WAIT_UNTIL, wait_until); \ FINISH_ACCEL(); \ info->engineMode = EXA_ENGINEMODE_2D; \ } while (0); #define RADEON_SWITCH_TO_3D() \ do { \ - /*if (info->engineMode == EXA_ENGINEMODE_3D)*/ \ - /*break;*/ \ BEGIN_ACCEL(1); \ - OUT_ACCEL_REG(RADEON_WAIT_UNTIL, \ - RADEON_WAIT_HOST_IDLECLEAN | \ - RADEON_WAIT_2D_IDLECLEAN | \ - RADEON_WAIT_3D_IDLECLEAN); \ + CARD32 wait_until = 0; \ + switch (info->engineMode) { \ + case EXA_ENGINEMODE_UNKNOWN: \ + wait_until |= RADEON_WAIT_HOST_IDLECLEAN | RADEON_WAIT_3D_IDLECLEAN; \ + case EXA_ENGINEMODE_2D: \ + wait_until |= RADEON_WAIT_2D_IDLECLEAN; \ + case EXA_ENGINEMODE_3D: \ + break; \ + } \ + OUT_ACCEL_REG(RADEON_WAIT_UNTIL, wait_until); \ FINISH_ACCEL(); \ info->engineMode = EXA_ENGINEMODE_3D; \ } while (0); diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c index a86e148c..c0bdf6e7 100644 --- a/src/radeon_exa_funcs.c +++ b/src/radeon_exa_funcs.c @@ -65,6 +65,8 @@ FUNC_NAME(RADEONSync)(ScreenPtr pScreen, int marker) TRACE; FUNC_NAME(RADEONWaitForIdle)(xf86Screens[pScreen->myNum]); + + RADEONPTR(xf86Screens[pScreen->myNum])->engineMode = EXA_ENGINEMODE_UNKNOWN; } static Bool -- cgit v1.2.3