xf86-video-ati: Branch 'master'

Dave Airlie airlied at kemper.freedesktop.org
Sun Feb 27 20:08:04 PST 2011


 src/radeon_textured_video.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 7928c120fb629a782846bcd5734d9fa14cbb099d
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Feb 28 14:11:57 2011 +1000

    xv: fix height alignments for U/V planes
    
    The kernel CS checks showed we were incorrectly aligning the
    U/V allocations for when we used them as texture sources.
    
    This should fix
    https://bugs.freedesktop.org/show_bug.cgi?id=34567
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c
index 65a4871..c886ed0 100644
--- a/src/radeon_textured_video.c
+++ b/src/radeon_textured_video.c
@@ -248,7 +248,7 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn,
     BoxRec dstBox;
     int dst_width = width, dst_height = height;
     int aligned_height;
-
+    int h_align = drmmode_get_height_align(pScrn, 0);
     /* make the compiler happy */
     s2offset = s3offset = srcPitch2 = 0;
 
@@ -299,7 +299,7 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn,
 	    pPriv->hw_align = 64;
     }
 
-    aligned_height = RADEON_ALIGN(dst_height, drmmode_get_height_align(pScrn, 0));
+    aligned_height = RADEON_ALIGN(dst_height, h_align);
 
     switch(id) {
     case FOURCC_YV12:
@@ -323,7 +323,7 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn,
 	break;
     }
 
-    size = dstPitch * aligned_height + 2 * dstPitch2 * ((aligned_height + 1) >> 1);
+    size = dstPitch * aligned_height + 2 * dstPitch2 * RADEON_ALIGN(((aligned_height + 1) >> 1), h_align);
     size = RADEON_ALIGN(size, pPriv->hw_align);
 
     if (size != pPriv->size) {
@@ -401,9 +401,9 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn,
     }
     pPriv->src_pitch = dstPitch;
 
-    pPriv->planeu_offset = dstPitch * dst_height;
+    pPriv->planeu_offset = dstPitch * aligned_height;
     pPriv->planeu_offset = RADEON_ALIGN(pPriv->planeu_offset, pPriv->hw_align);
-    pPriv->planev_offset = pPriv->planeu_offset + dstPitch2 * ((dst_height + 1) >> 1);
+    pPriv->planev_offset = pPriv->planeu_offset + dstPitch2 * RADEON_ALIGN(((aligned_height + 1) >> 1), h_align);
     pPriv->planev_offset = RADEON_ALIGN(pPriv->planev_offset, pPriv->hw_align);
 
     pPriv->size = size;


More information about the xorg-commit mailing list