summaryrefslogtreecommitdiff
path: root/src/radeon_textured_videofuncs.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-04-16 15:52:59 -0400
committerAlex Deucher <alexdeucher@gmail.com>2010-04-16 19:36:14 -0400
commit31a888e78fa403f2bddacee098a29f36eaa969cb (patch)
treee857facd6a6ae52af1e645c45edd3f49c62016d8 /src/radeon_textured_videofuncs.c
parentf7ebe4a127965bb9e46d20c60331bcc4dab76fc5 (diff)
r5xx textured video: split into prepare and draw functions
Diffstat (limited to 'src/radeon_textured_videofuncs.c')
-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 36363f7f..0bf7a108 100644
--- a/src/radeon_textured_videofuncs.c
+++ b/src/radeon_textured_videofuncs.c
@@ -2525,8 +2525,8 @@ FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
DamageDamageRegion(pPriv->pDraw, &pPriv->clip);
}
-static void
-FUNC_NAME(R500DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
+static Bool
+FUNC_NAME(R500PrepareTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
PixmapPtr pPixmap = pPriv->pPixmap;
@@ -2536,9 +2536,7 @@ FUNC_NAME(R500DisplayTexturedVideo)(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
@@ -2557,7 +2555,7 @@ FUNC_NAME(R500DisplayTexturedVideo)(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
@@ -2573,14 +2571,6 @@ FUNC_NAME(R500DisplayTexturedVideo)(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();
@@ -2617,7 +2607,7 @@ FUNC_NAME(R500DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
dst_format = R300_COLORFORMAT_ARGB8888;
break;
default:
- return;
+ return FALSE;
}
output_fmt = (R300_OUT_FMT_C4_8 |
@@ -3920,6 +3910,30 @@ FUNC_NAME(R500DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
OUT_ACCEL_REG(R300_VAP_VTX_SIZE, pPriv->vtx_count);
FINISH_ACCEL();
+ return TRUE;
+}
+
+static void
+FUNC_NAME(R500DisplayTexturedVideo)(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(R500PrepareTexturedVideo)(pScrn, pPriv))
+ return;
+
if (pPriv->vsync) {
xf86CrtcPtr crtc;
if (pPriv->desired_crtc)