solaris-port.patch revision 1265
--- src/mesa/drivers/dri/intel/intel_context.h Thu Aug 18 08:49:56 2011
+++ src/mesa/drivers/dri/intel/intel_context.h Thu Aug 18 08:52:57 2011
@@ -304,9 +304,13 @@
driOptionCache optionCache;
};
+#if defined(__sun)
+#include <stdlib.h>
+#define __progname getexecname()
+#else
extern char *__progname;
+#endif
-
#define SUBPIXEL_X 0.125
#define SUBPIXEL_Y 0.125
@@ -364,7 +368,7 @@
* than COPY_DWORDS would:
* XXX Put this in src/mesa/main/imports.h ???
*/
-#if defined(i386) || defined(__i386__)
+#if (defined(i386) || defined(__i386__)) && !(defined(__SOLARIS__) || defined(sun))
static INLINE void * __memcpy(void * to, const void * from, size_t n)
{
int d0, d1, d2;
--- src/mesa/drivers/dri/common/dri_util.h Thu Feb 10 14:04:16 2011
+++ src/mesa/drivers/dri/common/dri_util.h Thu Feb 10 14:04:54 2011
@@ -58,6 +58,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;
/**
--- src/mesa/drivers/dri/common/mmio.h Thu Feb 10 14:05:39 2011
+++ src/mesa/drivers/dri/common/mmio.h Thu Feb 10 14:05:58 2011
@@ -34,6 +34,7 @@
#define MMIO_H
#include "main/glheader.h"
+#include "dri_util.h"
#if defined( __powerpc__ )
--- src/mesa/drivers/dri/i965/brw_draw_upload.c Thu Aug 18 08:59:09 2011
+++ src/mesa/drivers/dri/i965/brw_draw_upload.c Thu Aug 18 09:01:56 2011
@@ -160,7 +160,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/i915/intel_tris.c Thu Aug 18 08:58:29 2011
+++ src/mesa/drivers/dri/i915/intel_tris.c Thu Aug 18 09:01:06 2011
@@ -337,7 +337,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/glx/Makefile Thu Aug 18 09:02:07 2011
+++ src/glx/Makefile Thu Aug 18 09:04:41 2011
@@ -80,6 +80,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)' \
--- configure.ac Thu Aug 18 10:29:24 2011
+++ configure.ac Thu Aug 18 10:31:37 2011
@@ -158,7 +158,7 @@
# Enable -fvisibility=hidden if using a gcc that supports it
save_CFLAGS="$CFLAGS"
AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
- VISIBILITY_CFLAGS="-fvisibility=hidden"
+ VISIBILITY_CFLAGS=""
CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
[VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
@@ -175,7 +175,7 @@
# Enable -fvisibility=hidden if using a gcc that supports it
save_CXXFLAGS="$CXXFLAGS"
AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
- VISIBILITY_CXXFLAGS="-fvisibility=hidden"
+ VISIBILITY_CXXFLAGS=""
CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
[VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
--- configure Thu Aug 18 10:31:34 2011
+++ configure Thu Aug 18 10:32:15 2011
@@ -5012,7 +5012,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; }
- VISIBILITY_CFLAGS="-fvisibility=hidden"
+ VISIBILITY_CFLAGS=""
CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -5048,7 +5048,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; }
- VISIBILITY_CXXFLAGS="-fvisibility=hidden"
+ VISIBILITY_CXXFLAGS=""
CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
--- src/mesa/drivers/dri/Makefile.targets Fri Jul 8 18:37:10 2011
+++ src/mesa/drivers/dri/Makefile.targets Thu Aug 18 11:09:47 2011
@@ -16,7 +16,12 @@
default: subdirs lib
+DRI_LIB_DEPS += -Wl,-M,$(TOP)/src/mesa/drivers/dri/mapfile.externs
+MESA_MODULES = $(TOP)/src/mesa/libmesa.a
+
+LIBGLSL_MOBULES = $(TOP)/src/glsl/libglsl.a
+
.PHONY: lib
lib: symlinks subdirs depend
@$(MAKE) $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
@@ -24,7 +29,7 @@
$(LIBNAME): $(OBJECTS) $(EXTRA_MODULES) $(MESA_MODULES) Makefile \
$(MKLIB) -o $@.tmp -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
- $(OBJECTS) $(EXTRA_MODULES) $(DRI_LIB_DEPS)
+ $(OBJECTS) $(EXTRA_MODULES) $(DRI_LIB_DEPS) $(MESA_MODULES) $(LIBGLSL_MOBULES)
$(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS)
@rm -f $@.test
mv -f $@.tmp $@
--- src/mesa/drivers/dri/intel/intel_context.c Tue Sep 6 09:26:10 2011
+++ src/mesa/drivers/dri/intel/intel_context.c Tue Sep 6 09:29:16 2011
@@ -737,7 +737,7 @@
driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache,
sPriv->myNum, (intel->gen >= 4) ? "i965" : "i915");
if (intel->gen < 4)
- intel->maxBatchSize = 4096;
+ intel->maxBatchSize = 2*4096;
else
intel->maxBatchSize = sizeof(intel->batch.map);
--- src/mesa/drivers/dri/intel/intel_batchbuffer.c Tue Sep 6 09:28:13 2011
+++ src/mesa/drivers/dri/intel/intel_batchbuffer.c Tue Sep 6 09:30:56 2011
@@ -82,7 +82,7 @@
intel->batch.bo = drm_intel_bo_alloc(intel->bufmgr, "batchbuffer",
intel->maxBatchSize, 4096);
- intel->batch.reserved_space = BATCH_RESERVED;
+ intel->batch.reserved_space = 4096;
intel->batch.state_batch_offset = intel->batch.bo->size;
intel->batch.used = 0;
}