solaris-port.patch revision 705
551N/A###############################################################################
551N/A#
551N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
551N/A# Use subject to license terms.
551N/A#
551N/A# Permission is hereby granted, free of charge, to any person obtaining a
551N/A# copy of this software and associated documentation files (the
551N/A# "Software"), to deal in the Software without restriction, including
551N/A# without limitation the rights to use, copy, modify, merge, publish,
551N/A# distribute, and/or sell copies of the Software, and to permit persons
551N/A# to whom the Software is furnished to do so, provided that the above
551N/A# copyright notice(s) and this permission notice appear in all copies of
551N/A# the Software and that both the above copyright notice(s) and this
551N/A# permission notice appear in supporting documentation.
551N/A#
551N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
551N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
551N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
551N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
551N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
551N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
551N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
551N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
551N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
551N/A#
919N/A# Except as contained in this notice, the name of a copyright holder
919N/A# shall not be used in advertising or otherwise to promote the sale, use
919N/A# or other dealings in this Software without prior written authorization
919N/A# of the copyright holder.
919N/A#
919N/A
919N/Adiff -urp -x '*~' -x '*.orig' src/glx/x11/Makefile src/glx/x11/Makefile
919N/A--- src/glx/x11/Makefile 2009-03-12 20:28:49.000000000 -0700
919N/A+++ src/glx/x11/Makefile 2009-03-31 09:12:45.627261000 -0700
919N/A@@ -69,6 +69,10 @@ INCLUDES = -I. \
919N/A
919N/A default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
919N/A
919N/A+# Needed to truly hide symbols gcc treats as HIDDEN/INTERNAL but doesn't mark
919N/A+# as hidden in the ELF files properly.
919N/A+GL_LIB_DEPS += -Wl,-M,mapfile.scope
919N/A+
919N/A # Make libGL
919N/A $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
919N/A $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
919N/Adiff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/Makefile.template src/mesa/drivers/dri/Makefile.template
919N/A--- src/mesa/drivers/dri/Makefile.template 2009-03-12 20:28:49.000000000 -0700
919N/A+++ src/mesa/drivers/dri/Makefile.template 2009-03-31 09:12:45.628778000 -0700
919N/A@@ -1,5 +1,10 @@
919N/A # -*-makefile-*-
551N/A
551N/A+# Needed to specify symbols which are allowed to be undefined when
551N/A+# linking DRI modules with -z defs
551N/A+DRI_LIB_DEPS += -Wl,-M,$(TOP)/src/mesa/drivers/dri/mapfile.externs
551N/A+
551N/A+
551N/A MESA_MODULES = $(TOP)/src/mesa/libmesa.a
551N/A
551N/A COMMON_SOURCES = \
551N/Adiff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/common/dri_util.h src/mesa/drivers/dri/common/dri_util.h
551N/A--- src/mesa/drivers/dri/common/dri_util.h 2009-03-12 20:28:49.000000000 -0700
551N/A+++ src/mesa/drivers/dri/common/dri_util.h 2009-03-31 09:12:45.637799000 -0700
551N/A@@ -59,6 +59,10 @@
551N/A
551N/A #define GLX_BAD_CONTEXT 5
551N/A
551N/A+#define u_int64_t uint64_t
551N/A+#define u_int32_t uint32_t
551N/A+#define u_int8_t uint8_t
551N/A+
551N/A typedef struct __DRIswapInfoRec __DRIswapInfo;
551N/A
551N/A /* Typedefs to avoid rewriting the world. */
551N/Adiff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/common/mmio.h src/mesa/drivers/dri/common/mmio.h
551N/A--- src/mesa/drivers/dri/common/mmio.h 2009-01-22 09:38:33.000000000 -0800
551N/A+++ src/mesa/drivers/dri/common/mmio.h 2009-03-31 09:12:45.639560000 -0700
551N/A@@ -34,6 +34,7 @@
551N/A #define MMIO_H
551N/A
551N/A #include "main/glheader.h"
551N/A+#include "dri_util.h"
551N/A
551N/A #if defined( __powerpc__ )
551N/A
551N/Adiff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/i915/intel_tris.c src/mesa/drivers/dri/i915/intel_tris.c
551N/A--- src/mesa/drivers/dri/i915/intel_tris.c 2009-03-17 07:48:46.000000000 -0700
551N/A+++ src/mesa/drivers/dri/i915/intel_tris.c 2009-03-31 09:12:45.639052000 -0700
551N/A@@ -329,7 +329,7 @@ void intel_finish_vb(struct intel_contex
551N/A * Emit primitives as inline vertices *
551N/A ***********************************************************************/
551N/A
551N/A-#ifdef __i386__
551N/A+#if (defined(i386) || defined(__i386__)) && !(defined(__SOLARIS__) || defined(sun))
551N/A #define COPY_DWORDS( j, vb, vertsize, v ) \
551N/A do { \
551N/A int __tmp; \
551N/Adiff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/i965/brw_draw_upload.c src/mesa/drivers/dri/i965/brw_draw_upload.c
551N/A--- src/mesa/drivers/dri/i965/brw_draw_upload.c 2009-03-12 20:28:49.000000000 -0700
551N/A+++ src/mesa/drivers/dri/i965/brw_draw_upload.c 2009-03-31 09:12:45.643357000 -0700
551N/A@@ -26,6 +26,7 @@
551N/A **************************************************************************/
551N/A
551N/A #include <stdlib.h>
551N/A+#include <string.h>
551N/A
551N/A #include "main/glheader.h"
551N/A #include "main/context.h"
551N/A@@ -155,6 +156,23 @@ static GLuint byte_types_scale[5] = {
551N/A BRW_SURFACEFORMAT_R8G8B8A8_SSCALED
551N/A };
551N/A
551N/A+#if defined (sun)
551N/A+/* Solaris does not have ffsll in libc */
551N/A+#define NBITS_INT (CHAR_BIT * sizeof (int))
551N/A+static int ffsll(long long i)
551N/A+{
551N/A+ int i1;
551N/A+ int ret;
551N/A+
551N/A+ i1 = i & UINT_MAX;
551N/A+ ret = ffs(i1);
551N/A+ if (ret == 0) {
551N/A+ i1 = (i & 0xffffffff00000000) >> NBITS_INT;
551N/A+ ret = ffs(i1) + NBITS_INT;
551N/A+ }
551N/A+ return ret;
551N/A+}
551N/A+#endif
551N/A
551N/A static GLuint get_surface_type( GLenum type, GLuint size, GLboolean normalized )
551N/A {
551N/Adiff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/intel/intel_context.c src/mesa/drivers/dri/intel/intel_context.c
551N/A--- src/mesa/drivers/dri/intel/intel_context.c 2009-03-27 17:56:14.000000000 -0700
551N/A+++ src/mesa/drivers/dri/intel/intel_context.c 2009-03-31 09:12:45.630903000 -0700
551N/A@@ -70,6 +70,11 @@
551N/A int INTEL_DEBUG = (0);
551N/A #endif
551N/A
551N/A+#if defined(sun)
551N/A+extern void _sigoff(void);
551N/A+extern void _sigon(void);
551N/A+#endif
551N/A+
551N/A #define need_GL_ARB_multisample
551N/A #define need_GL_ARB_occlusion_query
551N/A #define need_GL_ARB_point_parameters
551N/A@@ -993,6 +998,9 @@ void LOCK_HARDWARE( struct intel_context
551N/A intel_fb->Base._ColorDrawBufferIndexes[0]);
551N/A }
551N/A
551N/A+#if defined(sun)
551N/A+ _sigoff();
551N/A+#else
551N/A if (intel_rb && dPriv->vblFlags &&
551N/A !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ) &&
551N/A (intel_fb->vbl_waited - intel_rb->vbl_pending) > (1<<23)) {
551N/A@@ -1008,6 +1016,7 @@ void LOCK_HARDWARE( struct intel_context
551N/A drmWaitVBlank(intel->driFd, &vbl);
551N/A intel_fb->vbl_waited = vbl.reply.sequence;
551N/A }
551N/A+#endif
551N/A
551N/A if (!sPriv->dri2.enabled) {
551N/A DRM_CAS(intel->driHwLock, intel->hHWContext,
551N/A@@ -1046,5 +1055,9 @@ void UNLOCK_HARDWARE( struct intel_conte
551N/A */
551N/A if (intel->batch->cliprect_mode == REFERENCES_CLIPRECTS)
551N/A intel_batchbuffer_flush(intel->batch);
551N/A+
551N/A+#if defined(sun)
551N/A+ _sigon();
551N/A+#endif
551N/A }
551N/A
551N/Adiff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/intel/intel_context.h src/mesa/drivers/dri/intel/intel_context.h
551N/A--- src/mesa/drivers/dri/intel/intel_context.h 2009-03-27 17:56:14.000000000 -0700
551N/A+++ src/mesa/drivers/dri/intel/intel_context.h 2009-03-31 09:12:45.655815000 -0700
551N/A@@ -309,8 +309,12 @@
551N/A void LOCK_HARDWARE( struct intel_context *intel );
551N/A void UNLOCK_HARDWARE( struct intel_context *intel );
551N/A
551N/A+#if defined(__sun)
551N/A+# include <stdlib.h>
551N/A+# define __progname getexecname()
551N/A+#else
551N/A extern char *__progname;
551N/A-
551N/A+#endif
551N/A
551N/A #define SUBPIXEL_X 0.125
551N/A #define SUBPIXEL_Y 0.125
551N/A@@ -352,7 +352,7 @@ do { \
551N/A * than COPY_DWORDS would:
551N/A * XXX Put this in src/mesa/main/imports.h ???
551N/A */
551N/A-#if defined(i386) || defined(__i386__)
551N/A+#if (defined(i386) || defined(__i386__)) && !(defined(__SOLARIS__) || defined(sun))
551N/A static INLINE void * __memcpy(void * to, const void * from, size_t n)
551N/A {
551N/A int d0, d1, d2;
551N/Adiff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/intel/intel_screen.c src/mesa/drivers/dri/intel/intel_screen.c
551N/A--- src/mesa/drivers/dri/intel/intel_screen.c 2009-03-17 07:48:46.000000000 -0700
551N/A+++ src/mesa/drivers/dri/intel/intel_screen.c 2009-03-31 09:12:45.636871000 -0700
551N/A@@ -25,6 +25,8 @@
551N/A *
551N/A **************************************************************************/
551N/A
551N/A+#include <unistd.h>
551N/A+#include <signal.h>
551N/A #include "main/glheader.h"
551N/A #include "main/context.h"
551N/A #include "main/framebuffer.h"
551N/A@@ -51,6 +53,15 @@
551N/A #include "intel_batchbuffer.h"
551N/A #include "intel_bufmgr.h"
551N/A
551N/A+static void stop_handler(int sig)
551N/A+{
551N/A+ kill(getpid(), SIGSTOP);
551N/A+}
551N/A+static void exit_handler(int sig)
551N/A+{
551N/A+ _exit(1);
551N/A+}
551N/A+
551N/A PUBLIC const char __driConfigOptions[] =
551N/A DRI_CONF_BEGIN
551N/A DRI_CONF_SECTION_PERFORMANCE
551N/A@@ -292,6 +303,12 @@ static GLboolean intelInitDriver(__DRIsc
551N/A
551N/A sPriv->extensions = intelScreenExtensions;
551N/A
551N/A+ (void) sigset(SIGTSTP, stop_handler);
551N/A+ (void) sigset(SIGTTIN, stop_handler);
551N/A+ (void) sigset(SIGTTOU, stop_handler);
551N/A+
551N/A+
551N/A+
551N/A return GL_TRUE;
551N/A }
551N/A
551N/Adiff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/intel/server/i830_dri.h src/mesa/drivers/dri/intel/server/i830_dri.h
551N/A--- src/mesa/drivers/dri/intel/server/i830_dri.h 2008-08-25 07:46:43.000000000 -0700
551N/A+++ src/mesa/drivers/dri/intel/server/i830_dri.h 2009-03-31 09:12:45.654900000 -0700
551N/A@@ -21,16 +21,20 @@ typedef struct _I830DRIRec {
551N/A drm_handle_t unused2; /* backbuffer */
551N/A
551N/A drmSize unused3; /* depthbufferSize */
551N/A+ drmSize pad0;
551N/A drm_handle_t unused4; /* depthbuffer */
551N/A
551N/A drmSize unused5; /* rotatedSize */
551N/A+ drmSize pad1;
551N/A drm_handle_t unused6; /* rotatedbuffer */
551N/A
551N/A drm_handle_t unused7; /* textures */
551N/A int unused8; /* textureSize */
551N/A+ drmSize pad2;
551N/A
551N/A drm_handle_t unused9; /* agp_buffers */
551N/A drmSize unused10; /* agp_buf_size */
551N/A+ drmSize pad3;
551N/A
551N/A int deviceID;
551N/A int width;
551N/Adiff -urp -x '*~' -x '*.orig' src/mesa/drivers/dri/radeon/server/radeon_dri.h src/mesa/drivers/dri/radeon/server/radeon_dri.h
551N/A--- src/mesa/drivers/dri/radeon/server/radeon_dri.h 2009-01-22 09:38:33.000000000 -0800
551N/A+++ src/mesa/drivers/dri/radeon/server/radeon_dri.h 2009-03-31 09:12:45.642139000 -0700
551N/A@@ -89,6 +89,7 @@ typedef struct {
551N/A /*@{*/
551N/A drm_handle_t registerHandle; /**< \brief MMIO register map size */
551N/A drmSize registerSize; /**< \brief MMIO register map handle */
551N/A+ int padding0;
551N/A /*@}*/
551N/A
551N/A /**
551N/A@@ -97,6 +98,7 @@ typedef struct {
551N/A /*@{*/
551N/A drm_handle_t statusHandle; /**< \brief status map handle */
551N/A drmSize statusSize; /**< \brief status map size */
551N/A+ int padding1;
551N/A /*@}*/
551N/A
551N/A /**
551N/A@@ -105,11 +107,13 @@ typedef struct {
551N/A /*@{*/
551N/A drm_handle_t gartTexHandle; /**< \brief AGP texture area map handle */
551N/A drmSize gartTexMapSize; /**< \brief AGP texture area map size */
551N/A+ int padding2;
551N/A int log2GARTTexGran; /**< \brief AGP texture granularity in log base 2 */
551N/A int gartTexOffset; /**< \brief AGP texture area offset in AGP space */
551N/A /*@}*/
551N/A
551N/A unsigned int sarea_priv_offset; /**< \brief offset of the private SAREA data*/
551N/A+ int padding3;
551N/A } RADEONDRIRec, *RADEONDRIPtr;
551N/A
551N/A #endif
551N/A