Hi,

i think I have identified a problem with 6.12.2 on a RS690 Chipset:
When doing XvPutImage (via textured video) with a src offset !=0
(src_x or src_y), the driver does the wrong thing compared to all other
cards and drivers I have seen:

The picture is then shifted to down and right, with invalid framebuffer
data filling the left and upper part of the screen.

For my card, I can fix this behaviour with the following patch. This
isn't a proper patch yet, but should illustrate what needs to be
changed: The offset need not be applied to the dst address, just the
source.
Don't know if this breaks other cards - it probably does.

Johannes Deisenhofer




diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c
index 79671c0..d71c278 100644
--- a/src/radeon_textured_video.c
+++ b/src/radeon_textured_video.c
@@ -452,10 +452,10 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn,
     npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left;
 
     pPriv->src_offset = pPriv->video_offset + info->fbLocation + pScrn->fbOffset;
-    if (info->ChipFamily >= CHIP_FAMILY_R600)
-	pPriv->src_addr = (uint8_t *)(info->FB + pPriv->video_offset);
-    else
-	pPriv->src_addr = (uint8_t *)(info->FB + pPriv->video_offset + (top * dstPitch));
+    //if (info->ChipFamily >= CHIP_FAMILY_R600)
+    pPriv->src_addr = (uint8_t *)(info->FB + pPriv->video_offset);
+    //else
+    // pPriv->src_addr = (uint8_t *)(info->FB + pPriv->video_offset + (top * dstPitch)); 
     pPriv->src_pitch = dstPitch;
     pPriv->planeu_offset = dstPitch * dst_height;
     pPriv->planev_offset = pPriv->planeu_offset + dstPitch2 * ((dst_height + 1) >> 1);
@@ -510,19 +510,21 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn,
 	    s3offset += (top >> 1) * srcPitch2 + (left >> 1);
 	    d2line = pPriv->planeu_offset;
 	    d3line = pPriv->planev_offset;
+/*
 	    d2line += (top >> 1) * dstPitch2 - (top * dstPitch);
 	    d3line += (top >> 1) * dstPitch2 - (top * dstPitch);
+*/
 	    nlines = ((y2 + 0xffff) >> 16) - top;
 	    if(id == FOURCC_YV12) {
 		tmp = s2offset;
 		s2offset = s3offset;
 		s3offset = tmp;
 	    }
-	    RADEONCopyData(pScrn, buf + (top * srcPitch) + left, pPriv->src_addr + left,
+	    RADEONCopyData(pScrn, buf + (top * srcPitch) + left, pPriv->src_addr,
 		srcPitch, dstPitch, nlines, npixels, 1);
-	    RADEONCopyData(pScrn, buf + s2offset,  pPriv->src_addr + d2line + (left >> 1),
+	    RADEONCopyData(pScrn, buf + s2offset,  pPriv->src_addr + d2line,
 		srcPitch2, dstPitch2, (nlines + 1) >> 1, npixels >> 1, 1);
-	    RADEONCopyData(pScrn, buf + s3offset, pPriv->src_addr + d3line + (left >> 1),
+	    RADEONCopyData(pScrn, buf + s3offset, pPriv->src_addr + d3line ,
 		srcPitch2, dstPitch2, (nlines + 1) >> 1, npixels >> 1, 1);
 	} else {
 	    top &= ~1;

_______________________________________________
xorg-driver-ati mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-driver-ati

Reply via email to