summaryrefslogtreecommitdiff
path: root/src/radeon_textured_video.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-02-28 14:11:57 +1000
committerDave Airlie <airlied@redhat.com>2011-02-28 14:11:57 +1000
commit7928c120fb629a782846bcd5734d9fa14cbb099d (patch)
treec9075995b48d1608f027e3795f4afdd06eee5e3c /src/radeon_textured_video.c
parente55520c0e582f2a500b3b01c2cb78750e15256ca (diff)
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@redhat.com>
Diffstat (limited to 'src/radeon_textured_video.c')
-rw-r--r--src/radeon_textured_video.c10
1 files 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;