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 to 2019-03-25 git



Module Name:	pkgsrc-wip
Committed By:	David Shao <davshao%gmail.com@localhost>
Pushed By:	dshao
Date:		Tue Mar 26 19:24:25 2019 -0700
Changeset:	85f44c8858a1d4c87367f622ad2a30f68dbdf364

Modified Files:
	MesaLib-dfbsd-meson/Makefile
	MesaLib-dfbsd-meson/distinfo
	MesaLib-dfbsd-meson/options.mk
	MesaLib-dfbsd-meson/patches/patch-meson.build
	MesaLib-dfbsd-meson/patches/patch-src_amd_vulkan_radv__device.c
	MesaLib-dfbsd-meson/patches/patch-src_compiler_builtin__type__macros.h
	MesaLib-dfbsd-meson/patches/patch-src_egl_main_eglglobals.c
	MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i915_intel__screen.c
	MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_intel__screen.c
	MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_swrast_swrast.c
	MesaLib-dfbsd-meson/patches/patch-src_mesa_main_context.c
	MesaLib-dfbsd-meson/patches/patch-src_util_u__queue.c
	MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h
Added Files:
	MesaLib-dfbsd-meson/patch-src_compiler_glsl_glsl__parser__extras.cpp
	MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_rtasm_rtasm__execmem.c
	MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_i915_i915__fpc__translate.c
	MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__line.c
	MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__point.c
	MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__tri.c
	MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_meson.build
	MesaLib-dfbsd-meson/patches/patch-src_mapi_u__execmem.c
	MesaLib-dfbsd-meson/patches/patch-src_mesa_main_execmem.c
	MesaLib-dfbsd-meson/patches/patch-src_util_ralloc.h
	MesaLib-dfbsd-meson/patches/patch-src_util_u__process.c
Removed Files:
	MesaLib-dfbsd-meson/patches/patch-src_compiler_glsl_glsl__parser__extras.cpp

Log Message:
MesaLib-dfbsd-meson: Update wip/MesaLib-dfbsd-meson to 2019-03-25 git

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

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

diffstat:
 MesaLib-dfbsd-meson/Makefile                       | 12 ++---
 MesaLib-dfbsd-meson/distinfo                       | 39 ++++++++++-------
 MesaLib-dfbsd-meson/options.mk                     | 36 +++++++++++++--
 ...atch-src_compiler_glsl_glsl__parser__extras.cpp | 18 ++++++++
 MesaLib-dfbsd-meson/patches/patch-meson.build      | 26 ++++++++++-
 .../patches/patch-src_amd_vulkan_radv__device.c    |  4 +-
 .../patch-src_compiler_builtin__type__macros.h     |  2 +-
 ...atch-src_compiler_glsl_glsl__parser__extras.cpp | 18 --------
 .../patches/patch-src_egl_main_eglglobals.c        | 19 +++++---
 ...ch-src_gallium_auxiliary_rtasm_rtasm__execmem.c | 35 +++++++++++++++
 ...src_gallium_drivers_i915_i915__fpc__translate.c | 16 +++++++
 ...-src_gallium_drivers_llvmpipe_lp__setup__line.c | 28 ++++++++++++
 ...src_gallium_drivers_llvmpipe_lp__setup__point.c | 28 ++++++++++++
 ...h-src_gallium_drivers_llvmpipe_lp__setup__tri.c | 28 ++++++++++++
 .../patch-src_gallium_drivers_nouveau_meson.build  | 13 ++++++
 .../patches/patch-src_mapi_u__execmem.c            | 30 +++++++++++++
 ...patch-src_mesa_drivers_dri_i915_intel__screen.c |  4 +-
 ...patch-src_mesa_drivers_dri_i965_intel__screen.c |  4 +-
 .../patch-src_mesa_drivers_dri_swrast_swrast.c     |  2 +-
 .../patches/patch-src_mesa_main_context.c          | 24 +++++++---
 .../patches/patch-src_mesa_main_execmem.c          | 26 +++++++++++
 .../patches/patch-src_util_ralloc.h                | 51 ++++++++++++++++++++++
 .../patches/patch-src_util_u__process.c            | 13 ++++++
 .../patches/patch-src_util_u__queue.c              |  6 ++-
 .../patches/patch-src_util_u__thread.h             | 20 ++++-----
 25 files changed, 423 insertions(+), 79 deletions(-)

diffs:
diff --git a/MesaLib-dfbsd-meson/Makefile b/MesaLib-dfbsd-meson/Makefile
index fea21469eb..db865dadc9 100644
--- a/MesaLib-dfbsd-meson/Makefile
+++ b/MesaLib-dfbsd-meson/Makefile
@@ -1,13 +1,13 @@
 # $NetBSD: Makefile,v 1.18 2019/02/22 15:40:35 tnn Exp $
 
-# 2019-03-14	st/mesa: Let NIR lower UBO and SSBO access when we have it
-COMMIT_ID=	efa4fc0ebd96b3fbcf30550494251307f11dc7b9
+# 2019-03-25	freedreno/ir3: Fix operand order for DSX/DSY
+COMMIT_ID=	c7c432738a68d543dc1b73eae895ec4dfacd92b2
 
-# 2019-03-13	anv/pass: Flag the need for a RT flush for resolve attachments
-# COMMIT_ID=	489bf2de237a190b966a412efda89d12d1daacde
+# 2019-03-23	spirv: Add an execution environment to the options
+# COMMIT_ID=	15012077bceda24cbf38afeda7723c47e1b0d3c3
 
-# 2019-03-12	intel/fs: Fix opt_peephole_csel to not throw away saturates.
-# COMMIT_ID=	3570d15b6d88bdcd353b31ffe5460d04a88b7b6f
+# 2019-03-22	docs: update freedreno status
+# COMMIT_ID=	cdd90a7502e501b0f25d35a2e9715fbe5d09a211
 
 PORTNAME=	mesa		
 
diff --git a/MesaLib-dfbsd-meson/distinfo b/MesaLib-dfbsd-meson/distinfo
index aed0758ffb..36287d9f5d 100644
--- a/MesaLib-dfbsd-meson/distinfo
+++ b/MesaLib-dfbsd-meson/distinfo
@@ -1,27 +1,32 @@
 $NetBSD: distinfo,v 1.16 2019/02/22 15:40:35 tnn Exp $
 
-SHA1 (mesa-efa4fc0ebd96b3fbcf30550494251307f11dc7b9.tar.xz) = e02fdc77d5fcb961e0152b63a21e3002cbcbe110
-RMD160 (mesa-efa4fc0ebd96b3fbcf30550494251307f11dc7b9.tar.xz) = 5d266db0c2f7d664a1c83badafb5df0ca558ada0
-SHA512 (mesa-efa4fc0ebd96b3fbcf30550494251307f11dc7b9.tar.xz) = b586501dc0fac2025d434b12a475d635a6c9ccd3d0216d0af42f5be8e27a63e3d663e9b70e54d8b53ada940bdb58b808c2eef59983c2c0280ed4f1a90f3c014d
-Size (mesa-efa4fc0ebd96b3fbcf30550494251307f11dc7b9.tar.xz) = 10708724 bytes
+SHA1 (mesa-c7c432738a68d543dc1b73eae895ec4dfacd92b2.tar.xz) = d404bfdc44e9d2d27f8d5712e22d17f2f63cd95c
+RMD160 (mesa-c7c432738a68d543dc1b73eae895ec4dfacd92b2.tar.xz) = 5fc24264fd837d6704c619698bc62d27c17728aa
+SHA512 (mesa-c7c432738a68d543dc1b73eae895ec4dfacd92b2.tar.xz) = dac5ac188960777e890a3a4eb3c2fb0b5db45bd91cbf4bcbbf6bdd50f8ecc1a82acbbd00e94bb843caa4b2f8d1175757df9404940e5c788660fb14502d2d87d5
+Size (mesa-c7c432738a68d543dc1b73eae895ec4dfacd92b2.tar.xz) = 10743812 bytes
 SHA1 (patch-configure.ac) = cddca44dbf1e2f447dd30a03440104920d6c24ab
 SHA1 (patch-include_GL_internal_dri__interface.h) = 76803a4ab6ff7e596900a0099dd9712093f8bc21
-SHA1 (patch-meson.build) = 1d90d3b14c8569f2c9a7c5bda506ed464365f7a3
+SHA1 (patch-meson.build) = 3cd30902cd5af7bc860dd2984a51d9ebf051662e
 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_radv__device.c) = cfa96ee44291d7d5ac62090b1fc07d66547d17a8
 SHA1 (patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c) = 1fe81a7b16e36dc9125400c20543271216a33a45
-SHA1 (patch-src_compiler_builtin__type__macros.h) = 857bca0c0f55ec8d7a20b3807c7a5d7bd06bdfbf
-SHA1 (patch-src_compiler_glsl_glsl__parser__extras.cpp) = ef114d6e288e6d212fce9d1c0606f7d454a171c4
+SHA1 (patch-src_compiler_builtin__type__macros.h) = 128030d0c532e5f3982dc6ebde1957fc0ca7f5d5
 SHA1 (patch-src_egl_drivers_dri2_platform__drm.c) = e18e7b1ffbc74b8acf3d9095a92c750f9d005479
 SHA1 (patch-src_egl_drivers_dri2_platform__x11.c) = 49e48c31eacb79d1da357fe70eaffd2926b5280e
-SHA1 (patch-src_egl_main_eglglobals.c) = 0d52014f52e62fc5fa6650336ddb0011ecf331e6
+SHA1 (patch-src_egl_main_eglglobals.c) = 1b723fb03c13e267b23e7cb94b2f19c2bfa03be5
 SHA1 (patch-src_gallium_auxiliary_drivers_trace_tr__dump.c) = 360e1608508a7bbb41acecd58930781038e2309e
 SHA1 (patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c) = 14f0511191ef468a39e3248d44f7dbdffa554547
+SHA1 (patch-src_gallium_auxiliary_rtasm_rtasm__execmem.c) = 1c1e0f02f247cd2322f19f10e67d61cf56e65487
 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_i915_i915__fpc__translate.c) = 1c69741c2c9285569c6326d8d29d5af936e1929a
 SHA1 (patch-src_gallium_drivers_iris_iris__bufmgr.c) = d6ead77d93ade4beada1625cb09c40362fb0b3f0
 SHA1 (patch-src_gallium_drivers_iris_meson.build) = 9b94ae7047763cc4b1be5b39a3d9cac898e10f65
+SHA1 (patch-src_gallium_drivers_llvmpipe_lp__setup__line.c) = bc049154cbfb788855ad6675a339ef07b15cd573
+SHA1 (patch-src_gallium_drivers_llvmpipe_lp__setup__point.c) = f6a2c5940010cd93f955c969616af7a7c550fab4
+SHA1 (patch-src_gallium_drivers_llvmpipe_lp__setup__tri.c) = 430fdde0943074c0b4cfeaebe5b7e3c930c6bcf3
+SHA1 (patch-src_gallium_drivers_nouveau_meson.build) = 59de3f012f604ae185d90c5c64521f35580eaa00
 SHA1 (patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c) = 04f95784c3270c9bb7e95377982e217962481525
 SHA1 (patch-src_gallium_drivers_nouveau_nv50_nv84__video.c) = 1b4239fe053523835ecac006894bdb0cde0ee626
 SHA1 (patch-src_gallium_drivers_radeonsi_si__buffer.c) = dc2dcb0f87a01ae0162a8c5746911c53e669cd2e
@@ -63,13 +68,15 @@ SHA1 (patch-src_mapi_entry__x86__tsd.h) = aeb27a8dddfcc07404ff1750f118a8b1acdbf4
 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_mapi_u__execmem.c) = 3b448405aeea0b17cfa58e8fe66708467b6eeb8a
+SHA1 (patch-src_mesa_drivers_dri_i915_intel__screen.c) = fb9324dcbc8ffbc00bee6aedcc38db2e94b24f9d
 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) = 45b78c9fd65449f575683fb5d032b900569b5226
-SHA1 (patch-src_mesa_drivers_dri_swrast_swrast.c) = 3106f350e590f62c8bd29cd85f24f977639dccdb
+SHA1 (patch-src_mesa_drivers_dri_i965_intel__screen.c) = 1b5de370add6984fb44968c055b7d8d5a54417dd
+SHA1 (patch-src_mesa_drivers_dri_swrast_swrast.c) = 4c0ca7dec2398a15f77b643d0f86af41ca202be3
 SHA1 (patch-src_mesa_drivers_x11_Makefile.am) = 172a8da11a620edce790f64338a0390cd1e93188
-SHA1 (patch-src_mesa_main_context.c) = 74226013b56ad6c9678f1970458538b35967678f
+SHA1 (patch-src_mesa_main_context.c) = a7c796810104971e2fd76b15397d068e628f0a9e
+SHA1 (patch-src_mesa_main_execmem.c) = 4a0a790e648e63907454b78318c7edbecc11d02c
 SHA1 (patch-src_mesa_main_extensions.c) = 2f48bdb1176c2878bb33bcfab7556172b50a987e
 SHA1 (patch-src_mesa_main_macros.h) = c5dceaa8dc02a58e5b2273d82e3fe1cc12e327d3
 SHA1 (patch-src_mesa_main_shader__query.cpp) = 3f9c31645d87855759def11344dee16af23c7be3
@@ -79,8 +86,10 @@ SHA1 (patch-src_util_build__id.c) = fee28ddf5c91208492efcfdebf32e0cfef35502d
 SHA1 (patch-src_util_disk__cache.c) = cc0b29780dba5d5b5e43c0798336f16a1f0008de
 SHA1 (patch-src_util_os__time.c) = d33f0cbdfc5a09661f906aab5feda0b0c70f2f48
 SHA1 (patch-src_util_ralloc.c) = d311bfd9ed7e673d72e050668d351c1e6552cdc8
+SHA1 (patch-src_util_ralloc.h) = 56ff594c3f5aa450de14363735f4318864102214
 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) = e3b21072ad1d4935a4d818980639b0a3f0b406ef
+SHA1 (patch-src_util_u__process.c) = fb174c177d60ead65b22f00c88df59454c53c4ff
+SHA1 (patch-src_util_u__queue.c) = 17fb475e139d29ae27a54e6f6104d274e50226f7
+SHA1 (patch-src_util_u__thread.h) = 9155dc93d4401aae279e0134b7cd0dc1b53e39fd
 SHA1 (patch-src_util_xmlconfig.c) = fa0cfe2e1348dfb5e91f9c20aae3c43eee1998b5
diff --git a/MesaLib-dfbsd-meson/options.mk b/MesaLib-dfbsd-meson/options.mk
index 805924ce0e..5d0e1cf68d 100644
--- a/MesaLib-dfbsd-meson/options.mk
+++ b/MesaLib-dfbsd-meson/options.mk
@@ -26,9 +26,12 @@ 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+=		setaffinity_np_netbsd
+PKG_SUPPORTED_OPTIONS+=		strict_xsrc_netbsd
 PKG_SUPPORTED_OPTIONS+=		x86_tsd_openbsd
 PKG_SUPPORTED_OPTIONS+=		so_name_openbsd
+PKG_SUPPORTED_OPTIONS+=		disable_wx_memory
+PKG_SUPPORTED_OPTIONS+=		no_linear_alloc_destructor
 
 # PKG_SUGGESTED_OPTIONS+=		xvmc
 PKG_SUGGESTED_OPTIONS+=		vdpau vaapi
@@ -110,7 +113,11 @@ PKG_SUGGESTED_OPTIONS+=		physmem_netbsd
 .endif
 
 .if ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+=		strict_netbsd
+PKG_SUGGESTED_OPTIONS+=		setaffinity_np_netbsd
+.endif
+
+.if ${OPSYS} == "NetBSD"
+# PKG_SUGGESTED_OPTIONS+=		strict_xsrc_netbsd
 .endif
 
 # OpenBSD xenocara tsd dispatch assembly for entry_x86_tsd.h
@@ -123,6 +130,15 @@ PKG_SUGGESTED_OPTIONS+=		x86_tsd_openbsd
 PKG_SUGGESTED_OPTIONS+=		so_name_openbsd
 .endif
 
+# Disable code for init_heap for fear of W^X violation
+.if ${OPSYS} == "OpenBSD" || ${OPSYS} == "NetBSD"
+# PKG_SUGGESTED_OPTIONS+=		disable_wx_memory
+.endif
+
+.if ${OPSYS} == "OpenBSD" || ${OPSYS} == "NetBSD"
+# PKG_SUGGESTED_OPTIONS+=		no_linear_alloc_destructor
+.endif
+
 .include "../../mk/bsd.options.mk"
 
 # gallium
@@ -483,8 +499,12 @@ CPPFLAGS+=	-DINVERT_ATOMIC_ADD_UNLESS
 CPPFLAGS+=	-DPHYSMEM_NETBSD
 .endif
 
-.if !empty(PKG_OPTIONS:Mstrict_netbsd)
-CPPFLAGS+=	-DSTRICT_NETBSD
+.if !empty(PKG_OPTIONS:Msetaffinity_np_netbsd)
+CPPFLAGS+=	-DSETAFFINITY_NP_NETBSD
+.endif
+
+.if !empty(PKG_OPTIONS:Mstrict_xsrc_netbsd)
+CPPFLAGS+=	-DSTRICT_XSRC_NETBSD
 .endif
 
 .if !empty(PKG_OPTIONS:Mx86_tsd_openbsd)
@@ -494,3 +514,11 @@ CPPFLAGS+=	-DX86_TSD_OPENBSD
 .if !empty(PKG_OPTIONS:Mso_name_openbsd)
 CPPFLAGS+=	-DSO_NAME_OPENBSD
 .endif
+
+.if !empty(PKG_OPTIONS:Mdisable_wx_memory)
+CPPFLAGS+=	-DDISABLE_WX_MEMORY
+.endif
+
+.if !empty(PKG_OPTIONS:Mno_linear_alloc_destructor)
+CPPFLAGS+=	-DNO_LINEAR_ALLOC_DESTRUCTOR
+.endif
diff --git a/MesaLib-dfbsd-meson/patch-src_compiler_glsl_glsl__parser__extras.cpp b/MesaLib-dfbsd-meson/patch-src_compiler_glsl_glsl__parser__extras.cpp
new file mode 100644
index 0000000000..c926fe10a6
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patch-src_compiler_glsl_glsl__parser__extras.cpp
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_compiler_glsl_glsl__parser__extras.cpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
+
+atexit() is not a good idea in a library; use destructor attribute.
+
+--- src/compiler/glsl/glsl_parser_extras.cpp.orig	2017-09-25 16:56:18.000000000 +0000
++++ src/compiler/glsl/glsl_parser_extras.cpp
+@@ -2224,7 +2224,11 @@ extern "C" {
+  * programs would be invalid.  So this should happen at approximately
+  * program exit.
+  */
++#if defined(HAVE_NOATEXIT)
++void __attribute__((__destructor__))
++#else
+ void
++#endif
+ _mesa_destroy_shader_compiler(void)
+ {
+    _mesa_destroy_shader_compiler_caches();
diff --git a/MesaLib-dfbsd-meson/patches/patch-meson.build b/MesaLib-dfbsd-meson/patches/patch-meson.build
index 168588e60f..9c28e59102 100644
--- a/MesaLib-dfbsd-meson/patches/patch-meson.build
+++ b/MesaLib-dfbsd-meson/patches/patch-meson.build
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- meson.build.orig	2019-03-13 22:58:27.000000000 +0000
+--- meson.build.orig	2019-03-15 01:02:19.000000000 +0000
 +++ meson.build
 @@ -50,6 +50,7 @@ with_tests = get_option('build-tests')
  with_valgrind = get_option('valgrind')
@@ -22,7 +22,29 @@ $NetBSD$
  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')
-@@ -1098,7 +1102,15 @@ endif
+@@ -1011,7 +1015,7 @@ foreach h : ['xlocale.h', 'sys/sysctl.h'
+   endif
+ endforeach
+ 
+-foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create']
++foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create', 'open_memstream']
+   if cc.has_function(f)
+     pre_args += '-DHAVE_@0@'.format(f.to_upper())
+   endif
+@@ -1094,11 +1098,28 @@ else
+   dep_clock = cc.find_library('rt')
+ endif
+ 
++foreach g : ['clock_gettime', 'clock_nanotime']
++  if cc.has_function(
++      g,
++      dependencies : dep_clock,
++      prefix : '#include <time.h>')
++    pre_args += '-DHAVE_@0@'.format(g.to_upper())
++  endif
++endforeach
++
+ # TODO: some of these may be conditional
  dep_zlib = dependency('zlib', version : '>= 1.2.3')
  pre_args += '-DHAVE_ZLIB'
  dep_thread = dependency('threads')
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_amd_vulkan_radv__device.c b/MesaLib-dfbsd-meson/patches/patch-src_amd_vulkan_radv__device.c
index 024fc9d848..979589f425 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_amd_vulkan_radv__device.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_amd_vulkan_radv__device.c
@@ -4,11 +4,11 @@ From graphics/mesa-dri: update to 18.3.1
 
 https://reviews.freebsd.org/D17872
 
---- src/amd/vulkan/radv_device.c.orig	2018-12-11 21:13:57.000000000 +0000
+--- src/amd/vulkan/radv_device.c.orig	2019-03-22 20:39:14.000000000 +0000
 +++ src/amd/vulkan/radv_device.c
 @@ -50,6 +50,14 @@
- #include "util/debug.h"
  #include "util/mesa-sha1.h"
+ #include "compiler/glsl_types.h"
  
 +#ifndef CLOCK_MONOTONIC_RAW
 +# ifdef CLOCK_MONOTONIC_FAST
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_compiler_builtin__type__macros.h b/MesaLib-dfbsd-meson/patches/patch-src_compiler_builtin__type__macros.h
index 6e1063880a..b619541018 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_compiler_builtin__type__macros.h
+++ b/MesaLib-dfbsd-meson/patches/patch-src_compiler_builtin__type__macros.h
@@ -8,7 +8,7 @@ Workaround netbsd headers.
   * language version or extension might provide them.
   */
  
-+#ifdef __NetBSD__ /* XXX https://mail-index.netbsd.org/tech-userlevel/2018/09/08/msg011381.html */
++#if defined(__NetBSD__) && !defined(STRICT_XSRC_NETBSD) /* XXX https://mail-index.netbsd.org/tech-userlevel/2018/09/08/msg011381.html */
 +#undef uint8_t
 +#undef uint16_t
 +#undef uint32_t
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_compiler_glsl_glsl__parser__extras.cpp b/MesaLib-dfbsd-meson/patches/patch-src_compiler_glsl_glsl__parser__extras.cpp
deleted file mode 100644
index c926fe10a6..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_compiler_glsl_glsl__parser__extras.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_compiler_glsl_glsl__parser__extras.cpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-atexit() is not a good idea in a library; use destructor attribute.
-
---- src/compiler/glsl/glsl_parser_extras.cpp.orig	2017-09-25 16:56:18.000000000 +0000
-+++ src/compiler/glsl/glsl_parser_extras.cpp
-@@ -2224,7 +2224,11 @@ extern "C" {
-  * programs would be invalid.  So this should happen at approximately
-  * program exit.
-  */
-+#if defined(HAVE_NOATEXIT)
-+void __attribute__((__destructor__))
-+#else
- void
-+#endif
- _mesa_destroy_shader_compiler(void)
- {
-    _mesa_destroy_shader_compiler_caches();
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_egl_main_eglglobals.c b/MesaLib-dfbsd-meson/patches/patch-src_egl_main_eglglobals.c
index 26495a9f2f..6337d56798 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_egl_main_eglglobals.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_egl_main_eglglobals.c
@@ -5,14 +5,15 @@ atexit() is not a good idea in shared libraries.
 FreeBSD reported atexit bug for 10.6:
 https://bugs.freedesktop.org/show_bug.cgi?id=91869
 
---- src/egl/main/eglglobals.c.orig	2018-01-18 21:30:28.000000000 +0000
+--- src/egl/main/eglglobals.c.orig	2019-03-15 01:02:19.000000000 +0000
 +++ src/egl/main/eglglobals.c
-@@ -85,11 +85,22 @@ struct _egl_global _eglGlobal =
+@@ -93,11 +93,23 @@ struct _egl_global _eglGlobal =
     .debugTypesEnabled = _EGL_DEBUG_BIT_CRITICAL | _EGL_DEBUG_BIT_ERROR,
  };
  
 +#if defined(HAVE_NOATEXIT)
-+static EGLBoolean registered = EGL_FALSE;
++/* static EGLBoolean registered = EGL_FALSE; */
++static int add_atexit_called = 0;
  
 +static void __attribute__((__destructor__))
 +#else
@@ -23,24 +24,30 @@ https://bugs.freedesktop.org/show_bug.cgi?id=91869
     EGLint i;
 +
 +#if defined(HAVE_NOATEXIT)
-+   if (!registered)
++   if (!add_atexit_called)
 +      return;
 +#endif
 +
     for (i = _eglGlobal.NumAtExitCalls - 1; i >= 0; i--)
        _eglGlobal.AtExitCalls[i]();
  }
-@@ -99,14 +110,20 @@ void
+@@ -106,15 +118,26 @@ _eglAtExit(void)
+ void
  _eglAddAtExitCall(void (*func)(void))
  {
++#if 0
++   static EGLBoolean registered = EGL_FALSE;
++#endif
++
     if (func) {
-+#if !defined(HAVE_NOATEXIT)
++#if 1
        static EGLBoolean registered = EGL_FALSE;
 +#endif
  
        mtx_lock(_eglGlobal.Mutex);
  
 +#if defined(HAVE_NOATEXIT)
++      add_atexit_called = 1;
 +      registered = EGL_TRUE;
 +#else
        if (!registered) {
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_rtasm_rtasm__execmem.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_rtasm_rtasm__execmem.c
new file mode 100644
index 0000000000..61e6b3e912
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_rtasm_rtasm__execmem.c
@@ -0,0 +1,35 @@
+$NetBSD$
+
+Option from OpenBSD Xenocara
+
+Disable the code that allocates W|X memory.  There is fallback code that
+gets used if allocating W|X memory fails, which is probably a bit slower.
+However, that is much better than commit a W^X violation which currently
+gets you killed.
+
+--- src/gallium/auxiliary/rtasm/rtasm_execmem.c.orig	2019-03-15 01:02:19.000000000 +0000
++++ src/gallium/auxiliary/rtasm/rtasm_execmem.c
+@@ -68,6 +68,15 @@ static mtx_t exec_mutex = _MTX_INITIALIZ
+ static struct mem_block *exec_heap = NULL;
+ static unsigned char *exec_mem = NULL;
+ 
++#if defined(DISABLE_WX_MEMORY)
++
++static int
++init_heap(void)
++{
++   return 0;
++}
++
++#else /* !DISABLE_WX_MEMORY */
+ 
+ static int
+ init_heap(void)
+@@ -83,6 +92,7 @@ init_heap(void)
+    return (exec_mem != MAP_FAILED);
+ }
+ 
++#endif /* DISABLE_WX_MEMORY */
+ 
+ void *
+ rtasm_exec_malloc(size_t size)
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_i915_i915__fpc__translate.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_i915_i915__fpc__translate.c
new file mode 100644
index 0000000000..e00520e3b4
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_i915_i915__fpc__translate.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- src/gallium/drivers/i915/i915_fpc_translate.c.orig	2019-03-15 01:02:19.000000000 +0000
++++ src/gallium/drivers/i915/i915_fpc_translate.c
+@@ -1095,7 +1095,11 @@ i915_init_compile(struct i915_context *i
+    p->decl = p->declarations;
+    p->decl_s = 0;
+    p->decl_t = 0;
++#if defined(STRICT_XSRC_NETBSD)
++   p->temp_flag = ~0x0U << I915_MAX_TEMPORARY;
++#else
+    p->temp_flag = ~0x0 << I915_MAX_TEMPORARY;
++#endif
+    p->utemp_flag = ~0x7;
+ 
+    /* initialize the first program word */
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__line.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__line.c
new file mode 100644
index 0000000000..f2330956c4
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__line.c
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- src/gallium/drivers/llvmpipe/lp_setup_line.c.orig	2019-03-15 01:02:19.000000000 +0000
++++ src/gallium/drivers/llvmpipe/lp_setup_line.c
+@@ -724,7 +724,11 @@ try_setup_line( struct lp_setup_context 
+       struct lp_rast_plane *plane_s = &plane[4];
+ 
+       if (s_planes[0]) {
++#if defined(STRICT_XSRC_NETBSD)
++         plane_s->dcdx = ~0U << 8;
++#else
+          plane_s->dcdx = -1 << 8;
++#endif
+          plane_s->dcdy = 0;
+          plane_s->c = (1-scissor->x0) << 8;
+          plane_s->eo = 1 << 8;
+@@ -746,7 +750,11 @@ try_setup_line( struct lp_setup_context 
+       }
+       if (s_planes[3]) {
+          plane_s->dcdx = 0;
++#if defined(STRICT_XSRC_NETBSD)
++         plane_s->dcdy = ~0U << 8;
++#else
+          plane_s->dcdy = -1 << 8;
++#endif
+          plane_s->c = (scissor->y1+1) << 8;
+          plane_s->eo = 0;
+          plane_s++;
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__point.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__point.c
new file mode 100644
index 0000000000..af4713f049
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__point.c
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- src/gallium/drivers/llvmpipe/lp_setup_point.c.orig	2019-03-15 01:02:19.000000000 +0000
++++ src/gallium/drivers/llvmpipe/lp_setup_point.c
+@@ -491,7 +491,11 @@ try_setup_point( struct lp_setup_context
+    {
+       struct lp_rast_plane *plane = GET_PLANES(point);
+ 
++#if defined(STRICT_XSRC_NETBSD)
++      plane[0].dcdx = ~0U << 8;
++#else
+       plane[0].dcdx = -1 << 8;
++#endif
+       plane[0].dcdy = 0;
+       plane[0].c = (1-bbox.x0) << 8;
+       plane[0].eo = 1 << 8;
+@@ -507,7 +511,11 @@ try_setup_point( struct lp_setup_context
+       plane[2].eo = 1 << 8;
+ 
+       plane[3].dcdx = 0;
++#if defined(STRICT_XSRC_NETBSD)
++      plane[3].dcdy = ~0U << 8;
++#else
+       plane[3].dcdy = -1 << 8;
++#endif
+       plane[3].c = (bbox.y1+1) << 8;
+       plane[3].eo = 0;
+    }
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__tri.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__tri.c
new file mode 100644
index 0000000000..cf6ef61f2e
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_llvmpipe_lp__setup__tri.c
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- src/gallium/drivers/llvmpipe/lp_setup_tri.c.orig	2019-03-15 01:02:19.000000000 +0000
++++ src/gallium/drivers/llvmpipe/lp_setup_tri.c
+@@ -687,7 +687,11 @@ do_triangle_ccw(struct lp_setup_context 
+       struct lp_rast_plane *plane_s = &plane[3];
+ 
+       if (s_planes[0]) {
++#if defined(STRICT_XSRC_NETBSD)
++         plane_s->dcdx = ~0U << 8;
++#else
+          plane_s->dcdx = -1 << 8;
++#endif
+          plane_s->dcdy = 0;
+          plane_s->c = (1-scissor->x0) << 8;
+          plane_s->eo = 1 << 8;
+@@ -709,7 +713,11 @@ do_triangle_ccw(struct lp_setup_context 
+       }
+       if (s_planes[3]) {
+          plane_s->dcdx = 0;
++#if defined(STRICT_XSRC_NETBSD)
++         plane_s->dcdy = ~0U << 8;
++#else
+          plane_s->dcdy = -1 << 8;
++#endif
+          plane_s->c = (scissor->y1+1) << 8;
+          plane_s->eo = 0;
+          plane_s++;
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_meson.build b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_meson.build
new file mode 100644
index 0000000000..609315ceb6
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_meson.build
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/gallium/drivers/nouveau/meson.build.orig	2019-03-21 00:58:06.000000000 +0000
++++ src/gallium/drivers/nouveau/meson.build
+@@ -211,7 +211,7 @@ files_libnouveau = files(
+ 
+ libnouveau = static_library(
+   'nouveau',
+-  [files_libnouveau, nir_opcodes_h],
++  [files_libnouveau, nir_opcodes_h, nir_intrinsics_h],
+   include_directories : [
+     inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_common,
+   ],
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mapi_u__execmem.c b/MesaLib-dfbsd-meson/patches/patch-src_mapi_u__execmem.c
new file mode 100644
index 0000000000..c5daf8ca39
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_mapi_u__execmem.c
@@ -0,0 +1,30 @@
+$NetBSD$
+
+Option from OpenBSD xenocara
+
+2016-07-25
+
+Disable the code that allocates W|X memory.  There is fallback code that
+gets used if allocating W|X memory fails, which is probably a bit slower.
+However, that is much better than commit a W^X violation which currently
+gets you killed.
+
+--- src/mapi/u_execmem.c.orig	2019-03-23 16:29:21.000000000 +0000
++++ src/mapi/u_execmem.c
+@@ -45,8 +45,15 @@ static unsigned int head = 0;
+ 
+ static unsigned char *exec_mem = (unsigned char *)0;
+ 
++#if defined(DISABLE_WX_MEMORY)
+ 
+-#if defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun) || defined(__HAIKU__)
++static int
++init_map(void)
++{
++   return 0;
++}
++
++#elif defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun) || defined(__HAIKU__)
+ 
+ #include <unistd.h>
+ #include <sys/mman.h>
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i915_intel__screen.c b/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i915_intel__screen.c
index 50bd15a505..ebb4850734 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i915_intel__screen.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i915_intel__screen.c
@@ -13,7 +13,7 @@ Fix build on older NetBSD w/o _SC_PHYS_PAGES.
  #include <time.h>
  #include <unistd.h>
 +
-+#if defined(HAVE_SYS_SYSCTL_H) && defined(__NetBSD__)
++#if defined(HAVE_SYS_SYSCTL_H) && defined(PHYSMEM_NETBSD)
 +# include <sys/sysctl.h>
 +#endif
 +
@@ -24,7 +24,7 @@ Fix build on older NetBSD w/o _SC_PHYS_PAGES.
        const unsigned gpu_mappable_megabytes =
           (aper_size / (1024 * 1024)) * 3 / 4;
  
-+#if defined(HW_PHYSMEM64) && defined(__NetBSD__)
++#if defined(HW_PHYSMEM64) && defined(PHYSMEM_NETBSD)
 +      int mib[2] = { CTL_HW, HW_PHYSMEM64 };
 +      uint64_t system_memory_bytes;
 +      size_t len = sizeof(system_memory_bytes);
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 2832c366f7..4b9bb6484a 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
@@ -32,7 +32,7 @@ See kernel commit 172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+.
  #include <time.h>
  #include <unistd.h>
 +
-+#if defined(HAVE_SYS_SYSCTL_H) && defined(__NetBSD__)
++#if defined(HAVE_SYS_SYSCTL_H) && defined(PHYSMEM_NETBSD)
 +# include <sys/sysctl.h>
 +#endif
 +
@@ -43,7 +43,7 @@ See kernel commit 172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+.
        const unsigned gpu_mappable_megabytes =
           screen->aperture_threshold / (1024 * 1024);
  
-+#if defined(HW_PHYSMEM64) && defined(__NetBSD__)
++#if defined(HW_PHYSMEM64) && defined(PHYSMEM_NETBSD)
 +      int mib[2] = { CTL_HW, HW_PHYSMEM64 };
 +      const uint64_t system_memory_bytes;
 +      size_t len = sizeof(system_memory_bytes);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_swrast_swrast.c b/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_swrast_swrast.c
index a355983d7b..997e89a030 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_swrast_swrast.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_swrast_swrast.c
@@ -8,7 +8,7 @@ Fix build on older NetBSD w/o _SC_PHYS_PAGES.
          size_t len = sizeof(system_memory_bytes);
          if (sysctl(mib, 2, &system_memory_bytes, &len, NULL, 0) != 0)
              return -1;
-+#elif defined(HW_PHYSMEM64) && defined(__NetBSD__)
++#elif defined(HW_PHYSMEM64) && defined(PHYSMEM_NETBSD)
 +        int mib[2] = { CTL_HW, HW_PHYSMEM64 };
 +        uint64_t system_memory_bytes;
 +        size_t len = sizeof(system_memory_bytes);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_context.c b/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_context.c
index 255f0c83ca..36a5d3a0a8 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_context.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_context.c
@@ -9,14 +9,14 @@ https://bugs.freedesktop.org/show_bug.cgi?id=82246
 FreeBSD reported atexit bug for 10.6:
 https://bugs.freedesktop.org/show_bug.cgi?id=91869
 
---- src/mesa/main/context.c.orig	2017-11-20 14:25:47.000000000 +0000
+--- src/mesa/main/context.c.orig	2019-03-15 01:02:19.000000000 +0000
 +++ src/mesa/main/context.c
-@@ -354,11 +354,23 @@ mtx_t OneTimeLock = _MTX_INITIALIZER_NP;
+@@ -357,11 +357,23 @@ mtx_t OneTimeLock = _MTX_INITIALIZER_NP;
   * Calls all the various one-time-fini functions in Mesa
   */
  
 +#if defined(HAVE_NOATEXIT)
-+static GLbitfield api_init_mask = 0x0;
++static int init_called = 0;
 +static void __attribute__((__destructor__))
 +#else
  static void
@@ -24,7 +24,7 @@ https://bugs.freedesktop.org/show_bug.cgi?id=91869
  one_time_fini(void)
  {
 +#if defined(HAVE_NOATEXIT)
-+   if (api_init_mask) {
++   if (init_called) {
 +      _mesa_destroy_shader_compiler();
 +      _mesa_locale_fini();
 +   }
@@ -35,17 +35,17 @@ https://bugs.freedesktop.org/show_bug.cgi?id=91869
  }
  
  /**
-@@ -373,7 +385,9 @@ one_time_fini(void)
+@@ -376,7 +388,9 @@ one_time_fini(void)
  static void
  one_time_init( struct gl_context *ctx )
  {
-+#if !defined(HAVE_NOATEXIT)
++#if 1
     static GLbitfield api_init_mask = 0x0;
 +#endif
  
     mtx_lock(&OneTimeLock);
  
-@@ -398,7 +412,9 @@ one_time_init( struct gl_context *ctx )
+@@ -401,7 +415,9 @@ one_time_init( struct gl_context *ctx )
           _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
        }
  
@@ -55,3 +55,13 @@ https://bugs.freedesktop.org/show_bug.cgi?id=91869
  
  #if defined(DEBUG)
        if (MESA_VERBOSE != 0) {
+@@ -416,6 +432,9 @@ one_time_init( struct gl_context *ctx )
+    }
+ 
+    api_init_mask |= 1 << ctx->API;
++#if defined(HAVE_NOATEXIT)
++   init_called = 1;
++#endif
+ 
+    mtx_unlock(&OneTimeLock);
+ }
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_execmem.c b/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_execmem.c
new file mode 100644
index 0000000000..4ed100a404
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_execmem.c
@@ -0,0 +1,26 @@
+$NetBSD$
+
+--- src/mesa/main/execmem.c.orig	2019-03-23 16:29:21.000000000 +0000
++++ src/mesa/main/execmem.c
+@@ -37,7 +37,20 @@
+ #include "c11/threads.h"
+ 
+ 
+-#if defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun) || defined(__HAIKU__)
++#if defined(DISABLE_WX_MEMORY)
++
++void *
++_mesa_exec_malloc(GLuint size)
++{
++   return NULL;
++}
++
++void
++_mesa_exec_free(void *addr)
++{
++}
++
++#elif defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun) || defined(__HAIKU__)
+ 
+ /*
+  * Allocate a large block of memory which can hold code then dole it out
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_ralloc.h b/MesaLib-dfbsd-meson/patches/patch-src_util_ralloc.h
new file mode 100644
index 0000000000..12125d2ef1
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_util_ralloc.h
@@ -0,0 +1,51 @@
+$NetBSD$
+
+--- src/util/ralloc.h.orig	2019-03-23 16:29:21.000000000 +0000
++++ src/util/ralloc.h
+@@ -426,7 +426,7 @@ bool ralloc_vasprintf_append(char **str,
+  *
+  * which is more idiomatic in C++ than calling ralloc.
+  */
+-#define DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(TYPE, ALLOC_FUNC)           \
++#define DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(TYPE, ALLOC_FUNC, USE_DESTRUCTOR) \
+ private:                                                                 \
+    static void _ralloc_destructor(void *p)                               \
+    {                                                                     \
+@@ -437,7 +437,7 @@ public:                                 
+    {                                                                     \
+       void *p = ALLOC_FUNC(mem_ctx, size);                               \
+       assert(p != NULL);                                                 \
+-      if (!HAS_TRIVIAL_DESTRUCTOR(TYPE))                                 \
++      if (USE_DESTRUCTOR && !HAS_TRIVIAL_DESTRUCTOR(TYPE))               \
+          ralloc_set_destructor(p, _ralloc_destructor);                   \
+       return p;                                                          \
+    }                                                                     \
+@@ -454,16 +454,24 @@ public:                                 
+    }
+ 
+ #define DECLARE_RALLOC_CXX_OPERATORS(type) \
+-   DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, ralloc_size)
++   DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, ralloc_size, true)
+ 
+ #define DECLARE_RZALLOC_CXX_OPERATORS(type) \
+-   DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, rzalloc_size)
++   DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, rzalloc_size, true)
+ 
++#if defined(NO_LINEAR_ALLOC_DESTRUCTOR)
+ #define DECLARE_LINEAR_ALLOC_CXX_OPERATORS(type) \
+-   DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, linear_alloc_child)
++   DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, linear_alloc_child, false)
+ 
+ #define DECLARE_LINEAR_ZALLOC_CXX_OPERATORS(type) \
+-   DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, linear_zalloc_child)
++   DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, linear_zalloc_child, false)
++#else
++#define DECLARE_LINEAR_ALLOC_CXX_OPERATORS(type) \
++   DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, linear_alloc_child, true)
++
++#define DECLARE_LINEAR_ZALLOC_CXX_OPERATORS(type) \
++   DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, linear_zalloc_child, true)
++#endif
+ 
+ 
+ /**
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_u__process.c b/MesaLib-dfbsd-meson/patches/patch-src_util_u__process.c
new file mode 100644
index 0000000000..298d6689cb
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_util_u__process.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/util/u_process.c.orig	2019-03-15 01:02:19.000000000 +0000
++++ src/util/u_process.c
+@@ -118,7 +118,7 @@ __getProgramName()
+ #endif
+ 
+ #if !defined(GET_PROGRAM_NAME)
+-#    if defined(__OpenBSD__) || defined(NetBSD) || defined(__UCLIBC__) || defined(ANDROID)
++#    if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__UCLIBC__) || defined(ANDROID)
+ /* This is a hack. It's said to work on OpenBSD, NetBSD and GNU.
+  * Rogelio M.Serrano Jr. reported it's also working with UCLIBC. It's
+  * used as a last resort, if there is no documented facility available. */
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_u__queue.c b/MesaLib-dfbsd-meson/patches/patch-src_util_u__queue.c
index ccba44b511..d163b3ce6c 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_u__queue.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_util_u__queue.c
@@ -5,7 +5,9 @@ atexit() is not a good idea in shared libraries.
 FreeBSD reported atexit bug for 10.6:
 https://bugs.freedesktop.org/show_bug.cgi?id=91869
 
---- src/util/u_queue.c.orig	2018-12-11 21:13:57.000000000 +0000
+NetBSD option for pthread_setaffinity_np idiom.
+
+--- src/util/u_queue.c.orig	2019-03-15 01:02:19.000000000 +0000
 +++ src/util/u_queue.c
 @@ -46,11 +46,22 @@ static once_flag atexit_once_flag = ONCE
  static struct list_head queue_list;
@@ -46,7 +48,7 @@ https://bugs.freedesktop.org/show_bug.cgi?id=91869
        /* Don't inherit the thread affinity from the parent thread.
         * Set the full mask.
         */
-+#if defined(__NetBSD__)
++#if defined(__NetBSD__) && defined(SETAFFINITY_NP_NETBSD)
 +      cpuset_t *cpuset;
 +      cpuset = cpuset_create();
 +      if (cpuset != NULL) {
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 f716a13c7e..8f27f91a28 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h
+++ b/MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h
@@ -7,9 +7,7 @@ From FreeBSD ports / DragonFly dports
 - Implement setting thread name
 - Use monotonic clock for timeouts
 
-https://reviews.freebsd.org/D17872
-
---- src/util/u_thread.h.orig	2018-12-11 21:13:57.000000000 +0000
+--- src/util/u_thread.h.orig	2019-03-15 01:02:19.000000000 +0000
 +++ src/util/u_thread.h
 @@ -34,6 +34,13 @@
  
@@ -25,7 +23,7 @@ https://reviews.freebsd.org/D17872
  #endif
  
  static inline thrd_t u_thread_create(int (*routine)(void *), void *param)
-@@ -64,6 +71,8 @@ static inline void u_thread_setname( con
+@@ -65,6 +72,8 @@ static inline void u_thread_setname( con
        (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12)) && \
        defined(__linux__)
     pthread_setname_np(pthread_self(), name);
@@ -34,11 +32,11 @@ https://reviews.freebsd.org/D17872
  #  endif
  #endif
     (void)name;
-@@ -83,6 +92,17 @@ static inline void
+@@ -84,6 +93,17 @@ static inline void
  util_pin_thread_to_L3(thrd_t thread, unsigned L3_index, unsigned cores_per_L3)
  {
  #if defined(HAVE_PTHREAD_SETAFFINITY)
-+#if defined(__NetBSD__)
++#if defined(__NetBSD__) && defined(SETAFFINITY_NP_NETBSD)
 +   cpuset_t *cpuset;
 +   cpuset = cpuset_create();
 +   if (cpuset == NULL)
@@ -52,7 +50,7 @@ https://reviews.freebsd.org/D17872
     cpu_set_t cpuset;
  
     CPU_ZERO(&cpuset);
-@@ -90,6 +110,7 @@ util_pin_thread_to_L3(thrd_t thread, uns
+@@ -91,6 +111,7 @@ util_pin_thread_to_L3(thrd_t thread, uns
        CPU_SET(L3_index * cores_per_L3 + i, &cpuset);
     pthread_setaffinity_np(thread, sizeof(cpuset), &cpuset);
  #endif
@@ -60,11 +58,11 @@ https://reviews.freebsd.org/D17872
  }
  
  /**
-@@ -103,6 +124,35 @@ static inline int
+@@ -104,6 +125,35 @@ static inline int
  util_get_L3_for_pinned_thread(thrd_t thread, unsigned cores_per_L3)
  {
  #if defined(HAVE_PTHREAD_SETAFFINITY)
-+#if defined(__NetBSD__)
++#if defined(__NetBSD__) && defined(SETAFFINITY_NP_NETBSD)
 +   cpuset_t *cpuset;
 +
 +   cpuset = cpuset_create();
@@ -96,7 +94,7 @@ https://reviews.freebsd.org/D17872
     cpu_set_t cpuset;
  
     if (pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset) == 0) {
-@@ -123,6 +173,7 @@ util_get_L3_for_pinned_thread(thrd_t thr
+@@ -124,6 +174,7 @@ util_get_L3_for_pinned_thread(thrd_t thr
        return L3_index;
     }
  #endif
@@ -104,7 +102,7 @@ https://reviews.freebsd.org/D17872
     return -1;
  }
  
-@@ -134,7 +185,7 @@ util_get_L3_for_pinned_thread(thrd_t thr
+@@ -135,7 +186,7 @@ util_get_L3_for_pinned_thread(thrd_t thr
  static inline int64_t
  u_thread_get_time_nano(thrd_t thread)
  {



Home | Main Index | Thread Index | Old Index