solaris-port.patch revision 1089
1281N/A--- src/mesa/drivers/dri/intel/intel_context.h Thu Apr 8 12:57:04 2010
1186N/A+++ src/mesa/drivers/dri/intel/intel_context.h Thu Apr 8 13:02:36 2010
1186N/A@@ -254,9 +254,13 @@
798N/A driOptionCache optionCache;
798N/A };
798N/A
1281N/A+#if defined(__sun)
798N/A+#include <stdlib.h>
798N/A+#define __progname getexecname()
798N/A+#else
798N/A extern char *__progname;
798N/A+#endif
798N/A
798N/A-
798N/A #define SUBPIXEL_X 0.125
798N/A #define SUBPIXEL_Y 0.125
798N/A
798N/A@@ -288,7 +292,7 @@
798N/A * than COPY_DWORDS would:
798N/A * XXX Put this in src/mesa/main/imports.h ???
1124N/A */
1186N/A-#if defined(i386) || defined(__i386__)
798N/A+#if (defined(i386) || defined(__i386__)) && !(defined(__SOLARIS__) || defined(sun))
1186N/A static INLINE void * __memcpy(void * to, const void * from, size_t n)
1186N/A {
1186N/A int d0, d1, d2;
1186N/A--- src/mesa/drivers/dri/intel/intel_batchbuffer.h Thu Apr 8 13:04:23 2010
1186N/A+++ src/mesa/drivers/dri/intel/intel_batchbuffer.h Thu Apr 8 13:05:06 2010
1186N/A@@ -8,7 +8,8 @@
1186N/A #include "intel_reg.h"
1186N/A
1186N/A #define BATCH_SZ 16384
1281N/A-#define BATCH_RESERVED 16
1281N/A+#define BATCH_RESERVED16 16
1330N/A+#define BATCH_RESERVED4k 4096
1330N/A
1330N/A
1330N/A struct intel_batchbuffer
1330N/A@@ -92,7 +93,10 @@
1330N/A static INLINE GLint
1186N/A intel_batchbuffer_space(struct intel_batchbuffer *batch)
1186N/A {
1281N/A- return (batch->size - batch->reserved_space) - (batch->ptr - batch->map);
1186N/A+ if (batch->intel->intelScreen->deviceID == PCI_CHIP_I865_G)
1186N/A+ return (batch->size - BATCH_RESERVED16) - (batch->ptr - batch->map);
1358N/A+ else
1358N/A+ return (batch->size - BATCH_RESERVED4k) - (batch->ptr - batch->map);
1358N/A }
1364N/A
1281N/A
1281N/A--- src/glx/glxcurrent.c Thu Apr 8 13:08:15 2010
1281N/A+++ src/glx/glxcurrent.c Thu Apr 8 13:08:49 2010
1186N/A@@ -397,7 +397,7 @@
1186N/A
1186N/A #ifdef GLX_DIRECT_RENDERING
1281N/A if ((dpy != oldGC->currentDpy || (gc && gc->driContext)) &&
1281N/A- !oldGC->isDirect && oldGC != &dummyContext) {
1281N/A+ !oldGC->isDirect && oldGC != &dummyContext && oldGC->xid != None) {
1281N/A #else
1281N/A if ((dpy != oldGC->currentDpy) && oldGC != &dummyContext) {
1281N/A #endif
1281N/A--- src/glx/Makefile Thu Apr 8 13:17:33 2010
1186N/A+++ src/glx/Makefile Thu Apr 8 13:18:05 2010
1186N/A@@ -65,6 +65,10 @@
1281N/A
1281N/A default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
1281N/A
1281N/A+# Needed to truly hide symbols gcc treats as HIDDEN/INTERNAL but doesn't mark
1186N/A+# as hidden in the ELF files properly.
1186N/A+GL_LIB_DEPS += -Wl,-M,mapfile.scope
1330N/A+
1330N/A # Make libGL
1281N/A $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(GLAPI_LIB) Makefile
1281N/A $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
1281N/Adiff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/Makefile.template src/mesa/drivers/dri/Makefile.template
1186N/A--- src/mesa/drivers/dri/Makefile.template 2009-03-12 20:28:49.000000000 -0700
1186N/A+++ src/mesa/drivers/dri/Makefile.template 2009-03-31 09:12:45.628778000 -0700
1186N/A@@ -1,5 +1,10 @@
1186N/A # -*-makefile-*-
1186N/A
1186N/A+# Needed to specify symbols which are allowed to be undefined when
1186N/A+# linking DRI modules with -z defs
1186N/A+DRI_LIB_DEPS += -Wl,-M,$(TOP)/src/mesa/drivers/dri/mapfile.externs
+
+
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
COMMON_SOURCES = \
--- src/mesa/drivers/dri/common/dri_util.h Thu Apr 8 13:21:04 2010
+++ src/mesa/drivers/dri/common/dri_util.h Thu Apr 8 13:21:23 2010
@@ -57,6 +57,10 @@
#define GLX_BAD_CONTEXT 5
+#define u_int64_t uint64_t
+#define u_int32_t uint32_t
+#define u_int8_t uint8_t
+
typedef struct __DRIswapInfoRec __DRIswapInfo;
/**
diff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/common/mmio.h src/mesa/drivers/dri/common/mmio.h
--- src/mesa/drivers/dri/common/mmio.h 2009-01-22 09:38:33.000000000 -0800
+++ src/mesa/drivers/dri/common/mmio.h 2009-03-31 09:12:45.639560000 -0700
@@ -34,6 +34,7 @@
#define MMIO_H
#include "main/glheader.h"
+#include "dri_util.h"
#if defined( __powerpc__ )
--- src/mesa/drivers/dri/i915/intel_tris.c Thu Apr 8 13:22:36 2010
+++ src/mesa/drivers/dri/i915/intel_tris.c Thu Apr 8 13:23:31 2010
@@ -325,7 +325,7 @@
* Emit primitives as inline vertices *
***********************************************************************/
-#ifdef __i386__
+#if (defined(i386) || defined(__i386__)) && !(defined(__SOLARIS__) || defined(sun))
#define COPY_DWORDS( j, vb, vertsize, v ) \
do { \
int __tmp; \
--- src/mesa/drivers/dri/i965/brw_draw_upload.c Thu Apr 8 13:27:42 2010
+++ src/mesa/drivers/dri/i965/brw_draw_upload.c Thu Apr 8 13:29:09 2010
@@ -159,7 +159,24 @@
BRW_SURFACEFORMAT_R8G8B8A8_SSCALED
};
+#if defined (sun)
+/* Solaris does not have ffsll in libc */
+#define NBITS_INT (CHAR_BIT * sizeof (int))
+static int ffsll(long long i)
+{
+ int i1;
+ int ret;
+ i1 = i & UINT_MAX;
+ ret = ffs(i1);
+ if (ret == 0) {
+ i1 = (i & 0xffffffff00000000) >> NBITS_INT;
+ ret = ffs(i1) + NBITS_INT;
+ }
+ return ret;
+}
+#endif
+
/**
* Given vertex array type/size/format/normalized info, return
* the appopriate hardware surface type.
diff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/intel/server/i830_dri.h src/mesa/drivers/dri/intel/server/i830_dri.h
--- src/mesa/drivers/dri/intel/server/i830_dri.h 2008-08-25 07:46:43.000000000 -0700
+++ src/mesa/drivers/dri/intel/server/i830_dri.h 2009-03-31 09:12:45.654900000 -0700
@@ -21,16 +21,20 @@ typedef struct _I830DRIRec {
drm_handle_t unused2; /* backbuffer */
drmSize unused3; /* depthbufferSize */
+ drmSize pad0;
drm_handle_t unused4; /* depthbuffer */
drmSize unused5; /* rotatedSize */
+ drmSize pad1;
drm_handle_t unused6; /* rotatedbuffer */
drm_handle_t unused7; /* textures */
int unused8; /* textureSize */
+ drmSize pad2;
drm_handle_t unused9; /* agp_buffers */
drmSize unused10; /* agp_buf_size */
+ drmSize pad3;
int deviceID;
int width;
diff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/radeon/server/radeon_dri.h src/mesa/drivers/dri/radeon/server/radeon_dri.h
--- src/mesa/drivers/dri/radeon/server/radeon_dri.h 2009-01-22 09:38:33.000000000 -0800
+++ src/mesa/drivers/dri/radeon/server/radeon_dri.h 2009-03-31 09:12:45.642139000 -0700
@@ -89,6 +89,7 @@ typedef struct {
/*@{*/
drm_handle_t registerHandle; /**< \brief MMIO register map size */
drmSize registerSize; /**< \brief MMIO register map handle */
+ int padding0;
/*@}*/
/**
@@ -97,6 +98,7 @@ typedef struct {
/*@{*/
drm_handle_t statusHandle; /**< \brief status map handle */
drmSize statusSize; /**< \brief status map size */
+ int padding1;
/*@}*/
/**
@@ -105,11 +107,13 @@ typedef struct {
/*@{*/
drm_handle_t gartTexHandle; /**< \brief AGP texture area map handle */
drmSize gartTexMapSize; /**< \brief AGP texture area map size */
+ int padding2;
int log2GARTTexGran; /**< \brief AGP texture granularity in log base 2 */
int gartTexOffset; /**< \brief AGP texture area offset in AGP space */
/*@}*/
unsigned int sarea_priv_offset; /**< \brief offset of the private SAREA data*/
+ int padding3;
} RADEONDRIRec, *RADEONDRIPtr;
#endif
--- src/mesa/drivers/dri/intel/intel_batchbuffer.c Tue Mar 30 15:21:12 2010
+++ src/mesa/drivers/dri/intel/intel_batchbuffer.c Tue Mar 30 15:22:42 2010
@@ -244,7 +244,10 @@
if (intel->vtbl.finish_batch)
intel->vtbl.finish_batch(intel);
- batch->reserved_space = BATCH_RESERVED;
+ if (batch->intel->intelScreen->deviceID == PCI_CHIP_I865_G)
+ batch->reserved_space = BATCH_RESERVED16;
+ else
+ batch->reserved_space = BATCH_RESERVED4k;
/* TODO: Just pass the relocation list and dma buffer up to the
* kernel.
--- src/gallium/drivers/svga/Makefile Thu Apr 8 14:31:43 2010
+++ src/gallium/drivers/svga/Makefile Thu Apr 8 14:31:51 2010
@@ -54,7 +54,7 @@
CFLAGS := $(filter-out -pedantic, $(filter-out -ansi, $(CFLAGS)))
LIBRARY_DEFINES = \
- -std=gnu99 -fvisibility=hidden \
+ -std=gnu99 \
-DHAVE_STDINT_H -DHAVE_SYS_TYPES_H
include ../../Makefile.template
--- src/glx/single2.c Tue Apr 20 11:00:09 2010
+++ src/glx/single2.c Tue Apr 20 11:02:19 2010
@@ -44,6 +44,9 @@
#include <X11/Xlib-xcb.h>
#endif /* USE_XCB */
+#if !defined(__GNUC__)
+# define __builtin_expect(x, y) x
+#endif
/* Used for GL_ARB_transpose_matrix */
static void