[PATCH] textured-video: upload bicubic texture later

Felipe Contreras felipe.contreras at gmail.com
Mon Dec 7 17:32:34 PST 2009


Signed-off-by: Felipe Contreras <felipe.contreras at gmail.com>
---
 src/radeon_textured_video.c |   64 ++++++++++++++++++++++++++++---------------
 1 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c
index 2e5d763..bbabaab 100644
--- a/src/radeon_textured_video.c
+++ b/src/radeon_textured_video.c
@@ -218,6 +218,37 @@ R600CopyData(
     }
 }
 
+static Bool upload_bicubic_texture(ScrnInfoPtr pScrn)
+{
+    RADEONInfoPtr info = RADEONPTR(pScrn);
+    uint8_t *bicubic_addr;
+    int ret;
+    if (info->cs) {
+        ret = radeon_bo_map(info->bicubic_bo, 1);
+        if (ret)
+            return FALSE;
+
+        bicubic_addr = info->bicubic_bo->ptr;
+    } else {
+        bicubic_addr = (uint8_t *)(info->FB + info->bicubic_offset);
+    }
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+               "fc: ba=%p\n", bicubic_addr);
+
+    RADEONCopySwap(bicubic_addr, (uint8_t *)bicubic_tex_512, 1024,
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+                   RADEON_HOST_DATA_SWAP_16BIT
+#else
+                   RADEON_HOST_DATA_SWAP_NONE
+#endif
+);
+
+    if (info->cs)
+        radeon_bo_unmap(info->bicubic_bo);
+
+    return TRUE;
+}
+
 static int
 RADEONPutImageTextured(ScrnInfoPtr pScrn,
 		       short src_x, short src_y,
@@ -259,6 +290,15 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn,
     dstBox.y1 = drw_y;
     dstBox.y2 = drw_y + drw_h;
 
+    {
+        static int init = 0;
+        if (init == 0) {
+            /* XXX: this works */
+            upload_bicubic_texture(pScrn);
+            init++;
+        }
+    }
+
     if (!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height))
 	return Success;
 
@@ -721,29 +761,9 @@ Bool radeon_load_bicubic_texture(ScrnInfoPtr pScrn)
     if (info->cs)
 	info->bicubic_bo = info->bicubic_memory;
 
-    /* Upload bicubic filter tex */
-    if (info->ChipFamily < CHIP_FAMILY_R600) {
-	uint8_t *bicubic_addr;
-	int ret;
-	if (info->cs) {
-	    ret = radeon_bo_map(info->bicubic_bo, 1);
-	    if (ret)
-		return FALSE;
-
-	    bicubic_addr = info->bicubic_bo->ptr;
-	} else
-	    bicubic_addr = (uint8_t *)(info->FB + info->bicubic_offset);
+    /* XXX: this is a no-op */
+    upload_bicubic_texture(pScrn);
 
-	RADEONCopySwap(bicubic_addr, (uint8_t *)bicubic_tex_512, 1024,
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-		       RADEON_HOST_DATA_SWAP_16BIT
-#else
-		       RADEON_HOST_DATA_SWAP_NONE
-#endif
-);
-	if (info->cs)
-	    radeon_bo_unmap(info->bicubic_bo);
-    }
     return TRUE;
 }
 
-- 
1.6.6.rc1.39.g9a42


--LZvS9be/3tNcYl/X--


More information about the xorg-driver-ati mailing list