From 7928c120fb629a782846bcd5734d9fa14cbb099d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 28 Feb 2011 14:11:57 +1000 Subject: 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 --- src/radeon_textured_video.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c index 65a48718..c886ed05 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; -- cgit v1.2.3