[PATCH] i128: Make use of hardware byteswap on big-endian platforms.

Mark Kettenis mark.kettenis at xs4all.nl
Sun Nov 1 03:41:07 PST 2009


Fixes 16 and 32 bit-per-pixel modes with a Tech Source Raptor GFX-8M board
on OpenBSD/sparc64 (although a few more diffs are needed for a working driver).

Signed-off-by: Mark Kettenis <mark.kettenis at xs4all.nl>
---
 src/i128init.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/i128init.c b/src/i128init.c
index d57e295..1504dcd 100644
--- a/src/i128init.c
+++ b/src/i128init.c
@@ -451,7 +451,20 @@ I128Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
 		pI128->DoubleScan = FALSE;
 	pI128->mem.rbase_g[CRT_ZOOM] = (pI128->DoubleScan ? 0x00000001 : 0x00000000);
 
-	pI128->mem.rbase_w[MW0_CTRL] = 0x00000000;
+	switch (pI128->bitsPerPixel) {
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+	case 32:
+		pI128->mem.rbase_w[MW0_CTRL] = 0x00060000;
+		break;
+	case 16:
+		pI128->mem.rbase_w[MW0_CTRL] = 0x00020000;
+		break;
+#endif
+	default:
+		pI128->mem.rbase_w[MW0_CTRL] = 0x00000000;
+		break;
+	}
+
 	switch (pI128->MemorySize) {
 		case 2048:
 			pI128->mem.rbase_w[MW0_SZ]   = 0x00000009;
-- 
1.6.3.2



More information about the xorg-devel mailing list