solaris-port.patch revision 1124
688N/A--- src/mesa/drivers/dri/intel/intel_context.h Thu Feb 10 09:26:20 2011
1064N/A+++ src/mesa/drivers/dri/intel/intel_context.h Thu Feb 10 09:27:22 2011
688N/A@@ -271,9 +271,13 @@
688N/A driOptionCache optionCache;
919N/A };
919N/A
919N/A+#if defined(__sun)
919N/A+#include <stdlib.h>
919N/A+#define __progname getexecname()
919N/A+#else
919N/A extern char *__progname;
919N/A+#endif
919N/A
919N/A-
919N/A #define SUBPIXEL_X 0.125
919N/A #define SUBPIXEL_Y 0.125
919N/A
919N/A@@ -307,7 +311,7 @@
919N/A * than COPY_DWORDS would:
919N/A * XXX Put this in src/mesa/main/imports.h ???
919N/A */
688N/A-#if defined(i386) || defined(__i386__)
688N/A+#if (defined(i386) || defined(__i386__)) && !(defined(__SOLARIS__) || defined(sun))
688N/A static INLINE void * __memcpy(void * to, const void * from, size_t n)
1064N/A {
1064N/A int d0, d1, d2;
688N/A--- src/mesa/drivers/dri/intel/intel_batchbuffer.h Thu Feb 10 09:28:18 2011
688N/A+++ src/mesa/drivers/dri/intel/intel_batchbuffer.h Thu Feb 10 13:28:05 2011
688N/A@@ -8,9 +8,9 @@
688N/A #include "intel_reg.h"
688N/A
688N/A #define BATCH_SZ 16384
688N/A-#define BATCH_RESERVED 16
688N/A+#define BATCH_RESERVED16 16
1064N/A+#define BATCH_RESERVED4k 4096
1064N/A
1064N/A-
688N/A struct intel_batchbuffer
688N/A {
688N/A struct intel_context *intel;
688N/A@@ -92,8 +92,12 @@
688N/A static INLINE GLint
688N/A intel_batchbuffer_space(struct intel_batchbuffer *batch)
688N/A {
688N/A- return (batch->state_batch_offset - batch->reserved_space) -
688N/A- (batch->ptr - batch->map);
688N/A+ if (batch->intel->intelScreen->deviceID == PCI_CHIP_I865_G)
688N/A+ return (batch->state_batch_offset - BATCH_RESERVED16) -
688N/A+ (batch->ptr - batch->map);
688N/A+ else
688N/A+ return (batch->state_batch_offset - BATCH_RESERVED4k) -
688N/A+ (batch->ptr - batch->map);
688N/A }
1064N/A
688N/A
688N/A--- src/mesa/drivers/dri/Makefile.template Thu Feb 10 13:58:58 2011
688N/A+++ src/mesa/drivers/dri/Makefile.template Thu Feb 10 14:01:53 2011
688N/A@@ -1,5 +1,9 @@
688N/A # -*-makefile-*-
688N/A
688N/A+# Needed to specify symbols which are allowed to be undefined when
688N/A+# linking DRI modules with -z defs
1064N/A+DRI_LIB_DEPS += -Wl,-M,$(TOP)/src/mesa/drivers/dri/mapfile.externs
688N/A+
688N/A MESA_MODULES = $(TOP)/src/mesa/libmesa.a
688N/A
688N/A COMMON_GALLIUM_SOURCES = \
688N/A--- src/mesa/drivers/dri/common/dri_util.h Thu Feb 10 14:04:16 2011
688N/A+++ src/mesa/drivers/dri/common/dri_util.h Thu Feb 10 14:04:54 2011
688N/A@@ -58,6 +58,10 @@
688N/A
1064N/A #define GLX_BAD_CONTEXT 5
688N/A
688N/A+#define u_int64_t uint64_t
688N/A+#define u_int32_t uint32_t
688N/A+#define u_int8_t uint8_t
688N/A+
688N/A typedef struct __DRIswapInfoRec __DRIswapInfo;
688N/A
688N/A /**
1064N/A--- src/mesa/drivers/dri/common/mmio.h Thu Feb 10 14:05:39 2011
688N/A+++ src/mesa/drivers/dri/common/mmio.h Thu Feb 10 14:05:58 2011
688N/A@@ -34,6 +34,7 @@
688N/A #define MMIO_H
688N/A
688N/A #include "main/glheader.h"
688N/A+#include "dri_util.h"
688N/A
688N/A #if defined( __powerpc__ )
--- src/mesa/drivers/dri/i915/intel_tris.c Thu Feb 10 14:07:48 2011
+++ src/mesa/drivers/dri/i915/intel_tris.c Thu Feb 10 14:08:17 2011
@@ -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 Feb 10 14:09:00 2011
+++ src/mesa/drivers/dri/i965/brw_draw_upload.c Thu Feb 10 14:09:49 2011
@@ -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.
--- src/mesa/drivers/dri/intel/intel_batchbuffer.c Thu Feb 10 14:12:23 2011
+++ src/mesa/drivers/dri/intel/intel_batchbuffer.c Thu Feb 10 14:13:06 2011
@@ -49,7 +49,10 @@
batch->size = intel->maxBatchSize;
batch->ptr = batch->map;
- 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;
batch->dirty_state = ~0;
batch->state_batch_offset = batch->size;
}
--- configure.ac Thu Mar 24 13:20:29 2011
+++ configure.ac Thu Mar 24 13:21:39 2011
@@ -150,7 +150,7 @@
# Enable -fvisibility=hidden if using a gcc that supports it
save_CFLAGS="$CFLAGS"
AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
- CFLAGS="$CFLAGS -fvisibility=hidden"
+ CFLAGS="$CFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
[CFLAGS="$save_CFLAGS" ; AC_MSG_RESULT([no])]);
@@ -163,7 +163,7 @@
# Enable -fvisibility=hidden if using a gcc that supports it
save_CXXFLAGS="$CXXFLAGS"
AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
- CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+ CXXFLAGS="$CXXFLAGS "
AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
[CXXFLAGS="$save_CXXFLAGS" ; AC_MSG_RESULT([no])]);
--- configure Thu Mar 24 13:20:33 2011
+++ configure Thu Mar 24 13:22:08 2011
@@ -4884,7 +4884,7 @@
save_CFLAGS="$CFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fvisibility=hidden" >&5
$as_echo_n "checking whether $CC supports -fvisibility=hidden... " >&6; }
- CFLAGS="$CFLAGS -fvisibility=hidden"
+ CFLAGS="$CFLAGS "
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -4916,7 +4916,7 @@
save_CXXFLAGS="$CXXFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports -fvisibility=hidden" >&5
$as_echo_n "checking whether $CXX supports -fvisibility=hidden... " >&6; }
- CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+ CXXFLAGS="$CXXFLAGS "
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
--- src/glx/Makefile Tue Apr 19 10:57:29 2011
+++ src/glx/Makefile Tue Apr 19 10:58:54 2011
@@ -73,6 +73,10 @@
default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
+# Needed to truly hide symbols gcc treats as HIDDEN/INTERNAL but doesn't mark
+# as hidden in the ELF files properly.
+GL_LIB_DEPS += -Wl,-M,mapfile.scope
+
# Make libGL
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(GLAPI_LIB) Makefile
$(MKLIB) -o $(GL_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \