File U_xgi-Fix-build-on-bigendian.patch of Package xorg-x11-driver-video

From 82b83468d0ce39c52975a9a4dccbebc6abf6968e Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Fri, 25 Mar 2011 18:55:27 -0400
Subject: [PATCH] Fix build on bigendian
Patch-mainline: From Upstream

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
 src/Makefile.am |    2 ++
 src/vb_init.c   |    4 +++-
 src/xgi_accel.c |   15 +--------------
 3 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 96e7018..505f4c1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,6 +36,8 @@ xgi_drv_la_SOURCES = \
 	vb_def.h \
 	vb_ext.c \
 	vb_ext.h \
+	vb_i2c.c \
+	vb_i2c.h \
 	vb_init.c \
 	vb_init.h \
 	vb_setmode.c \
diff --git a/src/vb_init.c b/src/vb_init.c
index 8338410..50980c4 100755
--- a/src/vb_init.c
+++ b/src/vb_init.c
@@ -131,6 +131,8 @@ static void XGINew_SetDRAMDefaultRegister340(PXGI_HW_DEVICE_INFO, USHORT,
 static void XGINew_SetDRAMDefaultRegisterXG45(PXGI_HW_DEVICE_INFO, USHORT, 
     PVB_DEVICE_INFO);
 static UCHAR XGINew_Get340DRAMType(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO);
+/* horrible */
+#define XGINew_GetXG20DRAMType XGINew_Get340DRAMType
 
 static int XGINew_SetDDRChannel(int index, UCHAR ChannelNo,
     UCHAR XGINew_ChannelAB, const USHORT DRAMTYPE_TABLE[][5],
@@ -1451,7 +1453,7 @@ void XGINew_SetDRAMDefaultRegister340( PXGI_HW_DEVICE_INFO HwDeviceExtension ,
     }
 
     temp3 = 0 ;
-    for( k = 0 ; k < 4 ; k++ )
+    for( k = 1 ; k < 4 ; k++ )
     {
         XGI_SetRegANDOR((XGIIOADDRESS) P3d4 , 0x6E , 0xFC , temp3 ) ;		/* CR6E_D[1:0] select channel */
         temp2 = 0 ;
diff --git a/src/xgi_accel.c b/src/xgi_accel.c
index c072691..4536c81 100755
--- a/src/xgi_accel.c
+++ b/src/xgi_accel.c
@@ -200,20 +200,7 @@ extern int FbDevExist;
 #endif
 
 #if X_BYTE_ORDER == X_BIG_ENDIAN
-static CARD32 BE_SWAP32 (CARD32 val)
-{
-	PDEBUG(ErrorF("X_BIG_ENDIAN...\n"));
-    if (CurrentColorDepth == 8)
-	    return   ((((val) & 0x000000ff) << 24) | \
-                  (((val) & 0x0000ff00) << 8) |  \
-                  (((val) & 0x00ff0000) >> 8) |  \
-                  (((val) & 0xff000000) >> 24));
-    if (CurrentColorDepth == 24)
-        return val;
-    if (CurrentColorDepth == 16)
-        return ((((val) & 0x0000ffff) << 16) | \
-		         (((val) & 0xffff0000) >> 16));
-}    
+#define BE_SWAP32(x) swapl(x)
 #else 
 static CARD32 BE_SWAP32 (CARD32 val)
 {
-- 
1.6.0.2

From 2195d1cf692652fc51a94286a347000729301a32 Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston <jeremyhu@apple.com>
Date: Sun, 27 Mar 2011 15:17:04 -0700
Subject: [PATCH] BuildFix for big endian machines (fixes incorrect macro in previous commit).

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
---
 src/xgi_accel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/xgi_accel.c b/src/xgi_accel.c
index 4536c81..4c298ed 100755
--- a/src/xgi_accel.c
+++ b/src/xgi_accel.c
@@ -200,7 +200,7 @@ extern int FbDevExist;
 #endif
 
 #if X_BYTE_ORDER == X_BIG_ENDIAN
-#define BE_SWAP32(x) swapl(x)
+#define BE_SWAP32(x) lswapl(x)
 #else 
 static CARD32 BE_SWAP32 (CARD32 val)
 {
-- 
1.6.0.2

openSUSE Build Service is sponsored by