diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2006-07-03 01:21:18 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2006-07-03 01:21:18 +0200 |
commit | 920ac1f56fad6f48a30e65836ce054815f270738 (patch) | |
tree | b4c1643064617ac8c7260c38f5241c8f396d5e69 | |
parent | dd0dd4bab76907b4b1b6d814f24e73e57d71f587 (diff) |
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.
-rw-r--r-- | src/radeon_dri.c | 4 | ||||
-rw-r--r-- | src/radeon_exa.c | 31 | ||||
-rw-r--r-- | 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 |