summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-04-16 15:46:24 -0400
committerAlex Deucher <alexdeucher@gmail.com>2010-04-16 19:36:09 -0400
commitf7ebe4a127965bb9e46d20c60331bcc4dab76fc5 (patch)
tree538a65c6da4f719c5f57b80405a3ccfa70e66e97
parent10799b4ce0c18c5a7d92d688549e8e777344f111 (diff)
r3xx textured video: split into prepare and draw functions
-rw-r--r--src/radeon_textured_videofuncs.c44
1 files changed, 29 insertions, 15 deletions
diff --git a/src/radeon_textured_videofuncs.c b/src/radeon_textured_videofuncs.c
index ff4c055f..36363f7f 100644
--- a/src/radeon_textured_videofuncs.c
+++ b/src/radeon_textured_videofuncs.c
@@ -1052,8 +1052,8 @@ FUNC_NAME(R200DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
DamageDamageRegion(pPriv->pDraw, &pPriv->clip);
}
-static void
-FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
+static Bool
+FUNC_NAME(R300PrepareTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
PixmapPtr pPixmap = pPriv->pPixmap;
@@ -1063,9 +1063,7 @@ FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
uint32_t dst_pitch, dst_format;
uint32_t txenable, colorpitch, bicubic_offset;
uint32_t output_fmt;
- int dstxoff, dstyoff, pixel_shift;
- BoxPtr pBox = REGION_RECTS(&pPriv->clip);
- int nBox = REGION_NUM_RECTS(&pPriv->clip);
+ int pixel_shift;
ACCEL_PREAMBLE();
#ifdef XF86DRM_MODE
@@ -1084,7 +1082,7 @@ FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
ret = radeon_cs_space_check(info->cs);
if (ret) {
ErrorF("Not enough RAM to hw accel xv operation\n");
- return;
+ return FALSE;
}
}
#endif
@@ -1100,14 +1098,6 @@ FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
dst_pitch = pPixmap->devKind;
}
-#ifdef COMPOSITE
- dstxoff = -pPixmap->screen_x + pPixmap->drawable.x;
- dstyoff = -pPixmap->screen_y + pPixmap->drawable.y;
-#else
- dstxoff = 0;
- dstyoff = 0;
-#endif
-
#ifdef USE_EXA
if (info->useEXA) {
RADEON_SWITCH_TO_3D();
@@ -1144,7 +1134,7 @@ FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
dst_format = R300_COLORFORMAT_ARGB8888;
break;
default:
- return;
+ return FALSE;
}
output_fmt = (R300_OUT_FMT_C4_8 |
@@ -2321,6 +2311,30 @@ FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
OUT_ACCEL_REG(R300_VAP_VTX_SIZE, pPriv->vtx_count);
FINISH_ACCEL();
+ return TRUE;
+}
+
+static void
+FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
+{
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ PixmapPtr pPixmap = pPriv->pPixmap;
+ int dstxoff, dstyoff;
+ BoxPtr pBox = REGION_RECTS(&pPriv->clip);
+ int nBox = REGION_NUM_RECTS(&pPriv->clip);
+ ACCEL_PREAMBLE();
+
+#ifdef COMPOSITE
+ dstxoff = -pPixmap->screen_x + pPixmap->drawable.x;
+ dstyoff = -pPixmap->screen_y + pPixmap->drawable.y;
+#else
+ dstxoff = 0;
+ dstyoff = 0;
+#endif
+
+ if (!FUNC_NAME(R300PrepareTexturedVideo)(pScrn, pPriv))
+ return;
+
if (pPriv->vsync) {
xf86CrtcPtr crtc;
if (pPriv->desired_crtc)