summaryrefslogtreecommitdiff
path: root/src/radeon_exa.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2006-07-03 01:21:18 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2006-07-03 01:21:18 +0200
commit920ac1f56fad6f48a30e65836ce054815f270738 (patch)
treeb4c1643064617ac8c7260c38f5241c8f396d5e69 /src/radeon_exa.c
parentdd0dd4bab76907b4b1b6d814f24e73e57d71f587 (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.
Diffstat (limited to 'src/radeon_exa.c')
-rw-r--r--src/radeon_exa.c31
1 files changed, 20 insertions, 11 deletions
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);