src/r128.h | 1 + src/r128_accel.c | 37 +++++++++++++++++++++++++++++++++++++ src/r128_driver.c | 1 - src/r128_exa_render.c | 11 +++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-)
New commits: commit aca6aa127f43deeed42c4d3bef8d1e6a735b4c50 Author: Connor Behan <[email protected]> Date: Fri Mar 8 01:02:22 2013 -0800 Swap pixmap bytes for a solid picture on big endian host Some PowerPC users were reporting color errors that only happened with EXA+DRI. This implements a recent bugfix in the Radeon driver which will solve at least one of these problems. Signed-off-by: Connor Behan <[email protected]> diff --git a/src/r128.h b/src/r128.h index 9c0ecb6..90071b4 100644 --- a/src/r128.h +++ b/src/r128.h @@ -602,6 +602,7 @@ extern void R128CCEFlushIndirect(ScrnInfoPtr pScrn, int discard); extern void R128CCEReleaseIndirect(ScrnInfoPtr pScrn); extern void R128CCEWaitForIdle(ScrnInfoPtr pScrn); extern int R128CCEStop(ScrnInfoPtr pScrn); +extern void R128CopySwap(uint8_t *dst, uint8_t *src, unsigned int size, int swap); #ifdef USE_EXA extern Bool R128EXAInit(ScreenPtr pScreen); diff --git a/src/r128_accel.c b/src/r128_accel.c index 1b8c023..7ffd15f 100644 --- a/src/r128_accel.c +++ b/src/r128_accel.c @@ -1869,6 +1869,43 @@ static void R128MMIOAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a) } #endif +void R128CopySwap(uint8_t *dst, uint8_t *src, unsigned int size, int swap) +{ + switch(swap) { + case APER_0_BIG_ENDIAN_32BPP_SWAP: + { + unsigned int *d = (unsigned int *)dst; + unsigned int *s = (unsigned int *)src; + unsigned int nwords = size >> 2; + + for (; nwords > 0; --nwords, ++d, ++s) +#ifdef __powerpc__ + asm volatile("stwbrx %0,0,%1" : : "r" (*s), "r" (d)); +#else + *d = ((*s >> 24) & 0xff) | ((*s >> 8) & 0xff00) + | ((*s & 0xff00) << 8) | ((*s & 0xff) << 24); +#endif + return; + } + case APER_0_BIG_ENDIAN_16BPP_SWAP: + { + unsigned short *d = (unsigned short *)dst; + unsigned short *s = (unsigned short *)src; + unsigned int nwords = size >> 1; + + for (; nwords > 0; --nwords, ++d, ++s) +#ifdef __powerpc__ + asm volatile("sthbrx %0,0,%1" : : "r" (*s), "r" (d)); +#else + *d = (*s >> 8) | (*s << 8); +#endif + return; + } + } + if (src != dst) + memcpy(dst, src, size); +} + /* Initialize XAA for supported acceleration and also initialize the graphics hardware for acceleration. */ Bool R128AccelInit(ScreenPtr pScreen) diff --git a/src/r128_exa_render.c b/src/r128_exa_render.c index db14bb1..f31bdf3 100644 --- a/src/r128_exa_render.c +++ b/src/r128_exa_render.c @@ -102,6 +102,17 @@ R128SolidPixmap(ScreenPtr pScreen, uint32_t solid) return NULL; } info->ExaDriver->WaitMarker(pScreen, 0); + +#if X_BYTE_ORDER == X_BIG_ENDIAN + if (pScrn->bitsPerPixel == 32) + R128CopySwap(info->ExaDriver->memoryBase + exaGetPixmapOffset(pPix), (uint8_t*)&solid, 4, + APER_0_BIG_ENDIAN_32BPP_SWAP); + else if (pScrn->bitsPerPixel == 16) + R128CopySwap(info->ExaDriver->memoryBase + exaGetPixmapOffset(pPix), (uint8_t*)&solid, 4, + APER_0_BIG_ENDIAN_16BPP_SWAP); + else + /* Fall through for 8 bpp */ +#endif memcpy(info->ExaDriver->memoryBase + exaGetPixmapOffset(pPix), &solid, 4); return pPix; commit 24f28a78fdcd056357f137650ca7f0f01c257d97 Author: Connor Behan <[email protected]> Date: Wed Dec 19 10:41:14 2012 -0800 Remove call to obsolete miInitializeBackingStore() Definition was deleted from Xorg during 1.14 merge window, but has been a no-op since 1.10 merge window. Signed-off-by: Connor Behan <[email protected]> diff --git a/src/r128_driver.c b/src/r128_driver.c index a062a60..f47c7e3 100644 --- a/src/r128_driver.c +++ b/src/r128_driver.c @@ -2701,7 +2701,6 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL) R128DGAInit(pScreen); /* Backing store setup */ - miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); /* Set Silken Mouse */ -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected] Archive: http://lists.debian.org/[email protected]

