pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

MesaLib-dfbsd-meson: Update wip/MesaLib-dfbsd-meson through 2019-03-12



Module Name:	pkgsrc-wip
Committed By:	David Shao <davshao%gmail.com@localhost>
Pushed By:	dshao
Date:		Wed Mar 13 13:52:22 2019 -0700
Changeset:	6d3ed9827f2c4d2d12db8bd0744f47745a6207b8

Modified Files:
	MesaLib-dfbsd-meson/Makefile
	MesaLib-dfbsd-meson/TODO
	MesaLib-dfbsd-meson/distinfo
	MesaLib-dfbsd-meson/options.mk
	MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
	MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__device.c
	MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_intel__screen.c
	MesaLib-dfbsd-meson/patches/patch-src_util_os__time.c
	MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h
Added Files:
	MesaLib-dfbsd-meson/patches/patch-meson.build
	MesaLib-dfbsd-meson/patches/patch-meson__options.txt
	MesaLib-dfbsd-meson/patches/patch-src_gbm_backends_dri_gbm__dri.c
	MesaLib-dfbsd-meson/patches/patch-src_glx_dri__common.c
	MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86__tsd.h

Log Message:
MesaLib-dfbsd-meson: Update wip/MesaLib-dfbsd-meson through 2019-03-12

Also add some code and options from OpenBSD xenocara, and
an option is atomic_add_unless needs to have return inverted,
not working.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=6d3ed9827f2c4d2d12db8bd0744f47745a6207b8

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

diffstat:
 MesaLib-dfbsd-meson/Makefile                       |  8 +-
 MesaLib-dfbsd-meson/TODO                           |  5 +-
 MesaLib-dfbsd-meson/distinfo                       | 23 +++---
 MesaLib-dfbsd-meson/options.mk                     | 86 +++++++++++++++++++++-
 MesaLib-dfbsd-meson/patches/patch-meson.build      | 24 ++++++
 .../patches/patch-meson__options.txt               | 17 +++++
 ...llium_auxiliary_pipe-loader_pipe__loader__drm.c |  8 +-
 .../patches/patch-src_gbm_backends_dri_gbm__dri.c  | 16 ++++
 .../patches/patch-src_glx_dri__common.c            | 15 ++++
 .../patches/patch-src_intel_vulkan_anv__device.c   | 12 +--
 .../patches/patch-src_mapi_entry__x86__tsd.h       | 77 +++++++++++++++++++
 ...patch-src_mesa_drivers_dri_i965_intel__screen.c |  2 +-
 .../patches/patch-src_util_os__time.c              |  2 +-
 .../patches/patch-src_util_u__thread.h             |  2 +-
 14 files changed, 269 insertions(+), 28 deletions(-)

diffs:
diff --git a/MesaLib-dfbsd-meson/Makefile b/MesaLib-dfbsd-meson/Makefile
index 73711dd4f7..a801e94876 100644
--- a/MesaLib-dfbsd-meson/Makefile
+++ b/MesaLib-dfbsd-meson/Makefile
@@ -1,7 +1,10 @@
 # $NetBSD: Makefile,v 1.18 2019/02/22 15:40:35 tnn Exp $
 
+# 2019-03-12	intel/fs: Fix opt_peephole_csel to not throw away saturates.
+COMMIT_ID=	3570d15b6d88bdcd353b31ffe5460d04a88b7b6f
+
 # 2019-03-06	st/glsl: start spilling out common st glsl conversion code
-COMMIT_ID=	ecceb076e5c99cea94b853a9600947fe78b3ca74
+# COMMIT_ID=	ecceb076e5c99cea94b853a9600947fe78b3ca74
 
 # 2019-03-05	anv: Implement VK_EXT_inline_uniform_block
 # COMMIT_ID=	43f40dc7cb234e007fe612b67cc765288ddf0533
@@ -35,10 +38,9 @@ HOMEPAGE=	https://www.mesa3d.org/
 COMMENT=	The Mesa 3D Graphics Library
 LICENSE=	mit
 
-GNU_CONFIGURE=	yes
+# GNU_CONFIGURE=	yes
 # USE_TOOLS+=	autoconf automake autoreconf bison pkg-config gmake flex
 USE_TOOLS+=	bison pkg-config gmake flex
-
 USE_LANGUAGES=	c99 c++
 # USE_LIBTOOL=	yes
 
diff --git a/MesaLib-dfbsd-meson/TODO b/MesaLib-dfbsd-meson/TODO
index 5589abaf3e..06da5abeee 100644
--- a/MesaLib-dfbsd-meson/TODO
+++ b/MesaLib-dfbsd-meson/TODO
@@ -5,4 +5,7 @@ Copy port to graphics/MesaLib, do not install from wip.
 * Test OSX quartz, check if bug 90311 patch needs regen
 * Test Solaris
 * Test Linux
-* Fully port Vulkan support from FreeBSD ports. 
+* Fully port Vulkan support from FreeBSD ports.
+* Figure out if there really is a problem with atomic_add_unless
+  inverting the Linux definition
+* See what can be ported from latest OpenBSD xenocara and NetBSD xsrc
diff --git a/MesaLib-dfbsd-meson/distinfo b/MesaLib-dfbsd-meson/distinfo
index 14f6e182fb..633b89ceb7 100644
--- a/MesaLib-dfbsd-meson/distinfo
+++ b/MesaLib-dfbsd-meson/distinfo
@@ -1,11 +1,13 @@
 $NetBSD: distinfo,v 1.16 2019/02/22 15:40:35 tnn Exp $
 
-SHA1 (mesa-ecceb076e5c99cea94b853a9600947fe78b3ca74.tar.xz) = 7433e1f7fc41f492abf65b70fffcbf9ff3a45d53
-RMD160 (mesa-ecceb076e5c99cea94b853a9600947fe78b3ca74.tar.xz) = 47ed0d295f41558cca5f94be5221e57551eb8483
-SHA512 (mesa-ecceb076e5c99cea94b853a9600947fe78b3ca74.tar.xz) = 684755bffa39966ddb2c5e8cbf27ddac2d2ee639c7f602030cf75ad1f3eeceadd2b720208c6abf504ea90cbdf3438bc3c2f57445100d16452e93ef593d983fc5
-Size (mesa-ecceb076e5c99cea94b853a9600947fe78b3ca74.tar.xz) = 10584104 bytes
+SHA1 (mesa-3570d15b6d88bdcd353b31ffe5460d04a88b7b6f.tar.xz) = 9d207c5a74826110ef57eb74d25664b4239e0042
+RMD160 (mesa-3570d15b6d88bdcd353b31ffe5460d04a88b7b6f.tar.xz) = 47b274ebdd25551c51c07aae8c950673300d18d8
+SHA512 (mesa-3570d15b6d88bdcd353b31ffe5460d04a88b7b6f.tar.xz) = 8b7479bd72a94335a4ff03e1c7a7a9ffc18da5b0b7edf04880a7fa34c08af8da393d19c9498a0f831a4ab5aa9f0f6907009ca664206eb9956691a51a4d6ca0bc
+Size (mesa-3570d15b6d88bdcd353b31ffe5460d04a88b7b6f.tar.xz) = 10675608 bytes
 SHA1 (patch-configure.ac) = cddca44dbf1e2f447dd30a03440104920d6c24ab
 SHA1 (patch-include_GL_internal_dri__interface.h) = 76803a4ab6ff7e596900a0099dd9712093f8bc21
+SHA1 (patch-meson.build) = a1df13b2efa52a6bd04ffd7a3063401c96bcc3cf
+SHA1 (patch-meson__options.txt) = 171ac109444b0ce8ea37e53b72f529a4b5e5c6f6
 SHA1 (patch-src_amd_common_ac__debug.c) = 8233367c3b5bc344442ea8d19488fdd1e3791ae9
 SHA1 (patch-src_amd_vulkan_radv__device.c) = a029ba89311fe62e3712573993fabf38910e9838
 SHA1 (patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c) = 1fe81a7b16e36dc9125400c20543271216a33a45
@@ -15,7 +17,7 @@ SHA1 (patch-src_egl_drivers_dri2_platform__drm.c) = e18e7b1ffbc74b8acf3d9095a92c
 SHA1 (patch-src_egl_drivers_dri2_platform__x11.c) = 49e48c31eacb79d1da357fe70eaffd2926b5280e
 SHA1 (patch-src_egl_main_eglglobals.c) = 0d52014f52e62fc5fa6650336ddb0011ecf331e6
 SHA1 (patch-src_gallium_auxiliary_drivers_trace_tr__dump.c) = 360e1608508a7bbb41acecd58930781038e2309e
-SHA1 (patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c) = f913b779404e6bd8ae707a4fd66eb7c1dca9b311
+SHA1 (patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c) = 14f0511191ef468a39e3248d44f7dbdffa554547
 SHA1 (patch-src_gallium_auxiliary_util_u__format__tests.c) = d878e6f3e9a0a37d4903c0d0551f9fa535635d40
 SHA1 (patch-src_gallium_drivers_freedreno_freedreno__screen.c) = d76bf52c25609d641dbf4021e81282cbdc925976
 SHA1 (patch-src_gallium_drivers_iris_iris__bufmgr.c) = d6ead77d93ade4beada1625cb09c40362fb0b3f0
@@ -35,8 +37,10 @@ SHA1 (patch-src_gallium_state__trackers_clover_llvm_metadata.hpp) = c97d38098ea0
 SHA1 (patch-src_gallium_state__trackers_clover_util_range.hpp) = cdc78067986c1b92818472c4201c58ef1b42c4f4
 SHA1 (patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c) = 8c73f29a93e4e7ae8c0acd6f5f345047dc8a8541
 SHA1 (patch-src_gbm_Makefile.am) = 5f3107afbf64b97f7d21ce427cecc4fb78974db3
+SHA1 (patch-src_gbm_backends_dri_gbm__dri.c) = b827957f7df62bf3a25979b29a8cd8576e3ea62b
 SHA1 (patch-src_glx_Makefile.am) = 869c4f2388f835b9b296b3c84c2a03ef7717f17d
 SHA1 (patch-src_glx_apple_apple__glapi.c) = c4eea8dabf74eb03d22da4eb834b18ae3384c63b
+SHA1 (patch-src_glx_dri__common.c) = 7f87917dbef11621a488554a49797b1407c4a5c4
 SHA1 (patch-src_glx_dri__common.h) = 0274877f8c65a4bb729536a897df4704897a4c6e
 SHA1 (patch-src_glx_dri__glx.c) = 8fd48776e9953b18bd17ba130d90ae2935e67242
 SHA1 (patch-src_glx_glxclient.h) = f0358179ae397bc8677597b0ccb9a471f40f15de
@@ -49,19 +53,20 @@ SHA1 (patch-src_intel_tools_aub__mem.c) = 671e478a843b70c12c5038ad314c108925ab5c
 SHA1 (patch-src_intel_tools_aubinator__error__decode.c) = 159b57f9a3c1fd37ab1e5b49ff911073e2e9ff9b
 SHA1 (patch-src_intel_tools_error2aub.c) = e38395e3889f6e3af645f312a429ce2a7d285231
 SHA1 (patch-src_intel_vulkan_anv__allocator.c) = 5dd27eea9811d739558c5b488c57a3d7ae539d87
-SHA1 (patch-src_intel_vulkan_anv__device.c) = 03600546e73527ef1db50650907f7ad3062273f3
+SHA1 (patch-src_intel_vulkan_anv__device.c) = 1f6ac5bcd6bf31275b93b805ee5fe6213e6dbb7e
 SHA1 (patch-src_intel_vulkan_anv__gem.c) = b8eb487fa704151e7c3c3b1d23973b2b0aa5922e
 SHA1 (patch-src_intel_vulkan_anv__gem__stubs.c) = 7f0a25e96624815ef0912024b52bbb512d4fa42f
 SHA1 (patch-src_intel_vulkan_anv__queue.c) = 2dbf7dfd0c77f74f510032bf8d12109f58c50a30
 SHA1 (patch-src_mapi_entry__x86-64__tls.h) = 11b7ef1da435fa17fc7025a46a123d447d6a7d07
 SHA1 (patch-src_mapi_entry__x86__tls.h) = 11c0f5302d305a77f3a1780d44a2c61f48a66273
+SHA1 (patch-src_mapi_entry__x86__tsd.h) = aeb27a8dddfcc07404ff1750f118a8b1acdbf44d
 SHA1 (patch-src_mapi_glapi_gen_gl__gentable.py) = 0b1d4ef3f78a9b3726ef7f9921608a48a5e4ac56
 SHA1 (patch-src_mapi_u__current.c) = 38d324fcd1c28d155106ccd248edb5eb1aa9ffac
 SHA1 (patch-src_mapi_u__current.h) = 465a992bd34057e9521f0a33e6f2e25cefc145ca
 SHA1 (patch-src_mesa_drivers_dri_i915_intel__screen.c) = e33f51b3502e8c52ff7283aeb807996717f79f4f
 SHA1 (patch-src_mesa_drivers_dri_i965_brw__bufmgr.c) = 7a6edf46b9364bcdb2dbe8d70a2e6a1d0610dc40
 SHA1 (patch-src_mesa_drivers_dri_i965_brw__performance__query.c) = 9579ab29e0a913aa0516665e72a8573097932312
-SHA1 (patch-src_mesa_drivers_dri_i965_intel__screen.c) = 639d0d2680a98dd5213dfadf608468de6ac54c20
+SHA1 (patch-src_mesa_drivers_dri_i965_intel__screen.c) = 45b78c9fd65449f575683fb5d032b900569b5226
 SHA1 (patch-src_mesa_drivers_dri_swrast_swrast.c) = 3106f350e590f62c8bd29cd85f24f977639dccdb
 SHA1 (patch-src_mesa_drivers_x11_Makefile.am) = 172a8da11a620edce790f64338a0390cd1e93188
 SHA1 (patch-src_mesa_main_context.c) = 74226013b56ad6c9678f1970458538b35967678f
@@ -72,10 +77,10 @@ SHA1 (patch-src_mesa_x86_common__x86.c) = f8c4b93443ef66d017f6aa114b877565b30f25
 SHA1 (patch-src_util_Makefile.am) = e390cd47b784ad08987b81fdbce537968ad4a624
 SHA1 (patch-src_util_build__id.c) = fee28ddf5c91208492efcfdebf32e0cfef35502d
 SHA1 (patch-src_util_disk__cache.c) = cc0b29780dba5d5b5e43c0798336f16a1f0008de
-SHA1 (patch-src_util_os__time.c) = 0cdeec38dbb09700f4cfaa075f865e2a617daf31
+SHA1 (patch-src_util_os__time.c) = d33f0cbdfc5a09661f906aab5feda0b0c70f2f48
 SHA1 (patch-src_util_ralloc.c) = d311bfd9ed7e673d72e050668d351c1e6552cdc8
 SHA1 (patch-src_util_strndup.h) = 73f49694ca48ad6b9a9d8346c5b84fddec2463bd
 SHA1 (patch-src_util_u__atomic.h) = 31d4514538ef5ee53012695eb5c66134aaec981e
 SHA1 (patch-src_util_u__queue.c) = ed1ea3f6fc37e9a64894a3e865c48691b6e01b2c
-SHA1 (patch-src_util_u__thread.h) = 1c0d6ea3638e79bb437843e96cfe6786a9616b7b
+SHA1 (patch-src_util_u__thread.h) = e3b21072ad1d4935a4d818980639b0a3f0b406ef
 SHA1 (patch-src_util_xmlconfig.c) = fa0cfe2e1348dfb5e91f9c20aae3c43eee1998b5
diff --git a/MesaLib-dfbsd-meson/options.mk b/MesaLib-dfbsd-meson/options.mk
index 7b0fae8221..805924ce0e 100644
--- a/MesaLib-dfbsd-meson/options.mk
+++ b/MesaLib-dfbsd-meson/options.mk
@@ -14,12 +14,21 @@ PKG_SUPPORTED_OPTIONS+=		noatexit
 PKG_SUPPORTED_OPTIONS+=		iris
 PKG_SUGGESTED_OPTIONS+=		iris
 PKG_SUPPORTED_OPTIONS+=		vulkan
+
+PKG_SUPPORTED_OPTIONS+=		no_render_node
+PKG_SUPPORTED_OPTIONS+=		use_clock_nanosleep_os_time
+PKG_SUPPORTED_OPTIONS+=		use_pthread_getcpuclockid
 PKG_SUPPORTED_OPTIONS+=		no_cs_queue
 PKG_SUPPORTED_OPTIONS+=		revert_threaded_context
 PKG_SUPPORTED_OPTIONS+=		revert_copy_clear
 PKG_SUPPORTED_OPTIONS+=		revert_i965_softpin
 PKG_SUPPORTED_OPTIONS+=		revert_sdma_uploader
+PKG_SUPPORTED_OPTIONS+=		require_36_gen4
 PKG_SUPPORTED_OPTIONS+=		invert_atomic_add_unless
+PKG_SUPPORTED_OPTIONS+=		physmem_netbsd
+PKG_SUPPORTED_OPTIONS+=		strict_netbsd
+PKG_SUPPORTED_OPTIONS+=		x86_tsd_openbsd
+PKG_SUPPORTED_OPTIONS+=		so_name_openbsd
 
 # PKG_SUGGESTED_OPTIONS+=		xvmc
 PKG_SUGGESTED_OPTIONS+=		vdpau vaapi
@@ -60,6 +69,21 @@ PKG_SUGGESTED_OPTIONS+=		dri
 PKG_SUGGESTED_OPTIONS+=		glx-tls
 .endif
 
+# Revert patch removing support for no dedicated render nodes
+.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly" || ${OPSYS} == "NetBSD"
+PKG_SUGGESTED_OPTIONS+=		no_render_node
+.endif
+
+# Use clock_nanosleep() in os_time.c
+.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly" || ${OPSYS} == "NetBSD"
+PKG_SUGGESTED_OPTIONS+=		use_clock_nanosleep_os_time
+.endif
+
+# pthread_getcpuclockid only in NetBSD 8+
+.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly" || ${OPSYS} == "NetBSD"
+PKG_SUGGESTED_OPTIONS+=		use_pthread_getcpuclockid
+.endif
+
 .if ${OPSYS} == "NetBSD"
 PKG_SUGGESTED_OPTIONS+=		no_cs_queue
 PKG_SUGGESTED_OPTIONS+=		revert_threaded_context
@@ -71,8 +95,32 @@ PKG_SUGGESTED_OPTIONS+=		revert_i965_softpin
 PKG_SUGGESTED_OPTIONS+=		revert_sdma_uploader
 .endif
 
-.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
-PKG_SUGGESTED_OPTIONS+=		invert_atomic_add_unless
+# Require Linux 3.6+ intel support for ge4+
+.if ${OPSYS} == "FreeBSD"
+PKG_SUGGESTED_OPTIONS+=		require_36_gen4
+.endif
+
+# Causes segfault in mpv on DragonFly intel EagleLake machine
+# .if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
+# PKG_SUGGESTED_OPTIONS+=		invert_atomic_add_unless
+# .endif
+
+.if ${OPSYS} == "NetBSD"
+PKG_SUGGESTED_OPTIONS+=		physmem_netbsd
+.endif
+
+.if ${OPSYS} == "NetBSD"
+PKG_SUGGESTED_OPTIONS+=		strict_netbsd
+.endif
+
+# OpenBSD xenocara tsd dispatch assembly for entry_x86_tsd.h
+.if ${OPSYS} == "OpenBSD"
+PKG_SUGGESTED_OPTIONS+=		x86_tsd_openbsd
+.endif
+
+# Shorten names dlopened to libGL.so and libglapi.so
+.if ${OPSYS} == "OpenBSD"
+PKG_SUGGESTED_OPTIONS+=		so_name_openbsd
 .endif
 
 .include "../../mk/bsd.options.mk"
@@ -137,11 +185,13 @@ MESON_ARGS+=		-Dgles2=false
 # Recommended by
 # http://www.freedesktop.org/wiki/Software/Glamor/
 CONFIGURE_ARGS+=	--enable-glx-tls
+MESON_ARGS+=		-Dglx-tls=true
 .else
 # (EE) Failed to load /usr/pkg/lib/xorg/modules/extensions/libglx.so:
 # /usr/pkg/lib/libGL.so.1: Use of initialized Thread Local Storage with model
 # initial-exec and dlopen is not supported
 CONFIGURE_ARGS+=	--disable-glx-tls
+MESON_ARGS+=		-Dglx-tls=false
 .endif # glx-tls
 
 # DRI on Linux needs either sysfs or udev
@@ -389,6 +439,18 @@ MESON_ARGS+=		-Dgallium-xvmc=false
 CPPFLAGS+=	-DHAVE_NOATEXIT
 .endif
 
+.if !empty(PKG_OPTIONS:Mno_render_node)
+CPPFLAGS+=	-DNO_RENDER_NODE
+.endif
+
+.if !empty(PKG_OPTIONS:Muse_clock_nanosleep_os_time)
+CPPFLAGS+=	-DUSE_CLOCK_NANOSLEEP_OS_TIME
+.endif
+
+.if !empty(PKG_OPTIONS:Muse_pthread_getcpuclockid)
+CPPFLAGS+=	-DUSE_PTHREAD_GETCPUCLOCKID
+.endif
+
 .if !empty(PKG_OPTIONS:Mno_cs_queue)
 CPPFLAGS+=	-DNO_CS_QUEUE
 .endif
@@ -409,6 +471,26 @@ CPPFLAGS+=	-DREVERT_I965_SOFTPIN
 CPPFLAGS+=	-DREVERT_SDMA_UPLOADER
 .endif
 
+.if !empty(PKG_OPTIONS:Mrequire_36_gen4)
+CPPFLAGS+=	-DREQUIRE_36_GEN4
+.endif
+
 .if !empty(PKG_OPTIONS:Minvert_atomic_add_unless)
 CPPFLAGS+=	-DINVERT_ATOMIC_ADD_UNLESS
 .endif
+
+.if !empty(PKG_OPTIONS:Mphysmem_netbsd)
+CPPFLAGS+=	-DPHYSMEM_NETBSD
+.endif
+
+.if !empty(PKG_OPTIONS:Mstrict_netbsd)
+CPPFLAGS+=	-DSTRICT_NETBSD
+.endif
+
+.if !empty(PKG_OPTIONS:Mx86_tsd_openbsd)
+CPPFLAGS+=	-DX86_TSD_OPENBSD
+.endif
+
+.if !empty(PKG_OPTIONS:Mso_name_openbsd)
+CPPFLAGS+=	-DSO_NAME_OPENBSD
+.endif
diff --git a/MesaLib-dfbsd-meson/patches/patch-meson.build b/MesaLib-dfbsd-meson/patches/patch-meson.build
new file mode 100644
index 0000000000..a0bcb1bae9
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-meson.build
@@ -0,0 +1,24 @@
+$NetBSD$
+
+--- meson.build.orig	2019-03-06 23:05:20.000000000 +0000
++++ meson.build
+@@ -50,6 +50,7 @@ with_tests = get_option('build-tests')
+ with_valgrind = get_option('valgrind')
+ with_libunwind = get_option('libunwind')
+ with_asm = get_option('asm')
++with_glx_tls = get_option('glx-tls')
+ with_glx_read_only_text = get_option('glx-read-only-text')
+ with_glx_direct = get_option('glx-direct')
+ with_osmesa = get_option('osmesa')
+@@ -338,7 +339,10 @@ if with_egl and not (with_platform_drm o
+   endif
+ endif
+ 
+-pre_args += '-DGLX_USE_TLS'
++if with_glx_tls
++  pre_args += '-DGLX_USE_TLS'
++endif
++
+ if with_glx != 'disabled'
+   if not (with_platform_x11 and with_any_opengl)
+     error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
diff --git a/MesaLib-dfbsd-meson/patches/patch-meson__options.txt b/MesaLib-dfbsd-meson/patches/patch-meson__options.txt
new file mode 100644
index 0000000000..c5b1045103
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-meson__options.txt
@@ -0,0 +1,17 @@
+$NetBSD$
+
+--- meson_options.txt.orig	2019-03-06 23:05:20.000000000 +0000
++++ meson_options.txt
+@@ -212,6 +212,12 @@ option(
+   description : 'Build support for GLX platform'
+ )
+ option(
++  'glx-tls',
++  type : 'boolean',
++  value : true,
++  description : 'Enable TLS (Thread Local Storage) support in GLX',
++)
++option(
+   'egl',
+   type : 'combo',
+   value : 'auto',
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
index d9d3b98897..49110fbb10 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
@@ -31,7 +31,7 @@ v2: Clarify the linking topic in the commit message.
     return ret;
  }
  
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__NetBSD__)
++#if defined(NO_RENDER_NODE)
 +static int
 +open_drm_minor(int minor)
 +{
@@ -48,7 +48,7 @@ v2: Clarify the linking topic in the commit message.
  int
  pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
  {
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__NetBSD__)
++#if defined(NO_RENDER_NODE)
 +   int i, k, fd, num_render_node_devs;
 +   int j = 0;
 +
@@ -68,7 +68,7 @@ v2: Clarify the linking topic in the commit message.
           continue;
        }
  
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__NetBSD__)
++#if defined(NO_RENDER_NODE)
 +      render_node_devs[j].vendor_id = dev->u.pci.vendor_id;
 +      render_node_devs[j].chip_id = dev->u.pci.chip_id;
 +
@@ -80,7 +80,7 @@ v2: Clarify the linking topic in the commit message.
        j++;
     }
  
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__NetBSD__)
++#if defined(NO_RENDER_NODE)
 +   num_render_node_devs = j;
 +
 +   /* Next look for drm devices. */
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gbm_backends_dri_gbm__dri.c b/MesaLib-dfbsd-meson/patches/patch-src_gbm_backends_dri_gbm__dri.c
new file mode 100644
index 0000000000..22bd5a005b
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_gbm_backends_dri_gbm__dri.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- src/gbm/backends/dri/gbm_dri.c.orig	2019-03-06 23:05:20.000000000 +0000
++++ src/gbm/backends/dri/gbm_dri.c
+@@ -302,7 +302,11 @@ dri_open_driver(struct gbm_dri_device *d
+    /* XXX: Library name differs on per platforms basis. Update this as
+     * osx/cygwin/windows/bsd gets support for GBM..
+     */
++#if defined(SO_NAME_OPENBSD)
++   dlopen("libglapi.so", RTLD_LAZY | RTLD_GLOBAL);
++#else
+    dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL);
++#endif
+ 
+    static const char *search_path_vars[] = {
+       /* Read GBM_DRIVERS_PATH first for compatibility, but LIBGL_DRIVERS_PATH
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_glx_dri__common.c b/MesaLib-dfbsd-meson/patches/patch-src_glx_dri__common.c
new file mode 100644
index 0000000000..75e23d0c38
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_glx_dri__common.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- src/glx/dri_common.c.orig	2019-03-06 23:05:20.000000000 +0000
++++ src/glx/dri_common.c
+@@ -73,6 +73,10 @@ dri_message(int level, const char *f, ..
+    }
+ }
+ 
++#if defined(SO_NAME_OPENBSD)
++#define GL_LIB_NAME "libGL.so"
++#endif
++
+ #ifndef GL_LIB_NAME
+ #define GL_LIB_NAME "libGL.so.1"
+ #endif
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__device.c b/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__device.c
index 1a5cad3462..0a31d5c8d0 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__device.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__device.c
@@ -10,7 +10,7 @@ https://reviews.freebsd.org/D17872
 
 * Define CLOCK_MONOTONIC_RAW if missing
 
---- src/intel/vulkan/anv_device.c.orig	2019-02-02 23:08:03.000000000 +0000
+--- src/intel/vulkan/anv_device.c.orig	2019-03-13 03:11:55.000000000 +0000
 +++ src/intel/vulkan/anv_device.c
 @@ -25,7 +25,9 @@
  #include <stdbool.h>
@@ -22,9 +22,9 @@ https://reviews.freebsd.org/D17872
  #include <unistd.h>
  #include <fcntl.h>
  #include <xf86drm.h>
-@@ -44,6 +46,17 @@
- 
- #include "genxml/gen7_pack.h"
+@@ -49,6 +51,17 @@
+  */
+ #define MAX_DEBUG_MESSAGE_LENGTH    4096
  
 +#ifndef ETIME
 +#define ETIME ETIMEDOUT
@@ -39,8 +39,8 @@ https://reviews.freebsd.org/D17872
 +
  static void
  compiler_debug_log(void *data, const char *fmt, ...)
- { }
-@@ -64,10 +77,18 @@ static uint64_t
+ {
+@@ -85,10 +98,18 @@ static uint64_t
  anv_compute_heap_size(int fd, uint64_t gtt_size)
  {
     /* Query the total ram from the system */
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86__tsd.h b/MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86__tsd.h
new file mode 100644
index 0000000000..85b434e3f9
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86__tsd.h
@@ -0,0 +1,77 @@
+$NetBSD$
+
+--- src/mapi/entry_x86_tsd.h.orig	2019-03-06 23:05:20.000000000 +0000
++++ src/mapi/entry_x86_tsd.h
+@@ -31,18 +31,51 @@
+ #define HIDDEN
+ #endif
+ 
++#if defined(X86_TSD_OPENBSD)
++#define X86_ENTRY_SIZE 64
++#else
+ #define X86_ENTRY_SIZE 32
++#endif
+ 
+ __asm__(".text\n"
++#if defined(X86_TSD_OPENBSD)
++        ".balign " U_STRINGIFY(X86_ENTRY_SIZE) "\n"
++#else
+         ".balign 32\n"
++#endif
+         "x86_entry_start:");
+ 
++
++#if defined(X86_TSD_OPENBSD)
++#define STUB_ASM_ENTRY(func)        \
++   ".globl " func "\n"              \
++   ".type " func ", @function\n"    \
++   ".balign " U_STRINGIFY(X86_ENTRY_SIZE) "\n" \
++   func ":"
++#else
+ #define STUB_ASM_ENTRY(func)        \
+    ".globl " func "\n"              \
+    ".type " func ", @function\n"    \
+    ".balign 32\n"                   \
+    func ":"
++#endif
+ 
++#if defined(X86_TSD_OPENBSD)
++#define STUB_ASM_CODE(slot)         \
++   "push %ebx\n\t"                  \
++   "call 1f\n"                      \
++   "1:\n\t"                         \
++   "popl %ebx\n\t"                  \
++   "addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx\n\t" \
++   "movl " ENTRY_CURRENT_TABLE "@GOT(%ebx), %eax\n\t" \
++   "mov (%eax), %eax\n\t"           \
++   "testl %eax, %eax\n\t"           \
++   "jne 1f\n\t"                     \
++   "call " ENTRY_CURRENT_TABLE_GET "@PLT\n" \
++   "1:\n\t"                         \
++   "pop %ebx\n\t"                   \
++   "jmp *(4 * " slot ")(%eax)"
++#else
+ #define STUB_ASM_CODE(slot)         \
+    "movl " ENTRY_CURRENT_TABLE ", %eax\n\t" \
+    "testl %eax, %eax\n\t"           \
+@@ -51,14 +84,20 @@ __asm__(".text\n"
+    "1:\n\t"                         \
+    "call " ENTRY_CURRENT_TABLE_GET "\n\t" \
+    "jmp *(4 * " slot ")(%eax)"
++#endif
+ 
+ #define MAPI_TMP_STUB_ASM_GCC
+ #include "mapi_tmp.h"
+ 
+ #ifndef MAPI_MODE_BRIDGE
+ 
++#if defined(X86_TSD_OPENBSD)
++__asm__(".balign " U_STRINGIFY(X86_ENTRY_SIZE) "\n"
++        "x86_entry_end:");
++#else
+ __asm__(".balign 32\n"
+         "x86_entry_end:");
++#endif
+ 
+ #include <string.h>
+ #include "u_execmem.h"
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_intel__screen.c b/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_intel__screen.c
index d8f7aff9f4..2832c366f7 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_intel__screen.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_intel__screen.c
@@ -65,7 +65,7 @@ See kernel commit 172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+.
        return false;
     }
  
-+#if defined(__FreeBSD__)
++#if defined(REQUIRE_36_GEN4)
 +   if (!intel_get_boolean(screen, I915_PARAM_HAS_RELAXED_DELTA)) {
 +      fprintf(stderr, "[%s: %u] Kernel 2.6.39 required.\n", __func__, __LINE__);
 +      return false;
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_os__time.c b/MesaLib-dfbsd-meson/patches/patch-src_util_os__time.c
index 24699ad3d3..07a3d4cb03 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_os__time.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_util_os__time.c
@@ -12,7 +12,7 @@ https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
  os_time_sleep(int64_t usecs)
  {
 -#if defined(PIPE_OS_LINUX)
-+#if (defined(HAVE_CLOCK_NANOSLEEP) && (defined(__FreeBSD__) || defined(__DragonFly__))) || defined(PIPE_OS_LINUX)
++#if (defined(HAVE_CLOCK_NANOSLEEP) && defined(USE_CLOCK_NANOSLEEP_OS_TIME)) || defined(PIPE_OS_LINUX)
     struct timespec time;
     time.tv_sec = usecs / 1000000;
     time.tv_nsec = (usecs % 1000000) * 1000;
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h b/MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h
index 115954f246..f716a13c7e 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h
+++ b/MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h
@@ -109,7 +109,7 @@ https://reviews.freebsd.org/D17872
  u_thread_get_time_nano(thrd_t thread)
  {
 -#if defined(__linux__) && defined(HAVE_PTHREAD)
-+#if (defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__)) && defined(HAVE_PTHREAD)
++#if (defined(__linux__) || defined(USE_PTHREAD_GETCPUCLOCKID)) && defined(HAVE_PTHREAD)
     struct timespec ts;
     clockid_t cid;
  


Home | Main Index | Thread Index | Old Index