From 59c307cfeda54741fa0838930306bb64c479e92b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 7 Mar 2013 09:59:29 +0100 Subject: [PATCH] UMS: Swap bytes when uploading to pixmap for solid picture on big endian host MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michel Dänzer --- src/radeon_exa_shared.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/radeon_exa_shared.c b/src/radeon_exa_shared.c index 7af8a52..b45a3b3 100644 --- a/src/radeon_exa_shared.c +++ b/src/radeon_exa_shared.c @@ -40,6 +40,7 @@ #endif #include "radeon_macros.h" #include "radeon_probe.h" +#include "radeon_reg.h" #include "radeon_version.h" #include "radeon_vbo.h" @@ -159,6 +160,17 @@ PixmapPtr RADEONSolidPixmap(ScreenPtr pScreen, uint32_t solid) /* XXX: Big hammer... */ info->accel_state->exa->WaitMarker(pScreen, info->accel_state->exaSyncMarker); + +#if X_BYTE_ORDER == X_BIG_ENDIAN + if (pScrn->bitsPerPixel == 32) + RADEONCopySwap(info->FB + exaGetPixmapOffset(pPix), (uint8_t*)&solid, 4, + RADEON_HOST_DATA_SWAP_32BIT); + else if (pScrn->bitsPerPixel == 16) + RADEONCopySwap(info->FB + exaGetPixmapOffset(pPix), (uint8_t*)&solid, 4, + RADEON_HOST_DATA_SWAP_16BIT); + else + /* Fall through for 8 bpp */ +#endif memcpy(info->FB + exaGetPixmapOffset(pPix), &solid, 4); return pPix; -- 1.8.2.rc1