summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/radeon_dri.c4
-rw-r--r--src/radeon_exa.c31
-rw-r--r--src/radeon_exa_funcs.c2
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