[PATCH] video: Don't round up bottom/right edge for clipping source width/height.
Alex Deucher
alexdeucher at gmail.com
Thu Aug 11 07:51:39 PDT 2011
2011/8/11 Michel Dänzer <michel at daenzer.net>:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> It's not necessary: If the top/left edge was rounded down, this will be
> compensated by the subtraction.
>
> Worse, if the original source width/height is odd, rounding up may result in
> reading past the end of the source data.
>
> Fixes http://bugs.debian.org/637258 .
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>
> Am I missing a reason why this would be necessary?
I have some vague recollection of the overlay needing some kind of
special alignment, but I could be wrong. The code just above the
last hunk doesn't add the extra alignment and it apparently works.
Although perhaps that was a workaround for this same bugs. Looks ok
to me though.
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Alex
>
> src/radeon_textured_video.c | 2 +-
> src/radeon_video.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c
> index d247db6..e49575d 100644
> --- a/src/radeon_textured_video.c
> +++ b/src/radeon_textured_video.c
> @@ -383,7 +383,7 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn,
>
> /* copy data */
> top = (y1 >> 16) & ~1;
> - nlines = RADEON_ALIGN((y2 + 0xffff) >> 16, 2) - top;
> + nlines = ((y2 + 0xffff) >> 16) - top;
>
> pPriv->src_offset = pPriv->video_offset;
> if (info->cs) {
> diff --git a/src/radeon_video.c b/src/radeon_video.c
> index 66ff2ad..834f924 100644
> --- a/src/radeon_video.c
> +++ b/src/radeon_video.c
> @@ -2996,7 +2996,7 @@ RADEONPutImage(
> /* copy data */
> top = ya >> 16;
> left = (xa >> 16) & ~1;
> - npixels = (RADEON_ALIGN((xb + 0xffff) >> 16, 2)) - left;
> + npixels = ((xb + 0xffff) >> 16) - left;
>
> offset = (pPriv->video_offset) + (top * dstPitch);
>
> @@ -3055,7 +3055,7 @@ RADEONPutImage(
> s2offset = s3offset;
> s3offset = tmp;
> }
> - nlines = (RADEON_ALIGN((yb + 0xffff) >> 16, 2)) - top;
> + nlines = ((yb + 0xffff) >> 16) - top;
> RADEONCopyMungedData(pScrn, buf + (top * srcPitch) + left,
> buf + s2offset, buf + s3offset, dst_start,
> srcPitch, srcPitch2, dstPitch, nlines, npixels);
> --
> 1.7.5.4
>
>
> _______________________________________________
> xorg-driver-ati mailing list
> xorg-driver-ati at lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
>
More information about the xorg-driver-ati
mailing list