Module Name:    xsrc
Committed By:   mrg
Date:           Thu Dec 18 06:20:51 UTC 2014

Modified Files:
        xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util: u_network.c
            u_network.h
        xsrc/external/mit/MesaLib/dist/src/gallium/include/pipe: p_config.h
        xsrc/external/mit/MesaLib/dist/src/glx: dri_common.c
        xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/common: xmlconfig.c
        xsrc/external/mit/MesaLib/dist/src/mesa/main: accum.c compiler.h
            context.c dlist.c
        xsrc/external/mit/MesaLib/dist/src/mesa/math: m_norm_tmp.h
        xsrc/external/mit/MesaLib/dist/src/mesa/x86: common_x86.c

Log Message:
merge netbsd fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
    xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.c
cvs rdiff -u -r1.1.1.2 -r1.2 \
    xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.h
cvs rdiff -u -r1.1.1.4 -r1.2 \
    xsrc/external/mit/MesaLib/dist/src/gallium/include/pipe/p_config.h
cvs rdiff -u -r1.1.1.3 -r1.2 \
    xsrc/external/mit/MesaLib/dist/src/glx/dri_common.c
cvs rdiff -u -r1.6 -r1.7 \
    xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/common/xmlconfig.c
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/MesaLib/dist/src/mesa/main/accum.c
cvs rdiff -u -r1.3 -r1.4 \
    xsrc/external/mit/MesaLib/dist/src/mesa/main/compiler.h \
    xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c
cvs rdiff -u -r1.1.1.6 -r1.2 \
    xsrc/external/mit/MesaLib/dist/src/mesa/main/dlist.c
cvs rdiff -u -r1.3 -r1.4 \
    xsrc/external/mit/MesaLib/dist/src/mesa/math/m_norm_tmp.h
cvs rdiff -u -r1.1.1.5 -r1.2 \
    xsrc/external/mit/MesaLib/dist/src/mesa/x86/common_x86.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.c
diff -u xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.c:1.1.1.3 xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.c:1.2
--- xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.c:1.1.1.3	Thu Dec 18 06:02:06 2014
+++ xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.c	Thu Dec 18 06:20:50 2014
@@ -7,7 +7,8 @@
 #  include <winsock2.h>
 #  include <windows.h>
 #elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \
-   defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS)
+   defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS) || \
+   defined(PIPE_OS_NETBSD)
 #  include <sys/socket.h>
 #  include <netinet/in.h>
 #  include <unistd.h>

Index: xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.h
diff -u xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.h:1.1.1.2 xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.h:1.2
--- xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.h:1.1.1.2	Thu Dec 18 06:02:06 2014
+++ xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/util/u_network.h	Thu Dec 18 06:20:50 2014
@@ -7,7 +7,7 @@
 #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
 #  define PIPE_HAVE_SOCKETS
 #elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \
-    defined(PIPE_OS_APPLE) || defined(PIPE_OS_SOLARIS)
+    defined(PIPE_OS_APPLE) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_NETBSD)
 #  define PIPE_HAVE_SOCKETS
 #endif
 

Index: xsrc/external/mit/MesaLib/dist/src/gallium/include/pipe/p_config.h
diff -u xsrc/external/mit/MesaLib/dist/src/gallium/include/pipe/p_config.h:1.1.1.4 xsrc/external/mit/MesaLib/dist/src/gallium/include/pipe/p_config.h:1.2
--- xsrc/external/mit/MesaLib/dist/src/gallium/include/pipe/p_config.h:1.1.1.4	Thu Dec 18 06:02:07 2014
+++ xsrc/external/mit/MesaLib/dist/src/gallium/include/pipe/p_config.h	Thu Dec 18 06:20:50 2014
@@ -167,6 +167,16 @@
 # define PIPE_ARCH_BIG_ENDIAN
 #endif
 
+#elif defined(__NetBSD__)
+#include <sys/types.h>
+#include <sys/endian.h>
+
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+# define PIPE_ARCH_LITTLE_ENDIAN
+#elif _BYTE_ORDER == _BIG_ENDIAN
+# define PIPE_ARCH_BIG_ENDIAN
+#endif
+
 #else
 
 #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)

Index: xsrc/external/mit/MesaLib/dist/src/glx/dri_common.c
diff -u xsrc/external/mit/MesaLib/dist/src/glx/dri_common.c:1.1.1.3 xsrc/external/mit/MesaLib/dist/src/glx/dri_common.c:1.2
--- xsrc/external/mit/MesaLib/dist/src/glx/dri_common.c:1.1.1.3	Thu Dec 18 06:02:08 2014
+++ xsrc/external/mit/MesaLib/dist/src/glx/dri_common.c	Thu Dec 18 06:20:50 2014
@@ -99,7 +99,11 @@ driOpenDriver(const char *driverName)
    int len;
 
    /* Attempt to make sure libGL symbols will be visible to the driver */
+#ifdef __NetBSD__ // base only, pkgsrc didn't get bumped for time_t
+   glhandle = dlopen("libGL.so.2", RTLD_NOW | RTLD_GLOBAL);
+#else
    glhandle = dlopen("libGL.so.1", RTLD_NOW | RTLD_GLOBAL);
+#endif
 
    libPaths = NULL;
    if (geteuid() == getuid()) {

Index: xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/common/xmlconfig.c
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/common/xmlconfig.c:1.6 xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/common/xmlconfig.c:1.7
--- xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/common/xmlconfig.c:1.6	Thu Dec 18 06:11:44 2014
+++ xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/common/xmlconfig.c	Thu Dec 18 06:20:50 2014
@@ -27,11 +27,6 @@
  * \author Felix Kuehling
  */
 
-// XXXMRG
-//#include "main/glheader.h"
-
-#include <sys/param.h>
-
 #include <string.h>
 #include <assert.h>
 #include <expat.h>
@@ -44,6 +39,10 @@
 
 #undef GET_PROGRAM_NAME
 
+#if defined(__NetBSD__)
+#include <sys/param.h>
+#endif
+
 #if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__)
 #    if !defined(__GLIBC__) || (__GLIBC__ < 2)
 /* These aren't declared in any libc5 header */
@@ -58,7 +57,7 @@ extern char *program_invocation_name, *p
 #        include <stdlib.h>
 #        define GET_PROGRAM_NAME() getprogname()
 #    endif
-#elif defined(__NetBSD__) && defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106000100)
+#elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100)
 #    include <stdlib.h>
 #    define GET_PROGRAM_NAME() getprogname()
 #elif defined(__APPLE__)

Index: xsrc/external/mit/MesaLib/dist/src/mesa/main/accum.c
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/main/accum.c:1.5 xsrc/external/mit/MesaLib/dist/src/mesa/main/accum.c:1.6
--- xsrc/external/mit/MesaLib/dist/src/mesa/main/accum.c:1.5	Thu Dec 18 06:11:50 2014
+++ xsrc/external/mit/MesaLib/dist/src/mesa/main/accum.c	Thu Dec 18 06:20:51 2014
@@ -31,7 +31,6 @@
 #include "imports.h"
 #include "macros.h"
 #include "state.h"
-#include "GL/glext.h"
 #include "mtypes.h"
 #include "main/dispatch.h"
 

Index: xsrc/external/mit/MesaLib/dist/src/mesa/main/compiler.h
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/main/compiler.h:1.3 xsrc/external/mit/MesaLib/dist/src/mesa/main/compiler.h:1.4
--- xsrc/external/mit/MesaLib/dist/src/mesa/main/compiler.h:1.3	Thu Dec 18 06:11:50 2014
+++ xsrc/external/mit/MesaLib/dist/src/mesa/main/compiler.h	Thu Dec 18 06:20:51 2014
@@ -164,16 +164,13 @@ static INLINE GLuint CPU_TO_LE32(GLuint 
 #else /*__linux__ */
 #include <sys/endian.h>
 #define CPU_TO_LE32( x )	bswap32( x )
-#define CPU_TO_LE16( x )	bswap16( x )
 #endif /*__linux__*/
 #define MESA_BIG_ENDIAN 1
 #else
 #define CPU_TO_LE32( x )	( x )
-#define CPU_TO_LE16( x )	( x )
 #define MESA_LITTLE_ENDIAN 1
 #endif
 #define LE32_TO_CPU( x )	CPU_TO_LE32( x )
-#define LE16_TO_CPU( x )	CPU_TO_LE16( x )
 
 
 
Index: xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c:1.3 xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c:1.4
--- xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c:1.3	Thu Dec 18 06:11:50 2014
+++ xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c	Thu Dec 18 06:20:51 2014
@@ -377,10 +377,10 @@ mtx_t OneTimeLock = _MTX_INITIALIZER_NP;
  *
  * \sa _math_init().
  */
-static GLbitfield api_init_mask = 0x0;
 static void
 one_time_init( struct gl_context *ctx )
 {
+   static GLbitfield api_init_mask = 0x0;
 
    mtx_lock(&OneTimeLock);
 
@@ -427,14 +427,12 @@ one_time_init( struct gl_context *ctx )
 
    mtx_unlock(&OneTimeLock);
 
-   dummy_enum_func();
-}
+   /* Hopefully atexit() is widely available.  If not, we may need some
+    * #ifdef tests here.
+    */
+   atexit(_mesa_destroy_shader_compiler);
 
-static void __attribute__((__destructor__))
-one_time_fini(void)
-{
-  if (api_init_mask)
-    _mesa_destroy_shader_compiler();
+   dummy_enum_func();
 }
 
 

Index: xsrc/external/mit/MesaLib/dist/src/mesa/main/dlist.c
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/main/dlist.c:1.1.1.6 xsrc/external/mit/MesaLib/dist/src/mesa/main/dlist.c:1.2
--- xsrc/external/mit/MesaLib/dist/src/mesa/main/dlist.c:1.1.1.6	Thu Dec 18 06:02:08 2014
+++ xsrc/external/mit/MesaLib/dist/src/mesa/main/dlist.c	Thu Dec 18 06:20:51 2014
@@ -518,6 +518,9 @@ union gl_dlist_node
    GLenum e;
    GLfloat f;
    GLsizei si;
+#ifdef __NetBSD__
+   unsigned long long _dummy;
+#endif
 };
 
 
@@ -548,7 +551,8 @@ save_pointer(union gl_dlist_node *dest, 
    unsigned i;
 
    STATIC_ASSERT(POINTER_DWORDS == 1 || POINTER_DWORDS == 2);
-   STATIC_ASSERT(sizeof(union gl_dlist_node) == 4);
+   STATIC_ASSERT(sizeof(union gl_dlist_node) == 4 ||
+                 sizeof(union gl_dlist_node) == 8);
 
    p.ptr = src;
 

Index: xsrc/external/mit/MesaLib/dist/src/mesa/math/m_norm_tmp.h
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/math/m_norm_tmp.h:1.3 xsrc/external/mit/MesaLib/dist/src/mesa/math/m_norm_tmp.h:1.4
--- xsrc/external/mit/MesaLib/dist/src/mesa/math/m_norm_tmp.h:1.3	Thu Dec 18 06:11:50 2014
+++ xsrc/external/mit/MesaLib/dist/src/mesa/math/m_norm_tmp.h	Thu Dec 18 06:20:51 2014
@@ -321,7 +321,7 @@ TAG(normalize_normals)( const GLmatrix *
       STRIDE_LOOP {
 	 const GLfloat x = from[0], y = from[1], z = from[2];
 	 GLdouble len = x * x + y * y + z * z;
-	 if (len > 1e-20) {
+	 if (len > 1e-50) {
 	    len = INV_SQRTF(len);
 	    out[i][0] = (GLfloat)(x * len);
 	    out[i][1] = (GLfloat)(y * len);

Index: xsrc/external/mit/MesaLib/dist/src/mesa/x86/common_x86.c
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/x86/common_x86.c:1.1.1.5 xsrc/external/mit/MesaLib/dist/src/mesa/x86/common_x86.c:1.2
--- xsrc/external/mit/MesaLib/dist/src/mesa/x86/common_x86.c:1.1.1.5	Thu Dec 18 06:02:09 2014
+++ xsrc/external/mit/MesaLib/dist/src/mesa/x86/common_x86.c	Thu Dec 18 06:20:51 2014
@@ -42,6 +42,10 @@
 #include <sys/types.h>
 #include <sys/sysctl.h>
 #endif
+#if defined(USE_SSE_ASM) && defined(__NetBSD__)
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
 #if defined(USE_SSE_ASM) && defined(__OpenBSD__)
 #include <sys/param.h>
 #include <sys/sysctl.h>

Reply via email to