diff options
-rw-r--r-- | graphics/MesaLib/distinfo | 6 | ||||
-rw-r--r-- | graphics/MesaLib/options.mk | 10 | ||||
-rw-r--r-- | graphics/MesaLib/patches/patch-src_glx_glxclient.h | 19 | ||||
-rw-r--r-- | graphics/MesaLib/patches/patch-src_glx_glxcurrent.c | 19 | ||||
-rw-r--r-- | graphics/MesaLib/patches/patch-src_mapi_u__current.c | 31 | ||||
-rw-r--r-- | graphics/MesaLib/patches/patch-src_mapi_u__current.h | 16 |
6 files changed, 97 insertions, 4 deletions
diff --git a/graphics/MesaLib/distinfo b/graphics/MesaLib/distinfo index 8d8cea4ae90..386ddfff4ba 100644 --- a/graphics/MesaLib/distinfo +++ b/graphics/MesaLib/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.98 2015/09/11 12:38:27 tnn Exp $ +$NetBSD: distinfo,v 1.99 2015/09/11 16:27:30 tnn Exp $ SHA1 (mesa-10.6.7.tar.xz) = c63008bf8f2b1022a60a82fa4f2200db6fbd956c RMD160 (mesa-10.6.7.tar.xz) = cdf2062b98094afdb281da6b040484f66383a17a @@ -20,12 +20,16 @@ SHA1 (patch-src_gallium_winsys_svga_drm_vmw__screen.c) = 4b2ae565377b1a0396c8bf6 SHA1 (patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c) = e4b891e8b4ebe5b8e8c7b8c2c1dbed11b9c417df SHA1 (patch-src_gbm_main_gbm.c) = 70225ab7352f123c9efc68b6d4ff0d9675b6f9dc SHA1 (patch-src_glsl_ralloc.c) = 7443d00ff05ee1e1dcfa2b76972b55abadebcad8 +SHA1 (patch-src_glx_glxclient.h) = e15256851559dafb7a86e1eb7e9d6afc86de581b +SHA1 (patch-src_glx_glxcurrent.c) = cad9128925aa68e169c241e3d747ec6e6a9d884e SHA1 (patch-src_loader_Makefile.in) = b0475273e2fdd3379528a0d8d393236df131bb30 SHA1 (patch-src_loader_loader.c) = 4086fcee5030b6d6624c08894ace67c8889887ce SHA1 (patch-src_mapi_entry__x86-64__tls.h) = c722ce4a22911d9a3d04e1a4fd6ab1a5ddd81cf0 SHA1 (patch-src_mapi_entry__x86__tls.h) = 51d6ef1aa3db69b23eea6fe145a54c0e7e265190 SHA1 (patch-src_mapi_entry__x86__tsd.h) = 62501b6e609fa81e33fd826a694e9d9752a7ba21 SHA1 (patch-src_mapi_glapi_gen_gl__gentable.py) = 53026e520a510e54494760a3fa05af6f15dfb9d8 +SHA1 (patch-src_mapi_u__current.c) = 1731375d82119be326b35d141d7879e083d6d620 +SHA1 (patch-src_mapi_u__current.h) = 214dd29cb0c4fe127eb1157b04b12ddfc455b4b0 SHA1 (patch-src_mesa_drivers_dri_Makefile.in) = 48032b8f8e6eac59092f68f3c32cfdd44d7ce8bf SHA1 (patch-src_mesa_drivers_dri_common_Makefile.in) = 5e160f7d92c2e9f3fa36e52a082a496af67e634e SHA1 (patch-src_mesa_drivers_dri_common_xmlconfig.c) = 668cc1d6a58f8f02eb9eb32c1aeffb4bef7beaf4 diff --git a/graphics/MesaLib/options.mk b/graphics/MesaLib/options.mk index 350970b8d01..3071cc9132e 100644 --- a/graphics/MesaLib/options.mk +++ b/graphics/MesaLib/options.mk @@ -1,4 +1,4 @@ -# $NetBSD: options.mk,v 1.34 2015/09/11 15:30:35 tnn Exp $ +# $NetBSD: options.mk,v 1.35 2015/09/11 16:27:30 tnn Exp $ PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib PKG_SUPPORTED_OPTIONS= llvm dri @@ -31,8 +31,12 @@ PLIST_VARS+= dri swrast_dri i915_dri nouveau_dri i965_dri radeon_dri r200_dri CONFIGURE_ARGS+= --enable-dri CONFIGURE_ARGS+= --enable-egl -# use Thread Local Storage in GLX where it works. -.if !empty(MACHINE_PLATFORM:MNetBSD-[789].*-*) || ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly" || ${OPSYS} == "Linux" +# use Thread Local Storage in GLX where it is supported and works +.if \ + !empty(MACHINE_PLATFORM:MNetBSD-[789].*-i386) || \ + !empty(MACHINE_PLATFORM:MNetBSD-[789].*-x86_64) || \ + !empty(MACHINE_PLATFORM:MFreeBSD-1[0-9].*-x86_64) || \ + !empty(MACHINE_PLATFORM:MDragonFly-.*-x86_64) # Not yet, needs more testing and xorg-server support. #CONFIGURE_ARGS+= --enable-glx-tls CONFIGURE_ARGS+= --disable-glx-tls diff --git a/graphics/MesaLib/patches/patch-src_glx_glxclient.h b/graphics/MesaLib/patches/patch-src_glx_glxclient.h new file mode 100644 index 00000000000..60ecfcf73d5 --- /dev/null +++ b/graphics/MesaLib/patches/patch-src_glx_glxclient.h @@ -0,0 +1,19 @@ +$NetBSD: patch-src_glx_glxclient.h,v 1.1 2015/09/11 16:27:30 tnn Exp $ + +NetBSD only supports zero-initialized initial-exec tls variables in conjuction +with dlopen(3) at the moment. + +--- src/glx/glxclient.h.orig 2015-09-02 17:06:23.000000000 +0000 ++++ src/glx/glxclient.h +@@ -635,7 +635,11 @@ extern void __glXSetCurrentContext(struc + extern __thread void *__glX_tls_Context + __attribute__ ((tls_model("initial-exec"))); + ++#if defined(__NetBSD__) ++# define __glXGetCurrentContext() (likely(__glX_tls_Context) ? __glX_tls_Context : (void*)&dummyContext) ++#else + # define __glXGetCurrentContext() __glX_tls_Context ++#endif + + # else + diff --git a/graphics/MesaLib/patches/patch-src_glx_glxcurrent.c b/graphics/MesaLib/patches/patch-src_glx_glxcurrent.c new file mode 100644 index 00000000000..68818cbdc7d --- /dev/null +++ b/graphics/MesaLib/patches/patch-src_glx_glxcurrent.c @@ -0,0 +1,19 @@ +$NetBSD: patch-src_glx_glxcurrent.c,v 1.1 2015/09/11 16:27:30 tnn Exp $ + +NetBSD only supports zero-initialized initial-exec tls variables in conjuction +with dlopen(3) at the moment. + +--- src/glx/glxcurrent.c.orig 2015-09-02 17:06:23.000000000 +0000 ++++ src/glx/glxcurrent.c +@@ -77,7 +77,11 @@ _X_HIDDEN pthread_mutex_t __glXmutex = P + * \c __glXGetCurrentContext can be implemented as trivial macro. + */ + __thread void *__glX_tls_Context __attribute__ ((tls_model("initial-exec"))) ++#if defined(__NetBSD__) ++ = NULL; /* non-zero initializers not supported with dlopen */ ++#else + = &dummyContext; ++#endif + + _X_HIDDEN void + __glXSetCurrentContext(struct glx_context * c) diff --git a/graphics/MesaLib/patches/patch-src_mapi_u__current.c b/graphics/MesaLib/patches/patch-src_mapi_u__current.c new file mode 100644 index 00000000000..1091eb49e8d --- /dev/null +++ b/graphics/MesaLib/patches/patch-src_mapi_u__current.c @@ -0,0 +1,31 @@ +$NetBSD: patch-src_mapi_u__current.c,v 1.1 2015/09/11 16:27:30 tnn Exp $ + +NetBSD only supports zero-initialized initial-exec tls variables in conjuction +with dlopen(3) at the moment. + +--- src/mapi/u_current.c.orig 2015-09-02 17:06:23.000000000 +0000 ++++ src/mapi/u_current.c +@@ -101,7 +101,11 @@ extern void (*__glapi_noop_table[])(void + + __thread struct mapi_table *u_current_table + __attribute__((tls_model("initial-exec"))) ++#if defined(__NetBSD__) ++ = NULL; /* non-zero initializers not supported with dlopen */ ++#else + = (struct mapi_table *) table_noop_array; ++#endif + + __thread void *u_current_context + __attribute__((tls_model("initial-exec"))); +@@ -283,7 +287,11 @@ struct mapi_table * + u_current_get_table_internal(void) + { + #if defined(GLX_USE_TLS) ++# if defined(__NetBSD__) ++ return (likely(u_current_table) ? u_current_table : (struct mapi_table *) table_noop_array); ++# else + return u_current_table; ++# endif + #else + if (ThreadSafe) + return (struct mapi_table *) tss_get(u_current_table_tsd); diff --git a/graphics/MesaLib/patches/patch-src_mapi_u__current.h b/graphics/MesaLib/patches/patch-src_mapi_u__current.h new file mode 100644 index 00000000000..c137f9122b6 --- /dev/null +++ b/graphics/MesaLib/patches/patch-src_mapi_u__current.h @@ -0,0 +1,16 @@ +$NetBSD: patch-src_mapi_u__current.h,v 1.1 2015/09/11 16:27:30 tnn Exp $ + +NetBSD only supports zero-initialized initial-exec tls variables in conjuction +with dlopen(3) at the moment. + +--- src/mapi/u_current.h.orig 2015-09-02 17:06:23.000000000 +0000 ++++ src/mapi/u_current.h +@@ -68,7 +68,7 @@ u_current_get_context_internal(void); + static inline const struct mapi_table * + u_current_get_table(void) + { +-#ifdef GLX_USE_TLS ++#if defined(GLX_USE_TLS) && !defined(__NetBSD__) + return u_current_table; + #else + return (likely(u_current_table) ? |