[Midnightbsd-cvs] mports: dri/files: Add missing patches.

ctriv at midnightbsd.org ctriv at midnightbsd.org
Tue Oct 2 21:27:48 EDT 2007


Log Message:
-----------
Add missing patches.

Added Files:
-----------
    mports/graphics/dri/files:
        patch-glheader.h (r1.1)
        patch-mach64_context.h (r1.1)
        patch-sis_context.h (r1.1)

-------------- next part --------------
--- /dev/null
+++ graphics/dri/files/patch-glheader.h
@@ -0,0 +1,22 @@
+--- src/mesa/main/glheader.h.orig	Thu Apr 13 01:52:32 2006
++++ src/mesa/main/glheader.h	Wed Dec 20 15:27:53 2006
+@@ -127,12 +127,15 @@
+  * For now, only used by some DRI hardware drivers for color/texel packing.
+  */
+ #if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
+-#if defined(__linux__)
++#if defined(__FreeBSD__)
++#include <sys/endian.h>
++#define CPU_TO_LE32( x )	bswap32( x )
++#elif defined(__linux__)
+ #include <byteswap.h>
+ #define CPU_TO_LE32( x )	bswap_32( x )
+-#else /*__linux__*/
+-#define CPU_TO_LE32( x )	( x )  /* fix me for non-Linux big-endian! */
+-#endif /*__linux__*/
++#else
++#error "Add CPU_TO_LE32 macro for this OS."
++#endif
+ #define MESA_BIG_ENDIAN 1
+ #else
+ #define CPU_TO_LE32( x )	( x )
--- /dev/null
+++ graphics/dri/files/patch-sis_context.h
@@ -0,0 +1,24 @@
+--- src/mesa/drivers/dri/sis/sis_context.h.orig	Tue Apr 11 13:41:11 2006
++++ src/mesa/drivers/dri/sis/sis_context.h	Wed Dec 20 18:32:46 2006
+@@ -401,8 +401,20 @@
+ #define MMIO_READ(reg) *(volatile GLint *)(smesa->IOBase + (reg))
+ #define MMIO_READf(reg) *(volatile GLfloat *)(smesa->IOBase + (reg))
+ 
+-#if defined(__i386__) || defined(__amd64__)
++#if defined(__alpha__)
++#define MMIO_WMB()	__asm __volatile("wmb" : : : "memory")
++#elif defined(__amd64__) || defined(__i386__)
+ #define MMIO_WMB()	__asm __volatile("" : : : "memory")
++#elif defined(__ia64__)
++#define MMIO_WMB()	__asm __volatile("mf" : : : "memory")
++#elif defined(__powerpc__)
++#define MMIO_WMB()	__asm __volatile("eieio" : : : "memory")
++#elif defined(__sparc64__)
++/*
++ * #StoreStore probably would be sufficient for this driver at the
++ * time of this writing but we use #Sync for safety.
++ */
++#define MMIO_WMB()	__asm __volatile("membar #Sync" : : : "memory")
+ #else
+ #error platform needs WMB
+ #endif
--- /dev/null
+++ graphics/dri/files/patch-mach64_context.h
@@ -0,0 +1,37 @@
+--- src/mesa/drivers/dri/mach64/mach64_context.h.orig	Mon Nov 28 13:17:16 2005
++++ src/mesa/drivers/dri/mach64/mach64_context.h	Wed Dec 20 15:37:34 2006
+@@ -331,25 +331,28 @@
+ /* ================================================================
+  * Byte ordering
+  */
+-#if MESA_LITTLE_ENDIAN == 1
++#if defined(MESA_LITTLE_ENDIAN) && MESA_LITTLE_ENDIAN == 1
+ #define LE32_IN( x )		( *(GLuint *)(x) )
+ #define LE32_IN_FLOAT( x )	( *(GLfloat *)(x) )
+ #define LE32_OUT( x, y )	do { *(GLuint *)(x) = (y); } while (0)
+ #define LE32_OUT_FLOAT( x, y )	do { *(GLfloat *)(x) = (y); } while (0)
+ #else
+-#include <byteswap.h>
+-#define LE32_IN( x )		bswap_32( *(GLuint *)(x) )
++#define LE32_IN( x )		CPU_TO_LE32( *(GLuint *)(x) )
+ #define LE32_IN_FLOAT( x )						\
+ ({									\
+-   GLuint __tmp = bswap_32( *(GLuint *)(x) );				\
++   GLuint __tmp = CPU_TO_LE32( *(GLuint *)(x) );			\
+    *(GLfloat *)&__tmp;							\
+ })
+-#define LE32_OUT( x, y )	do { *(GLuint *)(x) = bswap_32( y ); } while (0)
++#define LE32_OUT( x, y )	do { *(GLuint *)(x) = CPU_TO_LE32( y ); } while (0)
++#define LE32_OUT( x, y )						\
++do {									\
++   *(GLuint *)(x) = CPU_TO_LE32( y );					\
++} while (0)
+ #define LE32_OUT_FLOAT( x, y )						\
+ do {									\
+    GLuint __tmp;							\
+    *(GLfloat *)&__tmp = (y);						\
+-   *(GLuint *)(x) = bswap_32( __tmp );					\
++   *(GLuint *)(x) = CPU_TO_LE32( __tmp );				\
+ } while (0)
+ #endif
+ 


More information about the Midnightbsd-cvs mailing list