[PATCH] xv: fix non-kms/non-dri Xv column ordering on big endian systems

Alex Deucher alexdeucher at gmail.com
Thu Aug 26 21:46:50 PDT 2010


On Mon, Aug 23, 2010 at 2:52 AM, Heikki Lindholm <holin at iki.fi> wrote:
> Column order is wrong on big endian systems, primarly because of a
> bits / bytes mix up with the bpp variable. Fix tested with r100 and
> r300, screen depth 16 and 32 with YV12 and YUY2 (overlay, textured video),
> RGBA and RGBT (overlay).
>
> Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=29041
>
> Signed-off-by: Heikki Lindholm <holin at iki.fi>
> ---
>  src/radeon_video.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/src/radeon_video.c b/src/radeon_video.c
> index dc75279..1a42951 100644
> --- a/src/radeon_video.c
> +++ b/src/radeon_video.c
> @@ -2216,11 +2216,15 @@ RADEONCopyData(
>                swap = RADEON_HOST_DATA_SWAP_32BIT;
>                break;
>            }
> -       } else if (bpp != pScrn->bitsPerPixel) {
> -           if (bpp == 8)
> +       } else {
> +           switch (pScrn->bitsPerPixel) {

don't we want to check the bpp rather then the scrn depth?

Wouldn't something like this work and be cleaner?

diff --git a/src/radeon_video.c b/src/radeon_video.c
index dc75279..df0faf8 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -2207,20 +2207,13 @@ RADEONCopyData(
        int swap = RADEON_HOST_DATA_SWAP_NONE;

 #if X_BYTE_ORDER == X_BIG_ENDIAN
-       if (info->kms_enabled) {
-           switch(bpp) {
-           case 2:
-               swap = RADEON_HOST_DATA_SWAP_16BIT;
-               break;
-           case 4:
-               swap = RADEON_HOST_DATA_SWAP_32BIT;
-               break;
-           }
-       } else if (bpp != pScrn->bitsPerPixel) {
-           if (bpp == 8)
-               swap = RADEON_HOST_DATA_SWAP_32BIT;
-           else
-               swap = RADEON_HOST_DATA_SWAP_HDW;
+       switch(bpp) {
+       case 2:
+         swap = RADEON_HOST_DATA_SWAP_16BIT;
+         break;
+       case 4:
+         swap = RADEON_HOST_DATA_SWAP_32BIT;
+         break;
        }
 #endif



> +           case 16:
> +               swap = RADEON_HOST_DATA_SWAP_16BIT;
> +               break;
> +           case 32:
>                swap = RADEON_HOST_DATA_SWAP_32BIT;
> -           else
> -               swap = RADEON_HOST_DATA_SWAP_HDW;
> +               break;
> +           }
>        }
>  #endif
>
> --
> 1.7.1
>
> _______________________________________________
> 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