summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2008-12-02 22:26:21 -0500
committerAlex Deucher <alexdeucher@gmail.com>2008-12-02 22:26:21 -0500
commitca74ebf8813b7fab8d08465ef9600f001c948e94 (patch)
treef3eb4ee04a1ac0f48621dcd4d8c40905da8500e5
parentfc079c5267baf431bbecee7744e484783d393152 (diff)
move 3d state init after RADEON_SWITCH_TO_3D()
-rw-r--r--src/radeon.h35
-rw-r--r--src/radeon_exa.c35
-rw-r--r--src/radeon_exa_render.c18
-rw-r--r--src/radeon_textured_videofuncs.c34
4 files changed, 64 insertions, 58 deletions
diff --git a/src/radeon.h b/src/radeon.h
index 605b0578..227ffc6d 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -1292,6 +1292,41 @@ do { \
#endif /* XF86DRI */
+#if defined(XF86DRI) && defined(USE_EXA)
+#define RADEON_SWITCH_TO_2D() \
+do { \
+ uint32_t flush = 0; \
+ switch (info->accel_state->engineMode) { \
+ case EXA_ENGINEMODE_UNKNOWN: \
+ case EXA_ENGINEMODE_3D: \
+ flush = 1; \
+ case EXA_ENGINEMODE_2D: \
+ break; \
+ } \
+ if (flush) \
+ RADEONCPFlushIndirect(pScrn, 1); \
+ info->accel_state->engineMode = EXA_ENGINEMODE_2D; \
+} while (0);
+
+#define RADEON_SWITCH_TO_3D() \
+do { \
+ uint32_t flush = 0; \
+ switch (info->accel_state->engineMode) { \
+ case EXA_ENGINEMODE_UNKNOWN: \
+ case EXA_ENGINEMODE_2D: \
+ flush = 1; \
+ case EXA_ENGINEMODE_3D: \
+ break; \
+ } \
+ if (flush) \
+ RADEONCPFlushIndirect(pScrn, 1); \
+ info->accel_state->engineMode = EXA_ENGINEMODE_3D; \
+} while (0);
+#else
+#define RADEON_SWITCH_TO_2D()
+#define RADEON_SWITCH_TO_3D()
+#endif
+
static __inline__ void RADEON_MARK_SYNC(RADEONInfoPtr info, ScrnInfoPtr pScrn)
{
#ifdef USE_EXA
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index 6d31a139..04c097b2 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -295,41 +295,6 @@ static void RADEONFinishAccess(PixmapPtr pPix, int index)
#endif /* X_BYTE_ORDER == X_BIG_ENDIAN */
-#ifdef XF86DRI
-#define RADEON_SWITCH_TO_2D() \
-do { \
- uint32_t flush = 0; \
- switch (info->accel_state->engineMode) { \
- case EXA_ENGINEMODE_UNKNOWN: \
- case EXA_ENGINEMODE_3D: \
- flush = 1; \
- case EXA_ENGINEMODE_2D: \
- break; \
- } \
- if (flush) \
- RADEONCPFlushIndirect(pScrn, 1); \
- info->accel_state->engineMode = EXA_ENGINEMODE_2D; \
-} while (0);
-
-#define RADEON_SWITCH_TO_3D() \
-do { \
- uint32_t flush = 0; \
- switch (info->accel_state->engineMode) { \
- case EXA_ENGINEMODE_UNKNOWN: \
- case EXA_ENGINEMODE_2D: \
- flush = 1; \
- case EXA_ENGINEMODE_3D: \
- break; \
- } \
- if (flush) \
- RADEONCPFlushIndirect(pScrn, 1); \
- info->accel_state->engineMode = EXA_ENGINEMODE_3D; \
-} while (0);
-#else
-#define RADEON_SWITCH_TO_2D()
-#define RADEON_SWITCH_TO_3D()
-#endif
-
#define ENTER_DRAW(x) TRACE
#define LEAVE_DRAW(x) TRACE
/***********************************************************************/
diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index 68a7a768..c75c6a52 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -527,9 +527,6 @@ static Bool FUNC_NAME(R100PrepareComposite)(int op,
TRACE;
- if (!info->accel_state->XInited3D)
- RADEONInit3DEngine(pScrn);
-
if (!RADEONGetDestFormat(pDstPicture, &dst_format))
return FALSE;
@@ -561,6 +558,9 @@ static Bool FUNC_NAME(R100PrepareComposite)(int op,
RADEON_SWITCH_TO_3D();
+ if (!info->accel_state->XInited3D)
+ RADEONInit3DEngine(pScrn);
+
if (!FUNC_NAME(R100TextureSetup)(pSrcPicture, pSrc, 0))
return FALSE;
pp_cntl = RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE;
@@ -830,9 +830,6 @@ static Bool FUNC_NAME(R200PrepareComposite)(int op, PicturePtr pSrcPicture,
TRACE;
- if (!info->accel_state->XInited3D)
- RADEONInit3DEngine(pScrn);
-
if (!RADEONGetDestFormat(pDstPicture, &dst_format))
return FALSE;
@@ -862,6 +859,9 @@ static Bool FUNC_NAME(R200PrepareComposite)(int op, PicturePtr pSrcPicture,
RADEON_SWITCH_TO_3D();
+ if (!info->accel_state->XInited3D)
+ RADEONInit3DEngine(pScrn);
+
if (!FUNC_NAME(R200TextureSetup)(pSrcPicture, pSrc, 0))
return FALSE;
pp_cntl = RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE;
@@ -1194,9 +1194,6 @@ static Bool FUNC_NAME(R300PrepareComposite)(int op, PicturePtr pSrcPicture,
TRACE;
- if (!info->accel_state->XInited3D)
- RADEONInit3DEngine(pScrn);
-
if (!R300GetDestFormat(pDstPicture, &dst_format))
return FALSE;
@@ -1226,6 +1223,9 @@ static Bool FUNC_NAME(R300PrepareComposite)(int op, PicturePtr pSrcPicture,
RADEON_SWITCH_TO_3D();
+ if (!info->accel_state->XInited3D)
+ RADEONInit3DEngine(pScrn);
+
if (!FUNC_NAME(R300TextureSetup)(pSrcPicture, pSrc, 0))
return FALSE;
txenable = R300_TEX_0_ENABLE;
diff --git a/src/radeon_textured_videofuncs.c b/src/radeon_textured_videofuncs.c
index 8a4a31d7..7a4ffc2e 100644
--- a/src/radeon_textured_videofuncs.c
+++ b/src/radeon_textured_videofuncs.c
@@ -124,23 +124,29 @@ FUNC_NAME(RADEONDisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv
dstyoff = 0;
#endif
+#ifdef USE_EXA
+ if (info->useEXA) {
+ RADEON_SWITCH_TO_3D();
+ } else
+#endif
+ {
+ BEGIN_ACCEL(2);
+ if (IS_R300_3D || IS_R500_3D)
+ OUT_ACCEL_REG(R300_RB3D_DSTCACHE_CTLSTAT, R300_DC_FLUSH_3D);
+ else
+ OUT_ACCEL_REG(RADEON_RB3D_DSTCACHE_CTLSTAT, RADEON_RB3D_DC_FLUSH);
+ /* We must wait for 3d to idle, in case source was just written as a dest. */
+ OUT_ACCEL_REG(RADEON_WAIT_UNTIL,
+ RADEON_WAIT_HOST_IDLECLEAN |
+ RADEON_WAIT_2D_IDLECLEAN |
+ RADEON_WAIT_3D_IDLECLEAN |
+ RADEON_WAIT_DMA_GUI_IDLE);
+ FINISH_ACCEL();
+ }
+
if (!info->accel_state->XInited3D)
RADEONInit3DEngine(pScrn);
- /* we can probably improve this */
- BEGIN_ACCEL(2);
- if (IS_R300_3D || IS_R500_3D)
- OUT_ACCEL_REG(R300_RB3D_DSTCACHE_CTLSTAT, R300_DC_FLUSH_3D);
- else
- OUT_ACCEL_REG(RADEON_RB3D_DSTCACHE_CTLSTAT, RADEON_RB3D_DC_FLUSH);
- /* We must wait for 3d to idle, in case source was just written as a dest. */
- OUT_ACCEL_REG(RADEON_WAIT_UNTIL,
- RADEON_WAIT_HOST_IDLECLEAN |
- RADEON_WAIT_2D_IDLECLEAN |
- RADEON_WAIT_3D_IDLECLEAN |
- RADEON_WAIT_DMA_GUI_IDLE);
- FINISH_ACCEL();
-
if (pPriv->bicubic_enabled)
vtx_count = 6;
else