pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
MesaLib-dfbsd-*: remove
Module Name: pkgsrc-wip
Committed By: Benny Siegert <bsiegert%NetBSD.org@localhost>
Pushed By: bsiegert
Date: Fri Oct 20 16:41:49 2023 +0200
Changeset: 52fac892856d96ef863be74c32538ffa7e30edf0
Modified Files:
Makefile
Removed Files:
MesaLib-dfbsd-meson/DESCR
MesaLib-dfbsd-meson/Makefile
MesaLib-dfbsd-meson/PLIST
MesaLib-dfbsd-meson/TODO
MesaLib-dfbsd-meson/buildlink3.mk
MesaLib-dfbsd-meson/builtin.mk
MesaLib-dfbsd-meson/distinfo
MesaLib-dfbsd-meson/dri.mk
MesaLib-dfbsd-meson/options.mk
MesaLib-dfbsd-meson/patches/patch-include_GL_internal_dri__interface.h
MesaLib-dfbsd-meson/patches/patch-meson.build
MesaLib-dfbsd-meson/patches/patch-meson__options.txt
MesaLib-dfbsd-meson/patches/patch-src_amd_common_ac__debug.c
MesaLib-dfbsd-meson/patches/patch-src_amd_vulkan_radv__device.c
MesaLib-dfbsd-meson/patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
MesaLib-dfbsd-meson/patches/patch-src_compiler_builtin__type__macros.h
MesaLib-dfbsd-meson/patches/patch-src_compiler_glsl_glsl__parser__extras.cpp
MesaLib-dfbsd-meson/patches/patch-src_egl_drivers_dri2_platform__drm.c
MesaLib-dfbsd-meson/patches/patch-src_egl_drivers_dri2_platform__x11.c
MesaLib-dfbsd-meson/patches/patch-src_egl_main_eglglobals.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_drivers_trace_tr__dump.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_util_u__format__tests.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_freedreno_freedreno__screen.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_iris_meson.build
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_meson.build
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_nv50_nv84__video.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__buffer.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__compute__blit.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__dma__cs.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__gfx__cs.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__pipe.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__state__shaders.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c
MesaLib-dfbsd-meson/patches/patch-src_gallium_include_pipe_p__config.h
MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp
MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_util_range.hpp
MesaLib-dfbsd-meson/patches/patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c
MesaLib-dfbsd-meson/patches/patch-src_glx_apple_apple__glapi.c
MesaLib-dfbsd-meson/patches/patch-src_glx_dri__common.h
MesaLib-dfbsd-meson/patches/patch-src_glx_dri__glx.c
MesaLib-dfbsd-meson/patches/patch-src_glx_glxclient.h
MesaLib-dfbsd-meson/patches/patch-src_glx_glxcurrent.c
MesaLib-dfbsd-meson/patches/patch-src_glx_glxext.c
MesaLib-dfbsd-meson/patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
MesaLib-dfbsd-meson/patches/patch-src_intel_isl_isl__tiled__memcpy.c
MesaLib-dfbsd-meson/patches/patch-src_intel_perf_gen__perf.h
MesaLib-dfbsd-meson/patches/patch-src_intel_tools_aub__mem.c
MesaLib-dfbsd-meson/patches/patch-src_intel_tools_aubinator__error__decode.c
MesaLib-dfbsd-meson/patches/patch-src_intel_tools_error2aub.c
MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__allocator.c
MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__device.c
MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__gem.c
MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__gem__stubs.c
MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__queue.c
MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86-64__tls.h
MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86__tls.h
MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86__tsd.h
MesaLib-dfbsd-meson/patches/patch-src_mapi_glapi_gen_gl__gentable.py
MesaLib-dfbsd-meson/patches/patch-src_mapi_u__current.c
MesaLib-dfbsd-meson/patches/patch-src_mapi_u__current.h
MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i915_intel__screen.c
MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.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_mesa_main_extensions.c
MesaLib-dfbsd-meson/patches/patch-src_mesa_main_macros.h
MesaLib-dfbsd-meson/patches/patch-src_mesa_main_shader__query.cpp
MesaLib-dfbsd-meson/patches/patch-src_mesa_x86_common__x86.c
MesaLib-dfbsd-meson/patches/patch-src_util_build__id.c
MesaLib-dfbsd-meson/patches/patch-src_util_disk__cache.c
MesaLib-dfbsd-meson/patches/patch-src_util_os__time.c
MesaLib-dfbsd-meson/patches/patch-src_util_ralloc.c
MesaLib-dfbsd-meson/patches/patch-src_util_ralloc.h
MesaLib-dfbsd-meson/patches/patch-src_util_strndup.h
MesaLib-dfbsd-meson/patches/patch-src_util_u__atomic.h
MesaLib-dfbsd-meson/patches/patch-src_util_u__process.c
MesaLib-dfbsd-meson/patches/patch-src_util_u__queue.c
MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h
MesaLib-dfbsd-meson/patches/patch-src_util_xmlconfig.c
MesaLib-dfbsd/DESCR
MesaLib-dfbsd/Makefile
MesaLib-dfbsd/PLIST
MesaLib-dfbsd/TODO
MesaLib-dfbsd/buildlink3.mk
MesaLib-dfbsd/builtin.mk
MesaLib-dfbsd/distinfo
MesaLib-dfbsd/dri.mk
MesaLib-dfbsd/options.mk
MesaLib-dfbsd/patches/patch-configure.ac
MesaLib-dfbsd/patches/patch-include_GL_internal_dri__interface.h
MesaLib-dfbsd/patches/patch-meson.build
MesaLib-dfbsd/patches/patch-meson__options.txt
MesaLib-dfbsd/patches/patch-src_amd_common_ac__debug.c
MesaLib-dfbsd/patches/patch-src_amd_common_ac__llvm__util.c
MesaLib-dfbsd/patches/patch-src_amd_vulkan_radv__device.c
MesaLib-dfbsd/patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
MesaLib-dfbsd/patches/patch-src_compiler_builtin__type__macros.h
MesaLib-dfbsd/patches/patch-src_compiler_glsl_glsl__parser__extras.cpp
MesaLib-dfbsd/patches/patch-src_egl_drivers_dri2_platform__drm.c
MesaLib-dfbsd/patches/patch-src_egl_drivers_dri2_platform__x11.c
MesaLib-dfbsd/patches/patch-src_egl_main_eglglobals.c
MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_drivers_trace_tr__dump.c
MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_util_u__format__tests.c
MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_util_u__helpers.c
MesaLib-dfbsd/patches/patch-src_gallium_drivers_freedreno_freedreno__screen.c
MesaLib-dfbsd/patches/patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c
MesaLib-dfbsd/patches/patch-src_gallium_drivers_nouveau_nv50_nv84__video.c
MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__compute__blit.c
MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__pipe.c
MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__state__shaders.c
MesaLib-dfbsd/patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c
MesaLib-dfbsd/patches/patch-src_gallium_include_pipe_p__config.h
MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp
MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_util_range.hpp
MesaLib-dfbsd/patches/patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c
MesaLib-dfbsd/patches/patch-src_gbm_Makefile.am
MesaLib-dfbsd/patches/patch-src_gbm_backends_dri_gbm__dri.c
MesaLib-dfbsd/patches/patch-src_glx_Makefile.am
MesaLib-dfbsd/patches/patch-src_glx_apple_apple__glapi.c
MesaLib-dfbsd/patches/patch-src_glx_dri__common.h
MesaLib-dfbsd/patches/patch-src_glx_dri__glx.c
MesaLib-dfbsd/patches/patch-src_glx_glxclient.h
MesaLib-dfbsd/patches/patch-src_glx_glxcurrent.c
MesaLib-dfbsd/patches/patch-src_glx_glxext.c
MesaLib-dfbsd/patches/patch-src_intel_Makefile.tools.am
MesaLib-dfbsd/patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
MesaLib-dfbsd/patches/patch-src_intel_tools_aub__mem.c
MesaLib-dfbsd/patches/patch-src_intel_tools_aubinator__error__decode.c
MesaLib-dfbsd/patches/patch-src_intel_tools_error2aub.c
MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__allocator.c
MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__device.c
MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__gem.c
MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__gem__stubs.c
MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__queue.c
MesaLib-dfbsd/patches/patch-src_mapi_entry__x86-64__tls.h
MesaLib-dfbsd/patches/patch-src_mapi_entry__x86__tls.h
MesaLib-dfbsd/patches/patch-src_mapi_glapi_gen_gl__gentable.py
MesaLib-dfbsd/patches/patch-src_mapi_u__current.c
MesaLib-dfbsd/patches/patch-src_mapi_u__current.h
MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i915_intel__screen.c
MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c
MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c
MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__performance__query.c
MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_intel__screen.c
MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_intel__tiled__memcpy.c
MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_swrast_swrast.c
MesaLib-dfbsd/patches/patch-src_mesa_drivers_x11_Makefile.am
MesaLib-dfbsd/patches/patch-src_mesa_main_context.c
MesaLib-dfbsd/patches/patch-src_mesa_main_extensions.c
MesaLib-dfbsd/patches/patch-src_mesa_main_macros.h
MesaLib-dfbsd/patches/patch-src_mesa_main_shader__query.cpp
MesaLib-dfbsd/patches/patch-src_mesa_x86_common__x86.c
MesaLib-dfbsd/patches/patch-src_util_Makefile.am
MesaLib-dfbsd/patches/patch-src_util_build__id.c
MesaLib-dfbsd/patches/patch-src_util_disk__cache.c
MesaLib-dfbsd/patches/patch-src_util_futex.h
MesaLib-dfbsd/patches/patch-src_util_os__time.c
MesaLib-dfbsd/patches/patch-src_util_ralloc.c
MesaLib-dfbsd/patches/patch-src_util_strndup.h
MesaLib-dfbsd/patches/patch-src_util_u__atomic.h
MesaLib-dfbsd/patches/patch-src_util_u__math.h
MesaLib-dfbsd/patches/patch-src_util_u__process.c
MesaLib-dfbsd/patches/patch-src_util_u__queue.c
MesaLib-dfbsd/patches/patch-src_util_u__thread.h
MesaLib-dfbsd/patches/patch-src_util_xmlconfig.c
Log Message:
MesaLib-dfbsd-*: remove
These no longer build, since they depend on obsolete bits
in graphics/MesaLib.
If you still need these, feel free to restore the packages. Sorry.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=52fac892856d96ef863be74c32538ffa7e30edf0
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 2 -
MesaLib-dfbsd-meson/DESCR | 5 -
MesaLib-dfbsd-meson/Makefile | 193 --------
MesaLib-dfbsd-meson/PLIST | 131 -----
MesaLib-dfbsd-meson/TODO | 11 -
MesaLib-dfbsd-meson/buildlink3.mk | 50 --
MesaLib-dfbsd-meson/builtin.mk | 87 ----
MesaLib-dfbsd-meson/distinfo | 79 ---
MesaLib-dfbsd-meson/dri.mk | 33 --
MesaLib-dfbsd-meson/options.mk | 533 ---------------------
.../patch-include_GL_internal_dri__interface.h | 31 --
MesaLib-dfbsd-meson/patches/patch-meson.build | 63 ---
.../patches/patch-meson__options.txt | 17 -
.../patches/patch-src_amd_common_ac__debug.c | 19 -
.../patches/patch-src_amd_vulkan_radv__device.c | 23 -
...src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c | 19 -
.../patch-src_compiler_builtin__type__macros.h | 25 -
...atch-src_compiler_glsl_glsl__parser__extras.cpp | 18 -
.../patch-src_egl_drivers_dri2_platform__drm.c | 18 -
.../patch-src_egl_drivers_dri2_platform__x11.c | 60 ---
.../patches/patch-src_egl_main_eglglobals.c | 68 ---
...-src_gallium_auxiliary_drivers_trace_tr__dump.c | 50 --
...llium_auxiliary_pipe-loader_pipe__loader__drm.c | 127 -----
...h-src_gallium_auxiliary_util_u__format__tests.c | 17 -
...c_gallium_drivers_freedreno_freedreno__screen.c | 34 --
.../patch-src_gallium_drivers_iris_meson.build | 22 -
.../patch-src_gallium_drivers_nouveau_meson.build | 13 -
...c_gallium_drivers_nouveau_nouveau__vp3__video.c | 18 -
...-src_gallium_drivers_nouveau_nv50_nv84__video.c | 18 -
...patch-src_gallium_drivers_radeonsi_si__buffer.c | 65 ---
...rc_gallium_drivers_radeonsi_si__compute__blit.c | 176 -------
...atch-src_gallium_drivers_radeonsi_si__dma__cs.c | 22 -
...atch-src_gallium_drivers_radeonsi_si__gfx__cs.c | 38 --
.../patch-src_gallium_drivers_radeonsi_si__pipe.c | 115 -----
...c_gallium_drivers_radeonsi_si__state__shaders.c | 21 -
.../patch-src_gallium_drivers_vc4_vc4__bufmgr.c | 18 -
.../patch-src_gallium_include_pipe_p__config.h | 31 --
...lium_state__trackers_clover_llvm_invocation.cpp | 40 --
...allium_state__trackers_clover_llvm_metadata.hpp | 21 -
...c_gallium_state__trackers_clover_util_range.hpp | 40 --
...gallium_winsys_radeon_drm_radeon__drm__winsys.c | 18 -
.../patches/patch-src_glx_apple_apple__glapi.c | 24 -
.../patches/patch-src_glx_dri__common.h | 17 -
.../patches/patch-src_glx_dri__glx.c | 43 --
.../patches/patch-src_glx_glxclient.h | 19 -
.../patches/patch-src_glx_glxcurrent.c | 40 --
MesaLib-dfbsd-meson/patches/patch-src_glx_glxext.c | 47 --
...src_intel_compiler_brw__fs__bank__conflicts.cpp | 23 -
.../patch-src_intel_isl_isl__tiled__memcpy.c | 26 -
.../patches/patch-src_intel_perf_gen__perf.h | 14 -
.../patches/patch-src_intel_tools_aub__mem.c | 43 --
...atch-src_intel_tools_aubinator__error__decode.c | 19 -
.../patches/patch-src_intel_tools_error2aub.c | 19 -
.../patch-src_intel_vulkan_anv__allocator.c | 62 ---
.../patches/patch-src_intel_vulkan_anv__device.c | 61 ---
.../patches/patch-src_intel_vulkan_anv__gem.c | 19 -
.../patch-src_intel_vulkan_anv__gem__stubs.c | 36 --
.../patches/patch-src_intel_vulkan_anv__queue.c | 25 -
.../patches/patch-src_mapi_entry__x86-64__tls.h | 32 --
.../patches/patch-src_mapi_entry__x86__tls.h | 40 --
.../patches/patch-src_mapi_entry__x86__tsd.h | 86 ----
.../patch-src_mapi_glapi_gen_gl__gentable.py | 15 -
.../patches/patch-src_mapi_u__current.c | 31 --
.../patches/patch-src_mapi_u__current.h | 16 -
...patch-src_mesa_drivers_dri_i915_intel__screen.c | 44 --
.../patch-src_mesa_drivers_dri_i965_brw__bufmgr.c | 31 --
...patch-src_mesa_drivers_dri_i965_intel__screen.c | 81 ----
.../patch-src_mesa_drivers_dri_swrast_swrast.c | 19 -
.../patches/patch-src_mesa_main_context.c | 57 ---
.../patches/patch-src_mesa_main_extensions.c | 31 --
.../patches/patch-src_mesa_main_macros.h | 18 -
.../patches/patch-src_mesa_main_shader__query.cpp | 58 ---
.../patches/patch-src_mesa_x86_common__x86.c | 24 -
.../patches/patch-src_util_build__id.c | 26 -
.../patches/patch-src_util_disk__cache.c | 29 --
.../patches/patch-src_util_os__time.c | 18 -
.../patches/patch-src_util_ralloc.c | 25 -
.../patches/patch-src_util_ralloc.h | 51 --
.../patches/patch-src_util_strndup.h | 15 -
.../patches/patch-src_util_u__atomic.h | 15 -
.../patches/patch-src_util_u__process.c | 13 -
.../patches/patch-src_util_u__queue.c | 72 ---
.../patches/patch-src_util_u__thread.h | 113 -----
.../patches/patch-src_util_xmlconfig.c | 32 --
MesaLib-dfbsd/DESCR | 5 -
MesaLib-dfbsd/Makefile | 131 -----
MesaLib-dfbsd/PLIST | 130 -----
MesaLib-dfbsd/TODO | 23 -
MesaLib-dfbsd/buildlink3.mk | 50 --
MesaLib-dfbsd/builtin.mk | 87 ----
MesaLib-dfbsd/distinfo | 84 ----
MesaLib-dfbsd/dri.mk | 33 --
MesaLib-dfbsd/options.mk | 514 --------------------
MesaLib-dfbsd/patches/patch-configure.ac | 127 -----
.../patch-include_GL_internal_dri__interface.h | 31 --
MesaLib-dfbsd/patches/patch-meson.build | 71 ---
MesaLib-dfbsd/patches/patch-meson__options.txt | 17 -
.../patches/patch-src_amd_common_ac__debug.c | 19 -
.../patches/patch-src_amd_common_ac__llvm__util.c | 20 -
.../patches/patch-src_amd_vulkan_radv__device.c | 23 -
...src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c | 19 -
.../patch-src_compiler_builtin__type__macros.h | 25 -
...atch-src_compiler_glsl_glsl__parser__extras.cpp | 18 -
.../patch-src_egl_drivers_dri2_platform__drm.c | 18 -
.../patch-src_egl_drivers_dri2_platform__x11.c | 60 ---
.../patches/patch-src_egl_main_eglglobals.c | 68 ---
...-src_gallium_auxiliary_drivers_trace_tr__dump.c | 50 --
...llium_auxiliary_pipe-loader_pipe__loader__drm.c | 127 -----
...h-src_gallium_auxiliary_util_u__format__tests.c | 17 -
.../patch-src_gallium_auxiliary_util_u__helpers.c | 34 --
...c_gallium_drivers_freedreno_freedreno__screen.c | 34 --
...c_gallium_drivers_nouveau_nouveau__vp3__video.c | 18 -
...-src_gallium_drivers_nouveau_nv50_nv84__video.c | 18 -
...rc_gallium_drivers_radeonsi_si__compute__blit.c | 180 -------
.../patch-src_gallium_drivers_radeonsi_si__pipe.c | 93 ----
...c_gallium_drivers_radeonsi_si__state__shaders.c | 21 -
.../patch-src_gallium_drivers_vc4_vc4__bufmgr.c | 18 -
.../patch-src_gallium_include_pipe_p__config.h | 31 --
...lium_state__trackers_clover_llvm_invocation.cpp | 40 --
...allium_state__trackers_clover_llvm_metadata.hpp | 21 -
...c_gallium_state__trackers_clover_util_range.hpp | 40 --
...gallium_winsys_radeon_drm_radeon__drm__winsys.c | 18 -
MesaLib-dfbsd/patches/patch-src_gbm_Makefile.am | 12 -
.../patches/patch-src_gbm_backends_dri_gbm__dri.c | 21 -
MesaLib-dfbsd/patches/patch-src_glx_Makefile.am | 49 --
.../patches/patch-src_glx_apple_apple__glapi.c | 24 -
MesaLib-dfbsd/patches/patch-src_glx_dri__common.h | 17 -
MesaLib-dfbsd/patches/patch-src_glx_dri__glx.c | 43 --
MesaLib-dfbsd/patches/patch-src_glx_glxclient.h | 19 -
MesaLib-dfbsd/patches/patch-src_glx_glxcurrent.c | 40 --
MesaLib-dfbsd/patches/patch-src_glx_glxext.c | 47 --
.../patches/patch-src_intel_Makefile.tools.am | 14 -
...src_intel_compiler_brw__fs__bank__conflicts.cpp | 23 -
.../patches/patch-src_intel_tools_aub__mem.c | 43 --
...atch-src_intel_tools_aubinator__error__decode.c | 19 -
.../patches/patch-src_intel_tools_error2aub.c | 19 -
.../patch-src_intel_vulkan_anv__allocator.c | 62 ---
.../patches/patch-src_intel_vulkan_anv__device.c | 61 ---
.../patches/patch-src_intel_vulkan_anv__gem.c | 19 -
.../patch-src_intel_vulkan_anv__gem__stubs.c | 36 --
.../patches/patch-src_intel_vulkan_anv__queue.c | 25 -
.../patches/patch-src_mapi_entry__x86-64__tls.h | 32 --
.../patches/patch-src_mapi_entry__x86__tls.h | 40 --
.../patch-src_mapi_glapi_gen_gl__gentable.py | 15 -
MesaLib-dfbsd/patches/patch-src_mapi_u__current.c | 31 --
MesaLib-dfbsd/patches/patch-src_mapi_u__current.h | 16 -
...patch-src_mesa_drivers_dri_i915_intel__screen.c | 44 --
.../patch-src_mesa_drivers_dri_i965_brw__bufmgr.c | 31 --
...ch-src_mesa_drivers_dri_i965_brw__oa__metrics.c | 13 -
...mesa_drivers_dri_i965_brw__performance__query.c | 72 ---
...patch-src_mesa_drivers_dri_i965_intel__screen.c | 81 ----
...rc_mesa_drivers_dri_i965_intel__tiled__memcpy.c | 26 -
.../patch-src_mesa_drivers_dri_swrast_swrast.c | 19 -
.../patches/patch-src_mesa_drivers_x11_Makefile.am | 15 -
.../patches/patch-src_mesa_main_context.c | 57 ---
.../patches/patch-src_mesa_main_extensions.c | 31 --
MesaLib-dfbsd/patches/patch-src_mesa_main_macros.h | 18 -
.../patches/patch-src_mesa_main_shader__query.cpp | 58 ---
.../patches/patch-src_mesa_x86_common__x86.c | 24 -
MesaLib-dfbsd/patches/patch-src_util_Makefile.am | 15 -
MesaLib-dfbsd/patches/patch-src_util_build__id.c | 26 -
MesaLib-dfbsd/patches/patch-src_util_disk__cache.c | 29 --
MesaLib-dfbsd/patches/patch-src_util_futex.h | 53 --
MesaLib-dfbsd/patches/patch-src_util_os__time.c | 18 -
MesaLib-dfbsd/patches/patch-src_util_ralloc.c | 25 -
MesaLib-dfbsd/patches/patch-src_util_strndup.h | 15 -
MesaLib-dfbsd/patches/patch-src_util_u__atomic.h | 15 -
MesaLib-dfbsd/patches/patch-src_util_u__math.h | 25 -
MesaLib-dfbsd/patches/patch-src_util_u__process.c | 13 -
MesaLib-dfbsd/patches/patch-src_util_u__queue.c | 72 ---
MesaLib-dfbsd/patches/patch-src_util_u__thread.h | 117 -----
MesaLib-dfbsd/patches/patch-src_util_xmlconfig.c | 31 --
172 files changed, 7921 deletions(-)
diffs:
diff --git a/Makefile b/Makefile
index 457ce68646..b8a69f0700 100644
--- a/Makefile
+++ b/Makefile
@@ -23,8 +23,6 @@ SUBDIR+= Geomyidae-git
SUBDIR+= HP-1973
SUBDIR+= I2util
SUBDIR+= LuaJIT21
-SUBDIR+= MesaLib-dfbsd
-SUBDIR+= MesaLib-dfbsd-meson
SUBDIR+= MoleInvasion
SUBDIR+= OpenGLUT
SUBDIR+= OpenJK-git
diff --git a/MesaLib-dfbsd-meson/DESCR b/MesaLib-dfbsd-meson/DESCR
deleted file mode 100644
index 8a8cccf5b9..0000000000
--- a/MesaLib-dfbsd-meson/DESCR
+++ /dev/null
@@ -1,5 +0,0 @@
-MesaLib is a 3-D graphics library with an API which is very similar to
-that of OpenGL*. To the extent that Mesa utilizes the OpenGL command syntax
-or state machine, it is being used with authorization from Silicon Graphics,
-Inc. However, the author makes no claim that Mesa is in any way a
-compatible replacement for OpenGL or associated with Silicon Graphics, Inc.
diff --git a/MesaLib-dfbsd-meson/Makefile b/MesaLib-dfbsd-meson/Makefile
deleted file mode 100644
index 0721285efe..0000000000
--- a/MesaLib-dfbsd-meson/Makefile
+++ /dev/null
@@ -1,193 +0,0 @@
-# $NetBSD: Makefile,v 1.20 2019/04/25 07:32:56 maya Exp $
-
-# 2019-05-12 radv: Do not use extra descriptor space for the 3rd plane.
-COMMIT_ID= f53ebfb4503a1ae054539df1c414b86c3b1966d9
-
-# 2019-05-11 nir: Fix wrong sign in lower_rcp
-# COMMIT_ID= 974c4d679c23373dbed386c696e3e3bc1bfa23ae
-
-# 2019-05-10 intel: drop misleading driver name from gen_get_device_info()
-# COMMIT_ID= 7b2468bf6e58b0b178f8f498fca92c9cc0a71edb
-
-# 2019-05-10 radv: clear vertex bindings while resetting command buffer
-# COMMIT_ID= 24af0f1318967e20a8c5d7f3559389c341a0a11c
-
-# 2019-05-09 lima: fix tile buffer reloading
-# COMMIT_ID= e44a4bae52f8d835bd7d4b740cb688f59d03cced
-
-# 2019-05-08 iris: Reorganise execbuf to have a single point of failure
-# COMMIT_ID= 8b8125646991fb7e923821bafea9bec3ba355b42
-
-# 2019-05-08 kmsro: add _dri.so to two of the kmsro drivers.
-# COMMIT_ID= 0a42d5b98bc3083e20475eb1ecea20f9b876269d
-
-# 2019-05-07 Revert "glx: Fix synthetic error generation in __glXSendError"
-# COMMIT_ID= a01b393c397c846345f03f76f1167dd667e0ee96
-
-# 2019-05-04 panfrost/midgard: iabs cannot run on mul
-# COMMIT_ID= 68238732462bb044282ffbeb6cb08b96c7ff7805
-
-# 2019-05-03 st/va: check resource_get_info nullity in vlVaDeriveImage
-# COMMIT_ID= 8cd71f399e73c5d87e9162cc74da76e317a9f41f
-
-# 2019-05-03 radv: apply the indexing workaround for atomic buffer operations on GFX9
-# COMMIT_ID= 4f18c43d1df64135e8968a7d4fbfd2c9918b76ae
-
-# 2019-05-03 anv: fix crash when application does not provide push constants
-# COMMIT_ID= 80dc78407d0d1e03ceddf8889b217e8fd113568d
-
-# 2019-05-02 anv: Stop including POS in FS input limits
-# COMMIT_ID= be7e9870d620460a91e8fbdbb8bf39b5c462aed3
-
-# 2019-05-02 docs: fixup mistake in contents
-# COMMIT_ID= 96924aa92ecf16cd2145b1a881df37d9162c6ba7
-
-# 2019-05-02 panfrost/midgard: Skip liveness analysis for instructions without dest
-# COMMIT_ID= ad7c9ba0ecb349763ab7fad7bce74f1d47c139e3
-
-# 2019-05-01 util/bitset: Return an actual bool from test macros
-# COMMIT_ID= bf774b56be46d5812868d9f6e7e63437d36754e0
-
-# 2019-05-01 panfrost: Fix blend shader upload
-# COMMIT_ID= 09c669260f6d311d0d99f2c63ebd0ec5b68853f8
-
-# 2019-05-01 util: move #include out of #if linux
-# COMMIT_ID= 70da00ffd65e56c8c8cc6ecfcec462fb52ee5102
-
-# 2019-05-01 gitlab-ci: build vulkan drivers in clang build
-# COMMIT_ID= 47f419d0b37721776785a54005783ef6fe836d66
-
-PORTNAME= mesa
-
-DISTNAME= ${PORTNAME}-${COMMIT_ID}
-PKGNAME= MesaLib-19.1.0
-# PKGREVISION= 1
-CATEGORIES= graphics x11
-MASTER_SITES= http://cgit.freedesktop.org/mesa/${PORTNAME}/snapshot/
-
-# DISTNAME= mesa-18.3.3
-# PKGNAME= ${DISTNAME:S/mesa/MesaLib/}
-# CATEGORIES= graphics x11
-# MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/
-# MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/${PKGVERSION_NOREV}/
-EXTRACT_SUFX= .tar.xz
-
-MAINTAINER= pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE= https://www.mesa3d.org/
-COMMENT= The Mesa 3D Graphics Library
-LICENSE= mit
-
-# GNU_CONFIGURE= yes
-# USE_TOOLS+= autoconf automake autoreconf bison pkg-config flex
-USE_TOOLS+= bison pkg-config flex
-USE_LANGUAGES= c99 c++
-# USE_LIBTOOL= yes
-
-PKGCONFIG_OVERRIDE+= src/egl/main/egl.pc.in
-PKGCONFIG_OVERRIDE+= src/gallium/targets/d3dadapter9/d3d.pc.in
-PKGCONFIG_OVERRIDE+= src/gallium/targets/osmesa/osmesa.pc.in
-PKGCONFIG_OVERRIDE+= src/gallium/targets/xa/xatracker.pc.in
-PKGCONFIG_OVERRIDE+= src/gbm/main/gbm.pc.in
-PKGCONFIG_OVERRIDE+= src/glx/windows/windowsdriproto.pc.in
-PKGCONFIG_OVERRIDE+= src/mapi/es1api/glesv1_cm.pc.in
-PKGCONFIG_OVERRIDE+= src/mapi/es2api/glesv2.pc.in
-PKGCONFIG_OVERRIDE+= src/mesa/drivers/dri/dri.pc.in
-PKGCONFIG_OVERRIDE+= src/mesa/drivers/osmesa/osmesa.pc.in
-PKGCONFIG_OVERRIDE+= src/mesa/gl.pc.in
-
-CONFIGURE_ARGS+= --enable-shared-glapi
-MESON_ARGS+= -Dshared-glapi=true
-
-# Work around a buildlink and/or libtool bug:
-# In the libtool install/relink stage, if we want to link with two static
-# archives named libglapi.la but in different directories, bad things happen.
-SUBST_CLASSES+= wrapper-bug
-SUBST_STAGE.wrapper-bug= pre-configure
-SUBST_MESSAGE.wrapper-bug= Renaming non-shared libglapi.la in Makefiles
-SUBST_FILES.wrapper-bug= src/gallium/targets/libgl-xlib/Makefile.am
-SUBST_FILES.wrapper-bug+= src/gallium/targets/osmesa/Makefile.am
-SUBST_FILES.wrapper-bug+= src/glx/Makefile.am
-SUBST_FILES.wrapper-bug+= src/mapi/Makefile.am
-SUBST_FILES.wrapper-bug+= src/mesa/drivers/osmesa/Makefile.am
-SUBST_FILES.wrapper-bug+= src/mesa/drivers/x11/Makefile.am
-SUBST_SED.wrapper-bug= -e 's,shared-glapi/libglapi\.la,shared-glapi/libglapi_tmp_rename.la,g'
-SUBST_SED.wrapper-bug+= -e 's,shared_glapi_libglapi_la,shared_glapi_libglapi_tmp_rename_la,g'
-SUBST_SED.wrapper-bug+= -e 's,libglapi\.la,libglapi_impl.la,g'
-SUBST_SED.wrapper-bug+= -e 's,libglapi_la,libglapi_impl_la,g'
-SUBST_SED.wrapper-bug+= -e 's,libglapi_tmp_rename\.la,libglapi.la,g'
-SUBST_SED.wrapper-bug+= -e 's,libglapi_tmp_rename_la,libglapi_la,g'
-
-# Replace /etc/drirc.d with ${PREFIX}/etc/drirc.d
-SUBST_CLASSES+= drirc
-SUBST_STAGE.drirc= pre-configure
-SUBST_MESSAGE.drirc= Fixing hardcoded /etc/drirc.d references
-SUBST_FILES.drirc+= src/util/xmlconfig.c
-SUBST_SED.drirc+= -e 's|/etc|${PREFIX}/etc|g'
-
-CFLAGS.SunOS+= -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS
-CXXFLAGS.SunOS+= -Drestrict=__restrict__
-LDFLAGS.SunOS+= -lsocket -lnsl
-
-.include "../../mk/bsd.prefs.mk"
-.include "../../mk/compiler.mk"
-.include "options.mk"
-
-.if ${MACHINE_ARCH} == "i386"
-CONFIGURE_ARGS+= --enable-glx-read-only-text
-MESON_ARGS+= -Dglx-read-only-text=true
-.endif
-
-PYTHON_FOR_BUILD_ONLY= yes
-TOOL_DEPENDS+= ${PYPKGPREFIX}-mako-[0-9]*:../../devel/py-mako
-# needed to build vulkan support
-TOOL_DEPENDS+= ${PYPKGPREFIX}-cElementTree-[0-9]*:../../textproc/py-cElementTree
-CONFIGURE_ENV+= PYTHON=${PYTHONBIN}
-.include "../../lang/python/tool.mk"
-
-# Handle platforms without exp2
-.if !empty(MACHINE_PLATFORM:MNetBSD-[1-5].*-*)
-CPPFLAGS+= -Dexp2\(x\)=exp\(\(x\)\*M_LN2\)
-CPPFLAGS+= -Dexp2f\(x\)=expf\(\(x\)\*M_LN2\)
-.endif
-
-# Work around Xorg segfaulting in radeon driver due to wrong alloca being used
-CFLAGS.NetBSD+= -Dalloca=__builtin_alloca
-CXXFLAGS.NetBSD+= -Dalloca=__builtin_alloca
-
-# Autotools is being phased out
-CONFIGURE_ARGS+= --enable-autotools
-
-pre-configure:
- touch ${WRKSRC}/src/glx/apple_dummy.cpp
-# cd ${WRKSRC} && autoreconf -vif
-
-DRIRC_DIR= ${PKG_SYSCONFDIR}/drirc.d
-EGDIR= ${PREFIX}/share/examples/mesa
-OWN_DIRS+= ${DRIRC_DIR}
-INSTALLATION_DIRS+= ${EGDIR}
-CONF_FILES+= ${EGDIR}/00-mesa-defaults.conf \
- ${DRIRC_DIR}/00-mesa-defaults.conf
-
-post-install:
- ${INSTALL_DATA} ${WRKSRC}/src/util/00-mesa-defaults.conf ${DESTDIR}${EGDIR}
-
-# FreeBSD bug 225414 --build-id=sha1 used by i965
-.if ${OPSYS} == "FreeBSD"
-PKG_LD= ${PREFIX}/bin/gld
-LDFLAGS+= -fuse-ld=${PKG_LD:Q}
-_WRAP_EXTRA_ARGS.CXX+= -fuse-ld=${PKG_LD:Q}
-CWRAPPERS_APPEND.cxx+= -fuse-ld=${PKG_LD:Q}
-.include "../../devel/binutils/buildlink3.mk"
-.endif
-
-# Meson
-CFLAGS+= -Wno-return-type
-.include "../../devel/meson/build.mk"
-
-.include "../../devel/zlib/buildlink3.mk"
-.include "../../x11/libXrandr/buildlink3.mk"
-.include "../../x11/libX11/buildlink3.mk"
-.include "../../x11/libXext/buildlink3.mk"
-.include "../../x11/libxcb/buildlink3.mk"
-.include "../../textproc/expat/buildlink3.mk"
-.include "../../mk/bsd.pkg.mk"
diff --git a/MesaLib-dfbsd-meson/PLIST b/MesaLib-dfbsd-meson/PLIST
deleted file mode 100644
index db0e7a81b0..0000000000
--- a/MesaLib-dfbsd-meson/PLIST
+++ /dev/null
@@ -1,131 +0,0 @@
-@comment $NetBSD: PLIST,v 1.5 2019/01/19 21:54:03 tnn Exp $
-${PLIST.egl}include/EGL/egl.h
-${PLIST.egl}include/EGL/eglext.h
-${PLIST.egl}include/EGL/eglextchromium.h
-${PLIST.egl}include/EGL/eglmesaext.h
-${PLIST.egl}include/EGL/eglplatform.h
-include/GL/gl.h
-include/GL/gl_mangle.h
-include/GL/glcorearb.h
-include/GL/glext.h
-include/GL/glx.h
-include/GL/glx_mangle.h
-include/GL/glxext.h
-${PLIST.osmesa}include/GL/osmesa.h
-${PLIST.dri}include/GL/internal/dri_interface.h
-${PLIST.glesv1}include/GLES/egl.h
-${PLIST.glesv1}include/GLES/gl.h
-${PLIST.glesv1}include/GLES/glext.h
-${PLIST.glesv1}include/GLES/glplatform.h
-${PLIST.glesv2}include/GLES2/gl2.h
-${PLIST.glesv2}include/GLES2/gl2ext.h
-${PLIST.glesv2}include/GLES2/gl2platform.h
-${PLIST.glesv2}include/GLES3/gl3.h
-${PLIST.glesv2}include/GLES3/gl31.h
-${PLIST.glesv2}include/GLES3/gl32.h
-${PLIST.glesv2}include/GLES3/gl3ext.h
-${PLIST.glesv2}include/GLES3/gl3platform.h
-include/KHR/khrplatform.h
-${PLIST.gbm}include/gbm.h
-${PLIST.vulkan}include/vulkan/vulkan_intel.h
-${PLIST.xatracker}include/xa_composite.h
-${PLIST.xatracker}include/xa_context.h
-${PLIST.xatracker}include/xa_tracker.h
-@comment ${PLIST.vaapi}lib/dri/gallium_drv_video.la
-@comment ${PLIST.vaapi}lib/dri/gallium_drv_video.so
-${PLIST.i915}lib/dri/i915_dri.so
-${PLIST.i965}lib/dri/i965_dri.so
-${PLIST.iris}lib/dri/iris_dri.so
-@comment ${PLIST.ilo}lib/dri/ilo_dri.so
-${PLIST.freedreno}lib/dri/kgsl_dri.so
-${PLIST.swrast}lib/dri/kms_swrast_dri.so
-${PLIST.freedreno}lib/dri/msm_dri.so
-${PLIST.nouveau}lib/dri/nouveau_dri.so
-${PLIST.nouveau_dri}lib/dri/nouveau_vieux_dri.so
-${PLIST.r200}lib/dri/r200_dri.so
-${PLIST.r300}lib/dri/r300_dri.so
-${PLIST.r600}lib/dri/r600_dri.so
-${PLIST.radeon_dri}lib/dri/radeon_dri.so
-${PLIST.radeonsi}lib/dri/radeonsi_dri.so
-${PLIST.swrast_dri}lib/dri/swrast_dri.so
-${PLIST.vc4}lib/dri/vc4_dri.so
-${PLIST.svga}lib/dri/vmwgfx_dri.so
-@comment ${PLIST.egl}lib/libEGL.la
-${PLIST.egl}lib/libEGL.so
-${PLIST.egl}lib/libEGL.so.1
-${PLIST.egl}lib/libEGL.so.1.0.0
-@comment lib/libGL.la
-lib/libGL.so
-lib/libGL.so.1
-lib/libGL.so.1.2.0
-@comment ${PLIST.glesv1}lib/libGLESv1_CM.la
-${PLIST.glesv1}lib/libGLESv1_CM.so
-${PLIST.glesv1}lib/libGLESv1_CM.so.1
-${PLIST.glesv1}lib/libGLESv1_CM.so.1.1.0
-@comment ${PLIST.glesv2}lib/libGLESv2.la
-${PLIST.glesv2}lib/libGLESv2.so
-${PLIST.glesv2}lib/libGLESv2.so.2
-${PLIST.glesv2}lib/libGLESv2.so.2.0.0
-@comment ${PLIST.osmesa}lib/libOSMesa.la
-${PLIST.osmesa}lib/libOSMesa.so
-${PLIST.osmesa}lib/libOSMesa.so.8
-${PLIST.osmesa}lib/libOSMesa.so.8.0.0
-${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so
-@comment ${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so.1
-@comment ${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so.1.0
-@comment ${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so.1.0.0
-${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so
-@comment ${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so.1
-@comment ${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so.1.0
-@comment ${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so.1.0.0
-@comment ${PLIST.gbm}lib/libgbm.la
-${PLIST.gbm}lib/libgbm.so
-${PLIST.gbm}lib/libgbm.so.1
-${PLIST.gbm}lib/libgbm.so.1.0.0
-@comment lib/libglapi.la
-lib/libglapi.so
-lib/libglapi.so.0
-lib/libglapi.so.0.0.0
-@comment ${PLIST.wayland}lib/libwayland-egl.la
-@comment ${PLIST.xatracker}lib/libxatracker.la
-${PLIST.xatracker}lib/libxatracker.so
-${PLIST.xatracker}lib/libxatracker.so.2
-${PLIST.xatracker}lib/libxatracker.so.2.5.0
-${PLIST.dri}lib/pkgconfig/dri.pc
-${PLIST.egl}lib/pkgconfig/egl.pc
-${PLIST.gbm}lib/pkgconfig/gbm.pc
-${PLIST.osmesa}lib/pkgconfig/osmesa.pc
-lib/pkgconfig/gl.pc
-${PLIST.glesv1}lib/pkgconfig/glesv1_cm.pc
-${PLIST.glesv2}lib/pkgconfig/glesv2.pc
-${PLIST.wayland}lib/pkgconfig/wayland-egl.pc
-${PLIST.xatracker}lib/pkgconfig/xatracker.pc
-@comment ${PLIST.vdpau}lib/vdpau/libvdpau_gallium.so
-${PLIST.nouveau}${PLIST.vdpau}lib/vdpau/libvdpau_nouveau.so
-${PLIST.nouveau}${PLIST.vdpau}lib/vdpau/libvdpau_nouveau.so.1
-${PLIST.nouveau}${PLIST.vdpau}lib/vdpau/libvdpau_nouveau.so.1.0
-${PLIST.nouveau}${PLIST.vdpau}lib/vdpau/libvdpau_nouveau.so.1.0.0
-${PLIST.vdpau}lib/vdpau/libvdpau_r300.so
-${PLIST.vdpau}lib/vdpau/libvdpau_r300.so.1
-${PLIST.vdpau}lib/vdpau/libvdpau_r300.so.1.0
-${PLIST.vdpau}lib/vdpau/libvdpau_r300.so.1.0.0
-${PLIST.vdpau}lib/vdpau/libvdpau_r600.so
-${PLIST.vdpau}lib/vdpau/libvdpau_r600.so.1
-${PLIST.vdpau}lib/vdpau/libvdpau_r600.so.1.0
-${PLIST.vdpau}lib/vdpau/libvdpau_r600.so.1.0.0
-${PLIST.vdpau}lib/vdpau/libvdpau_radeonsi.so
-${PLIST.vdpau}lib/vdpau/libvdpau_radeonsi.so.1
-${PLIST.vdpau}lib/vdpau/libvdpau_radeonsi.so.1.0
-${PLIST.vdpau}lib/vdpau/libvdpau_radeonsi.so.1.0.0
-@comment ${PLIST.vdpau}lib/dri/nouveau_drv_video.la
-${PLIST.nouveau}${PLIST.vaapi}lib/dri/nouveau_drv_video.so
-@comment ${PLIST.vdpau}lib/dri/r600_drv_video.la
-${PLIST.vaapi}lib/dri/r600_drv_video.so
-@comment ${PLIST.vdpau}lib/dri/radeonsi_drv_video.la
-${PLIST.vaapi}lib/dri/radeonsi_drv_video.so
-${PLIST.vulkan}lib/libvulkan_intel.la
-${PLIST.vulkan}lib/libvulkan_radeon.la
-${PLIST.vulkan}share/vulkan/icd.d/intel_icd.${MACHINE_ARCH}.json
-${PLIST.vulkan}share/vulkan/icd.d/radeon_icd.${MACHINE_ARCH}.json
-share/drirc.d/00-mesa-defaults.conf
-share/examples/mesa/00-mesa-defaults.conf
diff --git a/MesaLib-dfbsd-meson/TODO b/MesaLib-dfbsd-meson/TODO
deleted file mode 100644
index 06da5abeee..0000000000
--- a/MesaLib-dfbsd-meson/TODO
+++ /dev/null
@@ -1,11 +0,0 @@
-Copy port to graphics/MesaLib, do not install from wip.
-
-* See what can be done on NetBSD build for glesv1 and glesv2
-* See if libLLVM 3.9+ on FreeBSD can build nouveau
-* Test OSX quartz, check if bug 90311 patch needs regen
-* Test Solaris
-* Test Linux
-* 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/buildlink3.mk b/MesaLib-dfbsd-meson/buildlink3.mk
deleted file mode 100644
index 939ef86eb8..0000000000
--- a/MesaLib-dfbsd-meson/buildlink3.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-# $NetBSD: buildlink3.mk,v 1.2 2018/10/10 11:03:02 maya Exp $
-
-BUILDLINK_TREE+= MesaLib
-
-.if !defined(MESALIB_BUILDLINK3_MK)
-MESALIB_BUILDLINK3_MK:=
-
-BUILDLINK_API_DEPENDS.MesaLib+= MesaLib>=3.4.2
-BUILDLINK_ABI_DEPENDS.MesaLib+= MesaLib>=7.11.2
-BUILDLINK_PKGSRCDIR.MesaLib?= ../../graphics/MesaLib
-
-.include "../../mk/bsd.fast.prefs.mk"
-
-.if ${X11_TYPE} == "modular"
-BUILDLINK_ABI_DEPENDS.MesaLib+= MesaLib>=10.5.3
-# This is needed to avoid linking conflicting libstdc++ versions
-. if defined(USE_LANGUAGES) && !empty(USE_LANGUAGES:Mc++)
-GCC_REQD+= 4.2
-. endif
-.endif
-
-# See <http://developer.apple.com/qa/qa2007/qa1567.html>.
-.if ${X11_TYPE} == "native" && !empty(MACHINE_PLATFORM:MDarwin-[9].*-*)
-BUILDLINK_LDFLAGS.MesaLib+= -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
-.endif
-
-pkgbase:= MesaLib
-.include "../../mk/pkg-build-options.mk"
-
-.if ${X11_TYPE} == "native" && ${OPSYS} != "Cygwin" && exists(${X11BASE}/lib/pkgconfig/dri.pc)
-PKG_BUILD_OPTIONS.MesaLib+= dri
-.endif
-
-.if !empty(PKG_BUILD_OPTIONS.MesaLib:Mdri)
-. include "../../graphics/MesaLib/dri.mk"
-.endif
-
-.if ${X11_TYPE} == "modular" && !empty(PKG_BUILD_OPTIONS.MesaLib:Mdri) || \
- ${X11_TYPE} == "native" && exists(${X11BASE}/include/EGL/egl.h)
-MESALIB_SUPPORTS_EGL= yes
-.else
-MESALIB_SUPPORTS_EGL= no
-.endif
-
-.include "../../mk/pthread.buildlink3.mk"
-
-.include "../../x11/libXext/buildlink3.mk"
-.endif # MESALIB_BUILDLINK3_MK
-
-BUILDLINK_TREE+= -MesaLib
diff --git a/MesaLib-dfbsd-meson/builtin.mk b/MesaLib-dfbsd-meson/builtin.mk
deleted file mode 100644
index 71884e4b32..0000000000
--- a/MesaLib-dfbsd-meson/builtin.mk
+++ /dev/null
@@ -1,87 +0,0 @@
-# $NetBSD: builtin.mk,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-BUILTIN_PKG:= MesaLib
-
-BUILTIN_FIND_FILES_VAR:= H_MESALIB PC_GL
-BUILTIN_FIND_FILES.H_MESALIB= ${X11BASE}/include/GL/glx.h
-BUILTIN_FIND_FILES.PC_GL= ${X11BASE}/lib/pkgconfig/gl.pc
-BUILTIN_FIND_FILES.PC_GL+= ${X11BASE}/lib${LIBABISUFFIX}/pkgconfig/gl.pc
-
-.include "../../mk/buildlink3/bsd.builtin.mk"
-
-###
-### Determine if there is a built-in implementation of the package and
-### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
-###
-.if !defined(IS_BUILTIN.MesaLib)
-. if empty(PC_GL:M__nonexistent__)
-IS_BUILTIN.MesaLib= yes
-. elif empty(H_MESALIB:M__nonexistent__)
-IS_BUILTIN.MesaLib= yes
-. else
-IS_BUILTIN.MesaLib= no
-. endif
-.endif
-MAKEVARS+= IS_BUILTIN.MesaLib
-
-###
-### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
-### a package name to represent the built-in package.
-###
-.if !defined(BUILTIN_PKG.MesaLib) && \
- !empty(IS_BUILTIN.MesaLib:M[yY][eE][sS])
-. if empty(PC_GL:M__nonexistent__)
-BUILTIN_VERSION.Mesa!= ${SED} -n -e 's/Version: //p' ${PC_GL}
-. elif empty(H_MESALIB:M__nonexistent__)
-. include "../../graphics/Mesa/version.mk"
-. else # ?
-BUILTIN_VERSION.Mesa:= 0.something-weird-happened
-. endif
-BUILTIN_PKG.MesaLib= MesaLib-${BUILTIN_VERSION.Mesa}
-MAKEVARS+= BUILTIN_VERSION.Mesa
-.endif
-MAKEVARS+= BUILTIN_PKG.MesaLib
-
-###
-### Determine whether we should use the built-in implementation if it
-### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
-###
-.if !defined(USE_BUILTIN.MesaLib)
-. if ${PREFER.MesaLib} == "pkgsrc"
-USE_BUILTIN.MesaLib= no
-. else
-USE_BUILTIN.MesaLib= ${IS_BUILTIN.MesaLib}
-. if defined(BUILTIN_PKG.MesaLib) && \
- !empty(IS_BUILTIN.MesaLib:M[yY][eE][sS])
-USE_BUILTIN.MesaLib= yes
-. for dep in ${BUILDLINK_API_DEPENDS.MesaLib}
-. if !empty(USE_BUILTIN.MesaLib:M[yY][eE][sS])
-USE_BUILTIN.MesaLib!= \
- if ${PKG_ADMIN} pmatch ${dep:Q} ${BUILTIN_PKG.MesaLib}; then \
- ${ECHO} yes; \
- else \
- ${ECHO} no; \
- fi
-. endif
-. endfor
-. endif
-. endif # PREFER.MesaLib
-.endif
-MAKEVARS+= USE_BUILTIN.MesaLib
-
-###
-### The section below only applies if we are not including this file
-### solely to determine whether a built-in implementation exists.
-###
-CHECK_BUILTIN.MesaLib?= no
-.if !empty(CHECK_BUILTIN.MesaLib:M[nN][oO])
-
-. if !empty(USE_BUILTIN.MesaLib:M[nN][oO])
-. include "../../mk/pthread.buildlink3.mk"
-. include "../../mk/pthread.builtin.mk"
-BUILTIN_PKG:= MesaLib
-. endif
-
-. include "../../mk/x11.builtin.mk"
-
-.endif # CHECK_BUILTIN.MesaLib
diff --git a/MesaLib-dfbsd-meson/distinfo b/MesaLib-dfbsd-meson/distinfo
deleted file mode 100644
index a0abd0ed49..0000000000
--- a/MesaLib-dfbsd-meson/distinfo
+++ /dev/null
@@ -1,79 +0,0 @@
-$NetBSD: distinfo,v 1.17 2019/05/01 19:31:45 maya Exp $
-
-RMD160 (mesa-f53ebfb4503a1ae054539df1c414b86c3b1966d9.tar.xz) = d8ee9a49ed6058776c7f3d44c172ea9f3e623a63
-SHA512 (mesa-f53ebfb4503a1ae054539df1c414b86c3b1966d9.tar.xz) = 71898f7f4d5d033f9337622988b62770849d45bb6d16e2a4a852dd349b9401cd86f09479f959d64617b8eb98b0addca23a6cb1bd61192a7fd123c4ef975838a3
-Size (mesa-f53ebfb4503a1ae054539df1c414b86c3b1966d9.tar.xz) = 11010392 bytes
-SHA1 (patch-include_GL_internal_dri__interface.h) = ed567949ae44f7477738138347cf9648b9a8d634
-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) = 2eef90c3139ffa8349f5960eb328b7df3071a45c
-SHA1 (patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c) = 1fe81a7b16e36dc9125400c20543271216a33a45
-SHA1 (patch-src_compiler_builtin__type__macros.h) = 128030d0c532e5f3982dc6ebde1957fc0ca7f5d5
-SHA1 (patch-src_compiler_glsl_glsl__parser__extras.cpp) = ef114d6e288e6d212fce9d1c0606f7d454a171c4
-SHA1 (patch-src_egl_drivers_dri2_platform__drm.c) = e18e7b1ffbc74b8acf3d9095a92c750f9d005479
-SHA1 (patch-src_egl_drivers_dri2_platform__x11.c) = 1b8c7689b18643777d494bbb491866ed0041155d
-SHA1 (patch-src_egl_main_eglglobals.c) = c8db1469859d448635f96a0eac1a936104cd0fdd
-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_util_u__format__tests.c) = d878e6f3e9a0a37d4903c0d0551f9fa535635d40
-SHA1 (patch-src_gallium_drivers_freedreno_freedreno__screen.c) = b19e93b1612d6eacccf35260110db9402eb4edca
-SHA1 (patch-src_gallium_drivers_iris_meson.build) = 31f0afab5212860917fe78e2b282a730187502ef
-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
-SHA1 (patch-src_gallium_drivers_radeonsi_si__compute__blit.c) = 86ba535e10a1d692877782cef6a1ec4aafeec4c7
-SHA1 (patch-src_gallium_drivers_radeonsi_si__dma__cs.c) = 3c6a2a49e40dd8f99f5f393ad6e03345111cdeb1
-SHA1 (patch-src_gallium_drivers_radeonsi_si__gfx__cs.c) = 98ca07e2cc518125e5ec8924cbadc19f4c13de56
-SHA1 (patch-src_gallium_drivers_radeonsi_si__pipe.c) = de016f03468ff7607543cb1587180b7e9893e560
-SHA1 (patch-src_gallium_drivers_radeonsi_si__state__shaders.c) = ed51a57765f2349bc91fd509dc03e709241bd899
-SHA1 (patch-src_gallium_drivers_vc4_vc4__bufmgr.c) = 1d591d346486fdf58893f69ab92a272e6a31a987
-SHA1 (patch-src_gallium_include_pipe_p__config.h) = f4e38eac66167b619c30076bb0144dd716310967
-SHA1 (patch-src_gallium_state__trackers_clover_llvm_invocation.cpp) = 3053db09fbfffffd82e232b60b244a0a80c8f181
-SHA1 (patch-src_gallium_state__trackers_clover_llvm_metadata.hpp) = c97d38098ea03658bc193a50e445b87f1c020839
-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_glx_apple_apple__glapi.c) = c4eea8dabf74eb03d22da4eb834b18ae3384c63b
-SHA1 (patch-src_glx_dri__common.h) = 0274877f8c65a4bb729536a897df4704897a4c6e
-SHA1 (patch-src_glx_dri__glx.c) = 8fd48776e9953b18bd17ba130d90ae2935e67242
-SHA1 (patch-src_glx_glxclient.h) = 5e597362c3839f26118fe98983701f33d6047cfd
-SHA1 (patch-src_glx_glxcurrent.c) = 67142b977aadf23b0b0d3a06db3d9450e0b7f892
-SHA1 (patch-src_glx_glxext.c) = 15c2c5e0c6b5095ce849fb86ad148aa05d7d907a
-SHA1 (patch-src_intel_compiler_brw__fs__bank__conflicts.cpp) = 6276d2c6846bb4dd08699921bec4e20202a17478
-SHA1 (patch-src_intel_isl_isl__tiled__memcpy.c) = f019e47e535e2c2ab8d324937362a4c7965311f1
-SHA1 (patch-src_intel_perf_gen__perf.h) = 2915eb9dc7161d74d73b8e238dc1f0d0d9b82935
-SHA1 (patch-src_intel_tools_aub__mem.c) = fe7f8315515618e2becfa5279de613bca200dbf8
-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) = da5a11c95d17d6476e7141572264a215807b8cd7
-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) = ad5a4bd9fe521cf73faf2f0cf0f493a0b40f4c20
-SHA1 (patch-src_intel_vulkan_anv__queue.c) = 2dbf7dfd0c77f74f510032bf8d12109f58c50a30
-SHA1 (patch-src_mapi_entry__x86-64__tls.h) = a0cbe5c8412fa626926ade0c72c6bc13b1ab4f36
-SHA1 (patch-src_mapi_entry__x86__tls.h) = 740312f64e4848164482f44642859aecc7025853
-SHA1 (patch-src_mapi_entry__x86__tsd.h) = 52d0197fb7b84382147aca98f8cccf24892a9df3
-SHA1 (patch-src_mapi_glapi_gen_gl__gentable.py) = 0b1d4ef3f78a9b3726ef7f9921608a48a5e4ac56
-SHA1 (patch-src_mapi_u__current.c) = bee667c667bb1bd6e3b0f774d6ad6da5b7f0546d
-SHA1 (patch-src_mapi_u__current.h) = 13e91936db8d468c4f4744eb5cc01ad879b53539
-SHA1 (patch-src_mesa_drivers_dri_i915_intel__screen.c) = fb9324dcbc8ffbc00bee6aedcc38db2e94b24f9d
-SHA1 (patch-src_mesa_drivers_dri_i965_brw__bufmgr.c) = ad0fc0cacf59dde38d18f9ceb93411105cdd6c89
-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_main_context.c) = 441026b8f073fd90f2586dfb306482feed6c6834
-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
-SHA1 (patch-src_mesa_x86_common__x86.c) = f8c4b93443ef66d017f6aa114b877565b30f2598
-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__process.c) = 4f905ab7c812ac3f48165857dbc40455879c9f4b
-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/dri.mk b/MesaLib-dfbsd-meson/dri.mk
deleted file mode 100644
index a11deee6cf..0000000000
--- a/MesaLib-dfbsd-meson/dri.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# $NetBSD: dri.mk,v 1.2 2019/04/11 16:27:03 maya Exp $
-#
-# Currently, this is for convenience only.
-#
-.if !defined(DRI_MK)
-DRI_MK= # defined
-
-.if !defined(USE_BUILTIN.MesaLib)
-CHECK_BUILTIN.MesaLib:= yes
-. include "../../graphics/MesaLib/builtin.mk"
-CHECK_BUILTIN.MesaLib:= no
-.endif
-
-.if !empty(USE_BUILTIN.MesaLib:M[Nn][Oo])
-. if ${OPSYS} != "Darwin"
-BUILDLINK_API_DEPENDS.libdrm+= libdrm>=2.4.60
-. endif
-. if ${OPSYS} == "Linux"
-BUILDLINK_API_DEPENDS.libxcb+= libxcb>=1.9.3
-. endif
-.endif
-.include "../../x11/xorgproto/buildlink3.mk"
-# XXX these do not have builtin.mk
-.if ${X11_TYPE} == "modular"
-. include "../../x11/libxshmfence/buildlink3.mk"
-.endif
-.include "../../x11/libXdamage/buildlink3.mk"
-.include "../../x11/libXfixes/buildlink3.mk"
-.include "../../x11/libXxf86vm/buildlink3.mk"
-.if ${OPSYS} != "Darwin"
-. include "../../x11/libdrm/buildlink3.mk"
-.endif
-.endif
diff --git a/MesaLib-dfbsd-meson/options.mk b/MesaLib-dfbsd-meson/options.mk
deleted file mode 100644
index f6ca704014..0000000000
--- a/MesaLib-dfbsd-meson/options.mk
+++ /dev/null
@@ -1,533 +0,0 @@
-# $NetBSD: options.mk,v 1.12 2019/04/11 16:27:03 maya Exp $
-
-PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib
-PKG_SUPPORTED_OPTIONS= llvm dri
-PKG_SUGGESTED_OPTIONS=
-
-PKG_SUPPORTED_OPTIONS+= glx-tls xvmc debug
-PKG_SUPPORTED_OPTIONS+= vdpau vaapi
-PKG_SUPPORTED_OPTIONS+= osmesa
-PKG_SUPPORTED_OPTIONS+= glesv1 glesv2
-PKG_SUPPORTED_OPTIONS+= xa
-PKG_SUPPORTED_OPTIONS+= asm
-PKG_SUPPORTED_OPTIONS+= noatexit
-PKG_SUPPORTED_OPTIONS+= iris
-PKG_SUGGESTED_OPTIONS+= iris
-PKG_SUPPORTED_OPTIONS+= vulkan
-
-PKG_SUPPORTED_OPTIONS+= test_dri3_enable
-PKG_SUPPORTED_OPTIONS+= no_render_node
-PKG_SUPPORTED_OPTIONS+= use_clock_nanosleep_os_time
-PKG_SUPPORTED_OPTIONS+= use_pthread_getcpuclockid
-
-PKG_SUPPORTED_OPTIONS+= revert_i965_softpin
-PKG_SUPPORTED_OPTIONS+= revert_sdma_uploader
-PKG_SUPPORTED_OPTIONS+= require_36_gen4
-
-PKG_SUPPORTED_OPTIONS+= physmem_netbsd
-PKG_SUPPORTED_OPTIONS+= setaffinity_np_netbsd
-PKG_SUPPORTED_OPTIONS+= no_initial_exec_nonnull
-
-PKG_SUPPORTED_OPTIONS+= no_cs_queue
-PKG_SUPPORTED_OPTIONS+= revert_threaded_context
-PKG_SUPPORTED_OPTIONS+= revert_copy_clear
-
-PKG_SUPPORTED_OPTIONS+= no_getprogramname
-PKG_SUPPORTED_OPTIONS+= strict_xsrc_netbsd
-
-PKG_SUPPORTED_OPTIONS+= x86_tsd_openbsd
-PKG_SUPPORTED_OPTIONS+= no_linear_alloc_destructor
-
-PKG_SUGGESTED_OPTIONS+= xvmc
-PKG_SUGGESTED_OPTIONS+= vdpau vaapi
-
-PKG_SUGGESTED_OPTIONS+= osmesa
-
-# glesv1 and glesv2 build error on NetBSD
-# due to no table_noop_array for tls patch
-.if ${OPSYS} != "NetBSD"
-PKG_SUGGESTED_OPTIONS+= glesv1 glesv2
-.endif
-
-PKG_SUGGESTED_OPTIONS+= xa
-
-PKG_SUGGESTED_OPTIONS+= asm
-
-# .if ${OPSYS} == "NetBSD"
-# PKG_SUGGESTED_OPTIONS+= noatexit
-# .endif
-
-# The LLVM option enables JIT accelerated software rendering and
-# is also required to support the latest RADEON GPUs, so enable it
-# by default on platforms where such GPUs might be encountered.
-.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \
- ${OPSYS} != "SunOS" && ${OPSYS} != "Darwin" && \
- !(${OPSYS} == "NetBSD" && ${X11_TYPE} == "native")
-PKG_SUGGESTED_OPTIONS+= llvm
-.endif
-
-.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "OpenBSD" || \
- ${OPSYS} == "DragonFly" || ${OPSYS} == "Linux" || \
- ${OPSYS} == "SunOS" || ${OPSYS} == "Darwin" || \
- (${OPSYS} == "NetBSD" && ${X11_TYPE} == "modular")
-PKG_SUGGESTED_OPTIONS+= dri
-.endif
-
-# Use Thread Local Storage in GLX where it is supported by Mesa and works.
-.if \
- !empty(MACHINE_PLATFORM:MNetBSD-[789].*-i386) || \
- !empty(MACHINE_PLATFORM:MNetBSD-[789].*-x86_64) || \
- !empty(MACHINE_PLATFORM:MLinux-*-i386) || \
- !empty(MACHINE_PLATFORM:MLinux-*-x86_64) || \
- !empty(MACHINE_PLATFORM:MFreeBSD-1[0-9].*-x86_64) || \
- !empty(MACHINE_PLATFORM:MDragonFly-*-x86_64)
-PKG_SUGGESTED_OPTIONS+= glx-tls
-.endif
-
-.if ${OPSYS} == "DragonFly" || ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+= test_dri3_enable
-.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} == "DragonFly"
-PKG_SUGGESTED_OPTIONS+= revert_i965_softpin
-PKG_SUGGESTED_OPTIONS+= revert_sdma_uploader
-.endif
-
-# Require Linux 3.6+ intel support for ge4+
-.if ${OPSYS} == "FreeBSD"
-PKG_SUGGESTED_OPTIONS+= require_36_gen4
-.endif
-
-.if ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+= physmem_netbsd
-.endif
-
-.if ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+= setaffinity_np_netbsd
-.endif
-
-.if ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+= no_initial_exec_nonnull
-.endif
-
-.if ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+= no_cs_queue
-PKG_SUGGESTED_OPTIONS+= revert_threaded_context
-PKG_SUGGESTED_OPTIONS+= revert_copy_clear
-.endif
-
-# .if ${OPSYS} == "NetBSD"
-# PKG_SUGGESTED_OPTIONS+= no_getprogramname
-# .endif
-
-# .if ${OPSYS} == "NetBSD"
-# PKG_SUGGESTED_OPTIONS+= strict_xsrc_netbsd
-# .endif
-
-# OpenBSD xenocara tsd dispatch assembly for entry_x86_tsd.h
-.if ${OPSYS} == "OpenBSD"
-PKG_SUGGESTED_OPTIONS+= x86_tsd_openbsd
-.endif
-
-.if ${OPSYS} == "OpenBSD"
-PKG_SUGGESTED_OPTIONS+= no_linear_alloc_destructor
-.endif
-
-.include "../../mk/bsd.options.mk"
-
-# gallium
-PLIST_VARS+= freedreno i915 i965 nouveau r300 r600 radeonsi \
- swrast svga vc4 virgl vulkan iris
-# classic DRI
-PLIST_VARS+= dri swrast_dri nouveau_dri radeon_dri r200
-# other features
-PLIST_VARS+= egl gbm vaapi vdpau wayland xatracker
-PLIST_VARS+= osmesa xvmc
-PLIST_VARS+= glesv1 glesv2
-
-.if !empty(PKG_OPTIONS:Mdri)
-
-CONFIGURE_ARGS+= --enable-dri
-
-# Having DRI3 and egl compiled in by default doesn't hurt, the X server
-# will only use it if it is supported at run time.
-CONFIGURE_ARGS+= --enable-dri3
-MESON_ARGS+= -Ddri3=true
-. if ${OPSYS} != "Darwin"
-CONFIGURE_ARGS+= --enable-egl
-CONFIGURE_ARGS+= --enable-gbm
-MESON_ARGS+= -Degl=true
-MESON_ARGS+= -Dgbm=true
-PLIST.egl= yes
-PLIST.gbm= yes
-. else
-CONFIGURE_ARGS+= --disable-egl
-CONFIGURE_ARGS+= --disable-gbm
-MESON_ARGS+= -Degl=false
-MESON_ARGS+= -Dgbm=false
-. endif
-
-. if !empty(PKG_OPTIONS:Mosmesa)
-CONFIGURE_ARGS+= --enable-osmesa
-MESON_ARGS+= -Dosmesa=gallium
-PLIST.osmesa= yes
-. endif
-
-. if !empty(PKG_OPTIONS:Mglesv1)
-CONFIGURE_ARGS+= --enable-gles1
-MESON_ARGS+= -Dgles1=true
-PLIST.glesv1= yes
-. else
-CONFIGURE_ARGS+= --disable-gles1
-MESON_ARGS+= -Dgles1=false
-. endif
-
-. if !empty(PKG_OPTIONS:Mglesv2)
-CONFIGURE_ARGS+= --enable-gles2
-MESON_ARGS+= -Dgles2=true
-PLIST.glesv2= yes
-. else
-CONFIGURE_ARGS+= --disable-gles2
-MESON_ARGS+= -Dgles2=false
-. endif
-
-. if !empty(PKG_OPTIONS:Mglx-tls)
-# 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
-CONFIGURE_ARGS.Linux+= --enable-sysfs
-
-PLIST.dri= yes
-
-. if ${OPSYS} != "Darwin"
-BUILDLINK_DEPMETHOD.libpciaccess= full
-.include "../../sysutils/libpciaccess/buildlink3.mk"
-. endif
-.include "../../graphics/MesaLib/dri.mk"
-
-DRI_DRIVERS= #
-GALLIUM_DRIVERS= #
-VULKAN_DRIVERS= #
-
-# Software rasterizer
-# From meson.build
-# if with_dri_swrast and (with_gallium_softpipe or with_gallium_swr)
-# error('Only one swrast provider can be built')
-# endif
-PLIST.swrast_dri= yes
-. if ${OPSYS} != "Darwin"
-PLIST.swrast= yes
-GALLIUM_DRIVERS+= swrast
-. else
-DRI_DRIVERS+= swrast
-. endif
-
-# x86 only drivers
-. if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && ${OPSYS} != "Darwin"
-# svga / VMWare driver
-PLIST.svga= yes
-GALLIUM_DRIVERS+= svga
-
-# Intel chipsets, x86 only
-# From meson.build:
-# if with_dri_i915 and with_gallium_i915
-# error('Only one i915 provider can be built')
-# endif
-PLIST.i915= yes
-# GALLIUM_DRIVERS+= i915
-DRI_DRIVERS+= i915
-
-PLIST.i965= yes
-DRI_DRIVERS+= i965
-
-. endif
-
-# Intel Iris support
-. if !empty(PKG_OPTIONS:Miris)
-GALLIUM_DRIVERS+= iris
-PLIST.iris= yes
-. endif
-
-# Vulkan support
-. if !empty(PKG_OPTIONS:Mvulkan)
-# VULKAN_DRIVERS+= intel
-# VULKAN_DRIVERS+= radeon
-VULKAN_DRIVERS+= auto
-PLIST.vulkan= yes
-. endif
-
-# ARM drivers
-. if !empty(MACHINE_PLATFORM:MNetBSD-*-*arm*)
-# Qualcomm SnapDragon, libdrm_freedreno.pc
-#GALLIUM_DRIVERS+= freedreno
-#PLIST.freedreno= yes
-
-# Broadcom VideoCore 4
-GALLIUM_DRIVERS+= vc4
-PLIST.vc4= yes
-. endif
-
-# qemu Linux guest driver
-. if !empty(MACHINE_PLATFORM:MLinux-*-x86_64)
-# XXX test this
-#GALLIUM_DRIVERS+= virgl
-#PLIST.virgl= yes
-. endif
-
-# theoretically cross platform PCI drivers
-. if ${OPSYS} != "Darwin" && empty(MACHINE_PLATFORM:MNetBSD-*-*arm*) && \
- empty(MACHINE_PLATFORM:MNetBSD-*-mipsel)
-
-# AMD Radeon r600
-PLIST.r600= yes
-GALLIUM_DRIVERS+= r600
-
-# FULL_OS_VERSION_CMD= ${UNAME} -r
-# FULL_OS_VERSION= ${FULL_OS_VERSION_CMD:sh}
-
-# FreeBSD lacks nouveau support (there are official binaries from Nvidia)
-. if ${OPSYS} != "FreeBSD"
-# nVidia
-PLIST.nouveau= yes
-GALLIUM_DRIVERS+= nouveau
-. endif
-
-# Meson build does not compile these correctly anymore.
-# classic DRI radeon
-# PLIST.radeon_dri= yes
-# DRI_DRIVERS+= radeon
-
-# classic DRI r200
-PLIST.r200= yes
-DRI_DRIVERS+= r200
-
-# FreeBSD lacks nouveau support (there are official binaries from Nvidia)
-. if ${OPSYS} != "FreeBSD"
-# classic DRI nouveau
-PLIST.nouveau_dri= yes
-DRI_DRIVERS+= nouveau
-. endif
-. endif # cross platform PCI drivers
-
-. if ${OPSYS} == "Darwin"
-CONFIGURE_ARGS+= --with-platforms=x11
-MESON_ARGS+= -Dplatforms=x11
-#.elif ${OPSYS} == "Linux"
-#.include "../../devel/wayland/buildlink3.mk"
-#CONFIGURE_ARGS+= --with-platforms=x11,drm,wayland
-#PLIST.wayland= yes
-. else
-CONFIGURE_ARGS+= --with-platforms=x11,drm
-MESON_ARGS+= -Dplatforms=x11,drm
-. endif
-
-. if !empty(PKG_OPTIONS:Mllvm)
-# VA-API and VDPAU
-. if !empty(PKG_OPTIONS:Mvaapi)
-.include "../../multimedia/libva/available.mk"
-. if ${VAAPI_AVAILABLE} == "yes"
-PLIST.vaapi= yes
-.include "../../multimedia/libva/buildlink3.mk"
-MESON_ARGS+= -Dgallium-va=true
-. else
-MESON_ARGS+= -Dgallium-va=false
-. endif
-. endif # vaapi
-. if !empty(PKG_OPTIONS:Mvdpau)
-.include "../../multimedia/libvdpau/available.mk"
-. if ${VDPAU_AVAILABLE} == "yes"
-PLIST.vdpau= yes
-.include "../../multimedia/libvdpau/buildlink3.mk"
-MESON_ARGS+= -Dgallium-vdpau=true
-. else
-MESON_ARGS+= -Dgallium-vdpau=false
-. endif
-. endif # vdpau
-
-# XA is useful for accelerating xf86-video-vmware
-. if !empty(PKG_OPTIONS:Mxa)
-CONFIGURE_ARGS+= --enable-xa
-MESON_ARGS+= -Dgallium-xa=true
-PLIST.xatracker= yes
-. else
-MESON_ARGS+= -Dgallium-xa=false
-. endif
-
-# AMD Radeon r300
-PLIST.r300= yes
-GALLIUM_DRIVERS+= r300
-# AMD Canary Islands GPUs
-PLIST.radeonsi= yes
-GALLIUM_DRIVERS+= radeonsi
-CONFIGURE_ARGS+= --enable-llvm
-CONFIGURE_ARGS+= --enable-llvm-shared-libs
-MESON_ARGS+= -Dllvm=true
-MESON_ARGS+= -Dshared-llvm=true
-
-. if !exists(/usr/include/libelf.h)
-.include "../../devel/libelf/buildlink3.mk"
-. endif
-
-# XXX update libLLVM to use it instead
-#BUILDLINK_API_DEPENDS.libLLVM+= libLLVM>=5.0
-.include "../../lang/llvm/buildlink3.mk"
-
-# BUILDLINK_API_DEPENDS.libLLVM+= libLLVM>=4.0
-# .include "../../lang/libLLVM/buildlink3.mk"
-CONFIGURE_ENV+= ac_cv_path_ac_pt_LLVM_CONFIG=${LLVM_CONFIG_PATH}
-. else # !llvm
-CONFIGURE_ARGS+= --disable-xa
-CONFIGURE_ARGS+= --disable-llvm
-CONFIGURE_ARGS+= --disable-llvm-shared-libs
-MESON_ARGS+= -Dgallium-xa=false
-MESON_ARGS+= -Dllvm=false
-MESON_ARGS+= -Dshared-llvm=false
-. endif # llvm
-
-CONFIGURE_ARGS+= --with-gallium-drivers=${GALLIUM_DRIVERS:ts,}
-CONFIGURE_ARGS+= --with-dri-drivers=${DRI_DRIVERS:ts,}
-CONFIGURE_ARGS+= --with-vulkan-drivers=${VULKAN_DRIVERS:ts,}
-MESON_ARGS+= -Dgallium-drivers=${GALLIUM_DRIVERS:ts,}
-MESON_ARGS+= -Ddri-drivers=${DRI_DRIVERS:ts,}
-MESON_ARGS+= -Dvulkan-drivers=${VULKAN_DRIVERS:ts,}
-
-.else # !dri
-CONFIGURE_ARGS+= --with-gallium-drivers=
-CONFIGURE_ARGS+= --with-dri-drivers=
-CONFIGURE_ARGS+= --with-vulkan-drivers=
-CONFIGURE_ARGS+= --disable-dri
-CONFIGURE_ARGS+= --disable-dri3
-CONFIGURE_ARGS+= --disable-egl
-CONFIGURE_ARGS+= --disable-gbm
-CONFIGURE_ARGS+= --disable-gles1
-CONFIGURE_ARGS+= --disable-gles2
-CONFIGURE_ARGS+= --enable-xlib-glx
-CONFIGURE_ARGS+= --with-platforms=x11
-MESON_ARGS+= -Dgallium-drivers=
-MESON_ARGS+= -Ddri-drivers=
-MESON_ARGS+= -Ddri3=false
-MESON_ARGS+= -Degl=false
-MESON_ARGS+= -Dgbm=false
-MESON_ARGS+= -Dgles1=false
-MESON_ARGS+= -Dgles2=false
-MESON_ARGS+= -Dglx=xlib
-MESON_ARGS+= -Dplatforms=x11
-. if !empty(PKG_OPTIONS:Mllvm)
-PKG_FAIL_REASON+= "The llvm PKG_OPTION must also be disabled when dri is disabled"
-. endif
-.endif # dri
-
-.if !empty(PKG_OPTIONS:Mdebug)
-CONFIGURE_ARGS+= --enable-debug
-MESON_ARGS+= --buildtype=debug
-.endif
-
-.if !empty(PKG_OPTIONS:Masm)
-.else
-MESON_ARGS+= -Dasm=false
-.endif
-
-.if !empty(PKG_OPTIONS:Mxvmc)
-.include "../../x11/libXvMC/buildlink3.mk"
-PLIST.xvmc= yes
-MESON_ARGS+= -Dgallium-xvmc=true
-.else
-MESON_ARGS+= -Dgallium-xvmc=false
-.endif
-
-.if !empty(PKG_OPTIONS:Mnoatexit)
-CPPFLAGS+= -DHAVE_NOATEXIT
-.endif
-
-.if !empty(PKG_OPTIONS:Mtest_dri3_enable)
-CPPFLAGS+= -DTEST_DRI3_ENABLE
-.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:Mrevert_i965_softpin)
-CPPFLAGS+= -DREVERT_I965_SOFTPIN
-.endif
-
-.if !empty(PKG_OPTIONS:Mrevert_sdma_uploader)
-CPPFLAGS+= -DREVERT_SDMA_UPLOADER
-.endif
-
-.if !empty(PKG_OPTIONS:Mrequire_36_gen4)
-CPPFLAGS+= -DREQUIRE_36_GEN4
-.endif
-
-.if !empty(PKG_OPTIONS:Mphysmem_netbsd)
-CPPFLAGS+= -DPHYSMEM_NETBSD
-.endif
-
-.if !empty(PKG_OPTIONS:Msetaffinity_np_netbsd)
-CPPFLAGS+= -DSETAFFINITY_NP_NETBSD
-.endif
-
-.if !empty(PKG_OPTIONS:Mno_initial_exec_nonnull)
-CPPFLAGS+= -DNO_INITIAL_EXEC_NONNULL
-.endif
-
-.if !empty(PKG_OPTIONS:Mno_cs_queue)
-CPPFLAGS+= -DNO_CS_QUEUE
-.endif
-
-.if !empty(PKG_OPTIONS:Mrevert_threaded_context)
-CPPFLAGS+= -DREVERT_THREADED_CONTEXT
-.endif
-
-.if !empty(PKG_OPTIONS:Mrevert_copy_clear)
-CPPFLAGS+= -DREVERT_COPY_CLEAR
-.endif
-
-.if !empty(PKG_OPTIONS:Mno_getprogramname)
-CPPFLAGS+= -DNO_GETPROGRAMNAME
-.endif
-
-.if !empty(PKG_OPTIONS:Mstrict_xsrc_netbsd)
-CPPFLAGS+= -DSTRICT_XSRC_NETBSD
-.endif
-
-.if !empty(PKG_OPTIONS:Mx86_tsd_openbsd)
-CPPFLAGS+= -DX86_TSD_OPENBSD
-.endif
-
-.if !empty(PKG_OPTIONS:Mno_linear_alloc_destructor)
-CPPFLAGS+= -DNO_LINEAR_ALLOC_DESTRUCTOR
-.endif
diff --git a/MesaLib-dfbsd-meson/patches/patch-include_GL_internal_dri__interface.h b/MesaLib-dfbsd-meson/patches/patch-include_GL_internal_dri__interface.h
deleted file mode 100644
index 11359697e9..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-include_GL_internal_dri__interface.h
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-include_GL_internal_dri__interface.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-From FreeBSD ports graphics/mesa-dri 17.2.4.
-
-GCC on 9.x doesn't allow types to be overwritten, these types are defined
-in drm.h also, which causes build issues in xorg-server.
-
-From NetBSD xsrc: prevent re-definitions from drm.h
-
---- include/GL/internal/dri_interface.h.orig 2019-04-17 22:16:19.000000000 +0000
-+++ include/GL/internal/dri_interface.h
-@@ -40,13 +40,19 @@
- #ifndef DRI_INTERFACE_H
- #define DRI_INTERFACE_H
-
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+#include <drm.h>
-+#else
- #ifdef HAVE_LIBDRM
- #include <drm.h>
- #else
-+#if !defined(_DRM_H_) || !defined(STRICT_XSRC_NETBSD)
- typedef unsigned int drm_context_t;
- typedef unsigned int drm_drawable_t;
- typedef struct drm_clip_rect drm_clip_rect_t;
- #endif
-+#endif
-+#endif /* __FreeBSD__ || __DragonFly__ */
-
- #include <GL/gl.h>
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-meson.build b/MesaLib-dfbsd-meson/patches/patch-meson.build
deleted file mode 100644
index 9c28e59102..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-meson.build
+++ /dev/null
@@ -1,63 +0,0 @@
-$NetBSD$
-
---- 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')
- 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')
-@@ -343,7 +344,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')
-@@ -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')
--if dep_thread.found() and host_machine.system() != 'windows'
-+if dep_thread.found() and ['freebsd', 'dragonfly'].contains(host_machine.system())
-+ pre_args += '-DHAVE_PTHREAD'
-+ if cc.has_function(
-+ 'pthread_setaffinity_np',
-+ dependencies : dep_thread,
-+ prefix : '#include <pthread_np.h>')
-+ pre_args += '-DHAVE_PTHREAD_SETAFFINITY'
-+ endif
-+elif dep_thread.found() and host_machine.system() != 'windows'
- pre_args += '-DHAVE_PTHREAD'
- if cc.has_function(
- 'pthread_setaffinity_np',
diff --git a/MesaLib-dfbsd-meson/patches/patch-meson__options.txt b/MesaLib-dfbsd-meson/patches/patch-meson__options.txt
deleted file mode 100644
index c5b1045103..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-meson__options.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-$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_amd_common_ac__debug.c b/MesaLib-dfbsd-meson/patches/patch-src_amd_common_ac__debug.c
deleted file mode 100644
index ec2e68097e..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_amd_common_ac__debug.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_amd_common_ac__debug.c,v 1.2 2019/01/20 09:50:28 tnn Exp $
-
-#if'out some debug code on SunOS. There is no open_memstream(3)
-
---- src/amd/common/ac_debug.c.orig 2019-01-17 11:26:22.000000000 +0000
-+++ src/amd/common/ac_debug.c
-@@ -571,10 +571,12 @@ void ac_parse_ib_chunk(FILE *f, uint32_t
-
- char *out;
- size_t outsize;
-+#if defined(HAVE_OPEN_MEMSTREAM)
- FILE *memf = open_memstream(&out, &outsize);
- ib.f = memf;
- ac_do_parse_ib(memf, &ib);
- fclose(memf);
-+#endif
-
- if (out) {
- format_ib_output(f, out);
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
deleted file mode 100644
index f0ec6ea1be..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_amd_vulkan_radv__device.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD$
-
-From graphics/mesa-dri: update to 18.3.1
-
-https://reviews.freebsd.org/D17872
-
---- src/amd/vulkan/radv_device.c.orig 2019-04-23 23:49:39.000000000 +0000
-+++ src/amd/vulkan/radv_device.c
-@@ -51,6 +51,14 @@
- #include "compiler/glsl_types.h"
- #include "util/xmlpool.h"
-
-+#ifndef CLOCK_MONOTONIC_RAW
-+# ifdef CLOCK_MONOTONIC_FAST
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
-+# else
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
-+# endif
-+#endif
-+
- static int
- radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
- {
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c b/MesaLib-dfbsd-meson/patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
deleted file mode 100644
index 047dac279f..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Define ETIME if missing
-
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-FreeBSD Bugzilla: Bug 225415 graphics/mesa-dri: update to 18.0.0
-
---- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig 2018-02-09 02:17:57.000000000 +0000
-+++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
-@@ -33,6 +33,9 @@
- #include "radv_amdgpu_bo.h"
- #include "sid.h"
-
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
-
- enum {
- VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024
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
deleted file mode 100644
index b619541018..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_compiler_builtin__type__macros.h
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-src_compiler_builtin__type__macros.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Workaround netbsd headers.
-
---- src/compiler/builtin_type_macros.h.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/compiler/builtin_type_macros.h
-@@ -28,6 +28,18 @@
- * language version or extension might provide them.
- */
-
-+#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
-+#undef uint64_t
-+#undef int8_t
-+#undef int16_t
-+#undef int32_t
-+#undef int64_t
-+#endif
-+
-+
- DECL_TYPE(error, GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0)
- DECL_TYPE(void, GL_INVALID_ENUM, GLSL_TYPE_VOID, 0, 0)
-
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_drivers_dri2_platform__drm.c b/MesaLib-dfbsd-meson/patches/patch-src_egl_drivers_dri2_platform__drm.c
deleted file mode 100644
index 3920bed657..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_egl_drivers_dri2_platform__drm.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_egl_drivers_dri2_platform__drm.c,v 1.2 2019/01/20 09:50:28 tnn Exp $
-
-netbsd-5 build fix
-
---- src/egl/drivers/dri2/platform_drm.c.orig 2019-01-17 11:26:22.000000000 +0000
-+++ src/egl/drivers/dri2/platform_drm.c
-@@ -725,7 +725,11 @@ dri2_initialize_drm(_EGLDriver *drv, _EG
- }
- dri2_dpy->own_device = true;
- } else {
-+#ifdef F_DUPFD_CLOEXEC
- dri2_dpy->fd = fcntl(gbm_device_get_fd(gbm), F_DUPFD_CLOEXEC, 3);
-+#else
-+ dri2_dpy->fd = -1;
-+#endif
- if (dri2_dpy->fd < 0) {
- err = "DRI2: failed to fcntl() existing gbm device";
- goto cleanup;
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_egl_drivers_dri2_platform__x11.c b/MesaLib-dfbsd-meson/patches/patch-src_egl_drivers_dri2_platform__x11.c
deleted file mode 100644
index 4d7c77b551..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_egl_drivers_dri2_platform__x11.c
+++ /dev/null
@@ -1,60 +0,0 @@
-$NetBSD: patch-src_egl_drivers_dri2_platform__x11.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Provide compat strndup for older Darwin.
-
-* From FreeBSD ports 18.0.0:
-work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
-
-Mon Apr 10 19:14:48 2017 UTC
-DRI3 remains enabled at compile time, but it is now disabled at
-runtime for stock FreeBSD. Set LIBGL_DRI3_ENABLE in the
-environment to enable DRI3.
-This change was made to work around a problem in libEGL,
-which fails to fall back to using DRI2 when run on a system
-without DRI3 support.
-
-* Added logging statement to note dri3 initialization being invoked.
-
---- src/egl/drivers/dri2/platform_x11.c.orig 2018-02-09 02:17:57.000000000 +0000
-+++ src/egl/drivers/dri2/platform_x11.c
-@@ -608,6 +608,23 @@ dri2_x11_local_authenticate(struct dri2_
- return EGL_TRUE;
- }
-
-+#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
-+static char *
-+strndup(const char *s, int length)
-+{
-+ char *d;
-+
-+ d = malloc(length + 1);
-+ if (d == NULL)
-+ return NULL;
-+
-+ memcpy(d, s, length);
-+ d[length] = '\0';
-+
-+ return d;
-+}
-+#endif
-+
- static EGLBoolean
- dri2_x11_connect(struct dri2_egl_display *dri2_dpy)
- {
-@@ -1466,8 +1483,15 @@ dri2_initialize_x11(_EGLDriver *drv, _EG
-
- if (!disp->Options.ForceSoftware) {
- #ifdef HAVE_DRI3
-- if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
-+#if ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)) || defined(TEST_DRI3_ENABLE)
-+ if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false))
-+#endif
-+ if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false)) {
-+ _eglLog(_EGL_INFO, "platform_x11.c: calling dri2_initialize_x11_dri3\n");
- initialized = dri2_initialize_x11_dri3(drv, disp);
-+ if (initialized)
-+ _eglLog(_EGL_INFO, "platform_x11.c: initialized by dri2_initialize_x11_dri3\n");
-+ }
- #endif
-
- if (!initialized)
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_egl_main_eglglobals.c b/MesaLib-dfbsd-meson/patches/patch-src_egl_main_eglglobals.c
deleted file mode 100644
index 2c3a00bc34..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_egl_main_eglglobals.c
+++ /dev/null
@@ -1,68 +0,0 @@
-$NetBSD: patch-src_egl_main_eglglobals.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-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
-
-From NetBSD xsrc:
-The third argument of mincore(2) is unsigned only on linux.
-
---- src/egl/main/eglglobals.c.orig 2019-05-03 15:59:12.000000000 +0000
-+++ src/egl/main/eglglobals.c
-@@ -93,11 +93,22 @@ struct _egl_global _eglGlobal =
- .debugTypesEnabled = _EGL_DEBUG_BIT_CRITICAL | _EGL_DEBUG_BIT_ERROR,
- };
-
-+#if defined(HAVE_NOATEXIT)
-+static EGLBoolean registered = EGL_FALSE;
-
-+static void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- _eglAtExit(void)
- {
- EGLint i;
-+
-+#if defined(HAVE_NOATEXIT)
-+ if (!registered)
-+ return;
-+#endif
-+
- for (i = _eglGlobal.NumAtExitCalls - 1; i >= 0; i--)
- _eglGlobal.AtExitCalls[i]();
- }
-@@ -107,14 +118,20 @@ void
- _eglAddAtExitCall(void (*func)(void))
- {
- if (func) {
-+#if !defined(HAVE_NOATEXIT)
- static EGLBoolean registered = EGL_FALSE;
-+#endif
-
- mtx_lock(_eglGlobal.Mutex);
-
-+#if defined(HAVE_NOATEXIT)
-+ registered = EGL_TRUE;
-+#else
- if (!registered) {
- atexit(_eglAtExit);
- registered = EGL_TRUE;
- }
-+#endif
-
- assert(_eglGlobal.NumAtExitCalls < ARRAY_SIZE(_eglGlobal.AtExitCalls));
- _eglGlobal.AtExitCalls[_eglGlobal.NumAtExitCalls++] = func;
-@@ -162,7 +179,10 @@ _eglPointerIsDereferencable(void *p)
- {
- #ifdef HAVE_MINCORE
- uintptr_t addr = (uintptr_t) p;
-- unsigned char valid = 0;
-+#ifdef __linux__
-+ unsigned
-+#endif
-+ char valid = 0;
- const long page_size = getpagesize();
-
- if (p == NULL)
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_drivers_trace_tr__dump.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_drivers_trace_tr__dump.c
deleted file mode 100644
index 9935beb299..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_drivers_trace_tr__dump.c
+++ /dev/null
@@ -1,50 +0,0 @@
-$NetBSD: patch-src_gallium_auxiliary_drivers_trace_tr__dump.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-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/gallium/auxiliary/driver_trace/tr_dump.c.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/gallium/auxiliary/driver_trace/tr_dump.c
-@@ -63,7 +63,6 @@ static mtx_t call_mutex = _MTX_INITIALIZ
- static long unsigned call_no = 0;
- static boolean dumping = FALSE;
-
--
- static inline void
- trace_dump_write(const char *buf, size_t size)
- {
-@@ -171,9 +170,20 @@ trace_dump_trace_flush(void)
- }
- }
-
-+#if defined(HAVE_NOATEXIT)
-+static boolean trace_dump_has_begun = FALSE;
-+
-+static void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- trace_dump_trace_close(void)
- {
-+#if defined(HAVE_NOATEXIT)
-+ if (!trace_dump_has_begun)
-+ return;
-+#endif
-+
- if (stream) {
- trace_dump_writes("</trace>\n");
- if (close_stream) {
-@@ -233,7 +243,11 @@ trace_dump_trace_begin(void)
- * screen multiple times, so we only write </trace> tag and close at exit
- * time.
- */
-+#if defined(HAVE_NOATEXIT)
-+ trace_dump_has_begun = TRUE;
-+#else
- atexit(trace_dump_trace_close);
-+#endif
- }
-
- return TRUE;
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
deleted file mode 100644
index 49110fbb10..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
+++ /dev/null
@@ -1,127 +0,0 @@
-$NetBSD: patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c,v 1.2 2019/01/10 22:30:11 tnn Exp $
-
-* From FreeBSD ports / DragonFly dports graphics/mesa-dri
-
-Revert the following commit.
-
-FreeBSD and DragonFly don't have the required render nodes.
-
--------
-
-From 69a1b9959e59653da262185c4e2cf57d24939b19 Mon Sep 17 00:00:00 2001
-Date: Mon, 29 Jun 2015 12:36:45 +0100
-Subject: pipe-loader: drop support for non-render node devices
-
-Render nodes have been around for quite some time. Removing support via
-the master/primary node allows us to clean up the conditional
-compilation and simplify the build greatly.
-
-For example currently we the pipe-loader, which explicitly links against
-xcb and friends (for X auth) if found at compile-time. That
-would cause problems as one will be forced to use X/xcb, even if it's a
-headless system that is used for opencl.
-
-v2: Clarify the linking topic in the commit message.
-
-* Extended for NetBSD.
-
---- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2018-12-11 21:13:57.000000000 +0000
-+++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
-@@ -229,6 +229,16 @@ pipe_loader_drm_probe_fd(struct pipe_loa
- return ret;
- }
-
-+#if defined(NO_RENDER_NODE)
-+static int
-+open_drm_minor(int minor)
-+{
-+ char path[PATH_MAX];
-+ snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor);
-+ return open(path, O_RDWR, 0);
-+}
-+#endif
-+
- static int
- open_drm_render_node_minor(int minor)
- {
-@@ -241,7 +251,19 @@ open_drm_render_node_minor(int minor)
- int
- pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
- {
-+#if defined(NO_RENDER_NODE)
-+ int i, k, fd, num_render_node_devs;
-+ int j = 0;
-+
-+ struct {
-+ unsigned vendor_id;
-+ unsigned chip_id;
-+ } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
-+
-+ /* Look for render nodes first */
-+#else
- int i, j, fd;
-+#endif
-
- for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
- i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
-@@ -256,6 +278,11 @@ pipe_loader_drm_probe(struct pipe_loader
- continue;
- }
-
-+#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;
-+
-+#endif
- if (j < ndev) {
- devs[j] = dev;
- } else {
-@@ -265,6 +292,48 @@ pipe_loader_drm_probe(struct pipe_loader
- j++;
- }
-
-+#if defined(NO_RENDER_NODE)
-+ num_render_node_devs = j;
-+
-+ /* Next look for drm devices. */
-+ for (i = 0; i < DRM_MAX_MINOR; i++) {
-+ struct pipe_loader_device *dev;
-+ boolean duplicate = FALSE;
-+ fd = open_drm_minor(i);
-+ if (fd < 0)
-+ continue;
-+
-+ if (!pipe_loader_drm_probe_fd(&dev, fd)) {
-+ close(fd);
-+ continue;
-+ }
-+
-+ /* Check to make sure we aren't already accessing this device via
-+ * render nodes.
-+ */
-+ for (k = 0; k < num_render_node_devs; k++) {
-+ if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id &&
-+ dev->u.pci.chip_id == render_node_devs[k].chip_id) {
-+ close(fd);
-+ dev->ops->release(&dev);
-+ duplicate = TRUE;
-+ break;
-+ }
-+ }
-+
-+ if (duplicate)
-+ continue;
-+
-+ if (j < ndev) {
-+ devs[j] = dev;
-+ } else {
-+ dev->ops->release(&dev);
-+ }
-+
-+ j++;
-+ }
-+
-+#endif
- return j;
- }
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_util_u__format__tests.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_util_u__format__tests.c
deleted file mode 100644
index cb05bb04c2..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_auxiliary_util_u__format__tests.c
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-src_gallium_auxiliary_util_u__format__tests.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-On old NetBSD, NAN in math.h is __nanf.__val. Which is not constant.
-
---- src/gallium/auxiliary/util/u_format_tests.c.orig 2019-01-04 23:59:59.000000000 +0000
-+++ src/gallium/auxiliary/util/u_format_tests.c
-@@ -28,6 +28,10 @@
-
- #include <math.h>
- #include <float.h>
-+#if defined(__NetBSD__) && __NetBSD_Version__ < 600000000
-+#undef NAN
-+#define NAN __builtin_nanf("")
-+#endif
-
- #include "pipe/p_config.h"
- #include "util/u_memory.h"
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_freedreno_freedreno__screen.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_freedreno_freedreno__screen.c
deleted file mode 100644
index 29b0d5d436..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_freedreno_freedreno__screen.c
+++ /dev/null
@@ -1,34 +0,0 @@
-$NetBSD$
-
-From FreeBSD ports graphics/mesa-dri 18.1.4.
-
-- Without sysinfo() fall back to sysconf()
-
---- src/gallium/drivers/freedreno/freedreno_screen.c.orig 2019-04-25 21:13:31.000000000 +0000
-+++ src/gallium/drivers/freedreno/freedreno_screen.c
-@@ -43,7 +43,11 @@
- #include <errno.h>
- #include <stdio.h>
- #include <stdlib.h>
-+#ifdef __GLIBC__
- #include <sys/sysinfo.h>
-+#else
-+#include <unistd.h>
-+#endif
-
- #include "freedreno_screen.h"
- #include "freedreno_resource.h"
-@@ -832,9 +836,13 @@ fd_screen_create(struct fd_device *dev,
- screen->has_robustness = val;
- }
-
-+#ifdef __GLIBC__
- struct sysinfo si;
- sysinfo(&si);
- screen->ram_size = si.totalram;
-+#else
-+ screen->ram_size = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
-+#endif
-
- DBG("Pipe Info:");
- DBG(" GPU-id: %d", screen->gpu_id);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_iris_meson.build b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_iris_meson.build
deleted file mode 100644
index 77b553cd06..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_iris_meson.build
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD$
-
---- src/gallium/drivers/iris/meson.build.orig 2019-04-23 07:24:08.000000000 +0000
-+++ src/gallium/drivers/iris/meson.build
-@@ -62,7 +62,7 @@ iris_gen_libs = []
- foreach v : ['80', '90', '100', '110']
- iris_gen_libs += static_library(
- 'libiris_gen@0@'.format(v),
-- ['iris_blorp.c', 'iris_state.c', gen_xml_pack],
-+ ['iris_blorp.c', 'iris_state.c', gen_xml_pack, nir_opcodes_h, nir_builder_opcodes_h, nir_intrinsics_h],
- include_directories : [inc_common, inc_intel, inc_nir],
- c_args : [
- c_vis_args, no_override_init_args, c_sse2_args,
-@@ -74,7 +74,7 @@ endforeach
-
- libiris = static_library(
- 'iris',
-- [files_libiris, gen_xml_pack, nir_opcodes_h, nir_builder_opcodes_h,
-+ [files_libiris, gen_xml_pack, nir_opcodes_h, nir_builder_opcodes_h, nir_intrinsics_h,
- iris_driinfo_h],
- include_directories : [
- inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_intel, inc_nir,
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
deleted file mode 100644
index 609315ceb6..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_meson.build
+++ /dev/null
@@ -1,13 +0,0 @@
-$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_gallium_drivers_nouveau_nouveau__vp3__video.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c
deleted file mode 100644
index 91ad33c971..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Fix build on platforms without close-on-exec.
-
---- src/gallium/drivers/nouveau/nouveau_vp3_video.c.orig 2017-02-13 11:55:49.000000000 +0000
-+++ src/gallium/drivers/nouveau/nouveau_vp3_video.c
-@@ -294,7 +294,11 @@ nouveau_vp3_load_firmware(struct nouveau
- if (nouveau_bo_map(dec->fw_bo, NOUVEAU_BO_WR, dec->client))
- return 1;
-
-+#ifdef O_CLOEXEC
- fd = open(path, O_RDONLY | O_CLOEXEC);
-+#else
-+ fd = open(path, O_RDONLY);
-+#endif
- if (fd < 0) {
- fprintf(stderr, "opening firmware file %s failed: %m\n", path);
- return 1;
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_nv50_nv84__video.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_nv50_nv84__video.c
deleted file mode 100644
index 883e4426e9..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_nouveau_nv50_nv84__video.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_gallium_drivers_nouveau_nv50_nv84__video.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Fix build on platforms without close-on-exec.
-
---- src/gallium/drivers/nouveau/nv50/nv84_video.c.orig 2015-03-21 00:51:18.000000000 +0000
-+++ src/gallium/drivers/nouveau/nv50/nv84_video.c
-@@ -34,7 +34,11 @@
- static int
- nv84_copy_firmware(const char *path, void *dest, ssize_t len)
- {
-+#ifdef O_CLOEXEC
- int fd = open(path, O_RDONLY | O_CLOEXEC);
-+#else
-+ int fd = open(path, O_RDONLY);
-+#endif
- ssize_t r;
- if (fd < 0) {
- fprintf(stderr, "opening firmware file %s failed: %m\n", path);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__buffer.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__buffer.c
deleted file mode 100644
index fdbe253ae1..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__buffer.c
+++ /dev/null
@@ -1,65 +0,0 @@
-$NetBSD$
-
-Option to revert:
-2019-02-20
-radeonsi: use SDMA for uploading data through const_uploader
-
-https://cgit.freedesktop.org/mesa/mesa/commit/?id=edbd2c1ff559cde1d9e22a9fb9059747782a72a7
-
---- src/gallium/drivers/radeonsi/si_buffer.c.orig 2019-02-21 02:04:29.000000000 +0000
-+++ src/gallium/drivers/radeonsi/si_buffer.c
-@@ -440,6 +440,9 @@ static void *si_buffer_transfer_map(stru
- }
- }
-
-+#if defined(REVERT_SDMA_UPLOADER)
-+ if ((usage & PIPE_TRANSFER_DISCARD_RANGE) &&
-+#else
- if (usage & PIPE_TRANSFER_FLUSH_EXPLICIT &&
- buf->b.b.flags & SI_RESOURCE_FLAG_UPLOAD_FLUSH_EXPLICIT_VIA_SDMA) {
- usage &= ~(PIPE_TRANSFER_UNSYNCHRONIZED |
-@@ -449,6 +452,7 @@ static void *si_buffer_transfer_map(stru
- }
-
- if (usage & PIPE_TRANSFER_DISCARD_RANGE &&
-+#endif
- ((!(usage & (PIPE_TRANSFER_UNSYNCHRONIZED |
- PIPE_TRANSFER_PERSISTENT))) ||
- (buf->flags & RADEON_FLAG_SPARSE))) {
-@@ -461,6 +465,12 @@ static void *si_buffer_transfer_map(stru
- si_rings_is_buffer_referenced(sctx, buf->buf, RADEON_USAGE_READWRITE) ||
- !sctx->ws->buffer_wait(buf->buf, 0, RADEON_USAGE_READWRITE)) {
- /* Do a wait-free write-only transfer using a temporary buffer. */
-+#if defined(REVERT_SDMA_UPLOADER)
-+ unsigned offset;
-+ struct si_resource *staging = NULL;
-+
-+ u_upload_alloc(ctx->stream_uploader, 0,
-+#else
- struct u_upload_mgr *uploader;
- struct si_resource *staging = NULL;
- unsigned offset;
-@@ -475,6 +485,7 @@ static void *si_buffer_transfer_map(stru
- uploader = sctx->b.stream_uploader;
-
- u_upload_alloc(uploader, 0,
-+#endif
- box->width + (box->x % SI_MAP_BUFFER_ALIGNMENT),
- sctx->screen->info.tcc_cache_line_size,
- &offset, (struct pipe_resource**)&staging,
-@@ -548,6 +559,7 @@ static void si_buffer_do_flush_region(st
- transfer->box.x % SI_MAP_BUFFER_ALIGNMENT +
- (box->x - transfer->box.x);
-
-+#if !defined(REVERT_SDMA_UPLOADER)
- if (buf->b.b.flags & SI_RESOURCE_FLAG_UPLOAD_FLUSH_EXPLICIT_VIA_SDMA) {
- /* This should be true for all uploaders. */
- assert(transfer->box.x == 0);
-@@ -587,6 +599,7 @@ static void si_buffer_do_flush_region(st
- up->size = box->width;
- return;
- }
-+#endif
-
- /* Copy the staging buffer into the original one. */
- si_copy_buffer(sctx, transfer->resource, &stransfer->staging->b.b,
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__compute__blit.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__compute__blit.c
deleted file mode 100644
index 7368fde31e..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__compute__blit.c
+++ /dev/null
@@ -1,176 +0,0 @@
-$NetBSD$
-
-2018-10-16 radeonsi: use compute shaders for clear_buffer & copy_buffer
-Commit: 9b331e462e5021d994859756d46cd2519d9c9c6e
-
-https://cgit.freedesktop.org/mesa/mesa/commit/?id=9b331e462e5021d994859756d46cd2519d9c9c6e
-
---- src/gallium/drivers/radeonsi/si_compute_blit.c.orig 2019-04-23 07:24:08.000000000 +0000
-+++ src/gallium/drivers/radeonsi/si_compute_blit.c
-@@ -34,10 +34,17 @@ static enum si_cache_policy get_cache_po
- enum si_coherency coher,
- uint64_t size)
- {
-+#if defined(REVERT_COPY_CLEAR)
-+ if ((sctx->chip_class >= GFX9 && coher == SI_COHERENCY_CB_META) ||
-+ (sctx->chip_class >= CIK && coher == SI_COHERENCY_SHADER))
-+ return L2_LRU;
-+
-+#else
- if ((sctx->chip_class >= GFX9 && (coher == SI_COHERENCY_CB_META ||
- coher == SI_COHERENCY_CP)) ||
- (sctx->chip_class >= CIK && coher == SI_COHERENCY_SHADER))
- return size <= 256 * 1024 ? L2_LRU : L2_STREAM;
-+#endif
-
- return L2_BYPASS;
- }
-@@ -189,6 +196,52 @@ void si_clear_buffer(struct si_context *
- uint32_t clear_value_size, enum si_coherency coher,
- bool force_cpdma)
- {
-+#if defined(REVERT_COPY_CLEAR)
-+
-+/* Recommended maximum sizes for optimal performance.
-+ * Fall back to compute or SDMA if the size is greater.
-+ */
-+#define CP_DMA_COPY_PERF_THRESHOLD (64 * 1024) /* copied from Vulkan */
-+#define CP_DMA_CLEAR_PERF_THRESHOLD (32 * 1024) /* guess (clear is much slower) */
-+
-+ struct radeon_winsys *ws = sctx->ws;
-+ struct si_resource *rdst = si_resource(dst);
-+ enum si_cache_policy cache_policy = get_cache_policy(sctx, coher, size);
-+
-+ if (!size)
-+ return;
-+
-+ uint64_t aligned_size = size & ~3ull;
-+
-+ /* dma_clear_buffer can use clear_buffer on failure. Make sure that
-+ * doesn't happen. We don't want an infinite recursion: */
-+ if (sctx->dma_cs &&
-+ !(dst->flags & PIPE_RESOURCE_FLAG_SPARSE) &&
-+ (offset % 4 == 0) &&
-+ /* CP DMA is very slow. Always use SDMA for big clears. This
-+ * alone improves DeusEx:MD performance by 70%. */
-+ (size > CP_DMA_CLEAR_PERF_THRESHOLD ||
-+ /* Buffers not used by the GFX IB yet will be cleared by SDMA.
-+ * This happens to move most buffer clears to SDMA, including
-+ * DCC and CMASK clears, because pipe->clear clears them before
-+ * si_emit_framebuffer_state (in a draw call) adds them.
-+ * For example, DeusEx:MD has 21 buffer clears per frame and all
-+ * of them are moved to SDMA thanks to this. */
-+ !ws->cs_is_buffer_referenced(sctx->gfx_cs, rdst->buf,
-+ RADEON_USAGE_READWRITE))) {
-+ si_sdma_clear_buffer(sctx, dst, offset, aligned_size, *clear_value);
-+
-+ offset += aligned_size;
-+ size -= aligned_size;
-+ } else if (aligned_size >= 4) {
-+ si_cp_dma_clear_buffer(sctx, sctx->gfx_cs, dst, offset,
-+ aligned_size, *clear_value, 0, coher,
-+ get_cache_policy(sctx, coher, size));
-+
-+ offset += aligned_size;
-+ size -= aligned_size;
-+ }
-+#else
- if (!size)
- return;
-
-@@ -268,6 +321,7 @@ void si_clear_buffer(struct si_context *
- offset += aligned_size;
- size -= aligned_size;
- }
-+#endif
-
- /* Handle non-dword alignment. */
- if (size) {
-@@ -285,8 +339,61 @@ static void si_pipe_clear_buffer(struct
- const void *clear_value,
- int clear_value_size)
- {
-+#if defined(REVERT_COPY_CLEAR)
-+ struct si_context *sctx = (struct si_context*)ctx;
-+ uint32_t dword_value;
-+
-+ assert(offset % clear_value_size == 0);
-+ assert(size % clear_value_size == 0);
-+
-+ if (clear_value_size > 4) {
-+ bool clear_dword_duplicated = true;
-+
-+ /* See if we can lower large fills to dword fills. */
-+ for (unsigned i = 1; i < clear_value_size / 4; i++)
-+ if (((uint32_t *)clear_value)[0] != ((uint32_t*)clear_value)[i]) {
-+ clear_dword_duplicated = false;
-+ break;
-+ }
-+
-+ if (!clear_dword_duplicated) {
-+ /* Use transform feedback for 64-bit, 96-bit, and
-+ * 128-bit fills.
-+ */
-+ union pipe_color_union streamout_clear_value;
-+
-+ memcpy(&streamout_clear_value, clear_value, clear_value_size);
-+ si_blitter_begin(sctx, SI_DISABLE_RENDER_COND);
-+ util_blitter_clear_buffer(sctx->blitter, dst, offset,
-+ size, clear_value_size / 4,
-+ &streamout_clear_value);
-+ si_blitter_end(sctx);
-+ return;
-+ }
-+ }
-+
-+ /* Expand the clear value to a dword. */
-+ switch (clear_value_size) {
-+ case 1:
-+ dword_value = *(uint8_t*)clear_value;
-+ dword_value |= (dword_value << 8) |
-+ (dword_value << 16) |
-+ (dword_value << 24);
-+ break;
-+ case 2:
-+ dword_value = *(uint16_t*)clear_value;
-+ dword_value |= dword_value << 16;
-+ break;
-+ default:
-+ dword_value = *(uint32_t*)clear_value;
-+ }
-+
-+ si_clear_buffer(sctx, dst, offset, size, &dword_value,
-+ clear_value_size, SI_COHERENCY_SHADER, false);
-+#else
- si_clear_buffer((struct si_context*)ctx, dst, offset, size, (uint32_t*)clear_value,
- clear_value_size, SI_COHERENCY_SHADER, false);
-+#endif
- }
-
- void si_copy_buffer(struct si_context *sctx,
-@@ -299,6 +406,17 @@ void si_copy_buffer(struct si_context *s
- enum si_coherency coher = SI_COHERENCY_SHADER;
- enum si_cache_policy cache_policy = get_cache_policy(sctx, coher, size);
-
-+#if defined(REVERT_COPY_CLEAR)
-+ si_cp_dma_copy_buffer(sctx, dst, src, dst_offset, src_offset, size,
-+ 0, coher, cache_policy);
-+
-+ if (cache_policy != L2_BYPASS)
-+ si_resource(dst)->TC_L2_dirty = true;
-+
-+ /* If it's not a prefetch... */
-+ if (dst_offset != src_offset)
-+ sctx->num_cp_dma_calls++;
-+#else
- /* Only use compute for VRAM copies on dGPUs. */
- if (sctx->screen->info.has_dedicated_vram &&
- si_resource(dst)->domains & RADEON_DOMAIN_VRAM &&
-@@ -311,6 +429,7 @@ void si_copy_buffer(struct si_context *s
- si_cp_dma_copy_buffer(sctx, dst, src, dst_offset, src_offset, size,
- 0, coher, cache_policy);
- }
-+#endif
- }
-
- void si_compute_copy_image(struct si_context *sctx,
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__dma__cs.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__dma__cs.c
deleted file mode 100644
index d28481f13d..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__dma__cs.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD$
-
-Option to revert:
-2019-02-20
-radeonsi: use SDMA for uploading data through const_uploader
-
-https://cgit.freedesktop.org/mesa/mesa/commit/?id=edbd2c1ff559cde1d9e22a9fb9059747782a72a7
-
---- src/gallium/drivers/radeonsi/si_dma_cs.c.orig 2019-02-21 02:04:29.000000000 +0000
-+++ src/gallium/drivers/radeonsi/si_dma_cs.c
-@@ -182,7 +182,11 @@ void si_need_dma_space(struct si_context
- RADEON_USAGE_WRITE)))
- si_dma_emit_wait_idle(ctx);
-
-+#if defined(REVERT_SDMA_UPLOADER)
-+ unsigned sync = 0;
-+#else
- unsigned sync = ctx->sdma_uploads_in_progress ? 0 : RADEON_USAGE_SYNCHRONIZED;
-+#endif
- if (dst) {
- ws->cs_add_buffer(ctx->dma_cs, dst->buf, RADEON_USAGE_WRITE | sync,
- dst->domains, 0);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__gfx__cs.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__gfx__cs.c
deleted file mode 100644
index 0a475fe31b..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__gfx__cs.c
+++ /dev/null
@@ -1,38 +0,0 @@
-$NetBSD$
-
-Option to revert:
-2019-02-20
-radeonsi: use SDMA for uploading data through const_uploader
-
-https://cgit.freedesktop.org/mesa/mesa/commit/?id=edbd2c1ff559cde1d9e22a9fb9059747782a72a7
-
---- src/gallium/drivers/radeonsi/si_gfx_cs.c.orig 2019-02-28 21:26:15.000000000 +0000
-+++ src/gallium/drivers/radeonsi/si_gfx_cs.c
-@@ -108,6 +108,19 @@ void si_flush_gfx_cs(struct si_context *
- if (ctx->screen->debug_flags & DBG(CHECK_VM))
- flags &= ~PIPE_FLUSH_ASYNC;
-
-+#if defined(REVERT_SDMA_UPLOADER)
-+ /* If the state tracker is flushing the GFX IB, si_flush_from_st is
-+ * responsible for flushing the DMA IB and merging the fences from both.
-+ * This code is only needed when the driver flushes the GFX IB
-+ * internally, and it never asks for a fence handle.
-+ */
-+ if (radeon_emitted(ctx->dma_cs, 0)) {
-+ assert(fence == NULL); /* internal flushes only */
-+ si_flush_dma_cs(ctx, flags, NULL);
-+ }
-+
-+ ctx->gfx_flush_in_progress = true;
-+#else
- ctx->gfx_flush_in_progress = true;
-
- /* If the state tracker is flushing the GFX IB, si_flush_from_st is
-@@ -139,6 +152,7 @@ void si_flush_gfx_cs(struct si_context *
- /* Flush SDMA (preamble IB). */
- if (radeon_emitted(ctx->dma_cs, 0))
- si_flush_dma_cs(ctx, flags, NULL);
-+#endif
-
- if (ctx->has_graphics) {
- if (!LIST_IS_EMPTY(&ctx->active_queries))
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__pipe.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__pipe.c
deleted file mode 100644
index 8f8c2e0273..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__pipe.c
+++ /dev/null
@@ -1,115 +0,0 @@
-$NetBSD$
-
-Option to revert:
-
-2017-05-15 radeonsi: enable threaded_context
-Commit: 1c8f7d3be6ffb3567041f1e11a037fa7e75e4c28
-
-https://cgit.freedesktop.org/mesa/mesa/commit/?id=1c8f7d3be6ffb3567041f1e11a037fa7e75e4c28
-
-2018-10-16 radeonsi: use compute shaders for clear_buffer & copy_buffer
-Commit: 9b331e462e5021d994859756d46cd2519d9c9c6e
-
-https://cgit.freedesktop.org/mesa/mesa/commit/?id=9b331e462e5021d994859756d46cd2519d9c9c6e
-
-Option to revert:
-2019-02-20
-radeonsi: use SDMA for uploading data through const_uploader
-
-https://cgit.freedesktop.org/mesa/mesa/commit/?id=edbd2c1ff559cde1d9e22a9fb9059747782a72a7
-
---- src/gallium/drivers/radeonsi/si_pipe.c.orig 2019-04-25 21:13:31.000000000 +0000
-+++ src/gallium/drivers/radeonsi/si_pipe.c
-@@ -200,10 +200,12 @@ static void si_destroy_context(struct pi
- sctx->b.delete_vs_state(&sctx->b, sctx->vs_blit_color_layered);
- if (sctx->vs_blit_texcoord)
- sctx->b.delete_vs_state(&sctx->b, sctx->vs_blit_texcoord);
-+#if !defined(REVERT_COPY_CLEAR)
- if (sctx->cs_clear_buffer)
- sctx->b.delete_compute_state(&sctx->b, sctx->cs_clear_buffer);
- if (sctx->cs_copy_buffer)
- sctx->b.delete_compute_state(&sctx->b, sctx->cs_copy_buffer);
-+#endif
- if (sctx->cs_copy_image)
- sctx->b.delete_compute_state(&sctx->b, sctx->cs_copy_image);
- if (sctx->cs_copy_image_1d_array)
-@@ -383,7 +385,11 @@ static void si_set_context_param(struct
- }
-
- static struct pipe_context *si_create_context(struct pipe_screen *screen,
-+#if defined(REVERT_THREADED_CONTEXT)
-+ void *priv, unsigned flags)
-+#else
- unsigned flags)
-+#endif
- {
- struct si_context *sctx = CALLOC_STRUCT(si_context);
- struct si_screen* sscreen = (struct si_screen *)screen;
-@@ -401,7 +407,11 @@ static struct pipe_context *si_create_co
- sscreen->record_llvm_ir = true; /* racy but not critical */
-
- sctx->b.screen = screen; /* this must be set first */
-+#if defined(REVERT_THREADED_CONTEXT)
-+ sctx->b.priv = priv;
-+#else
- sctx->b.priv = NULL;
-+#endif
- sctx->b.destroy = si_destroy_context;
- sctx->screen = sscreen; /* Easy accessing of screen/winsys. */
- sctx->is_debug = (flags & PIPE_CONTEXT_DEBUG) != 0;
-@@ -459,8 +469,13 @@ static struct pipe_context *si_create_co
- sctx, stop_exec_on_failure);
- }
-
-+#if defined(REVERT_SDMA_UPLOADER)
-+ bool use_sdma_upload = false;
-+ sctx->b.const_uploader = u_upload_create(&sctx->b, 128 * 1024,
-+#else
- bool use_sdma_upload = sscreen->info.has_dedicated_vram && sctx->dma_cs;
- sctx->b.const_uploader = u_upload_create(&sctx->b, 256 * 1024,
-+#endif
- 0, PIPE_USAGE_DEFAULT,
- SI_RESOURCE_FLAG_32BIT |
- (use_sdma_upload ?
-@@ -655,6 +670,7 @@ fail:
- return NULL;
- }
-
-+#if !defined(REVERT_THREADED_CONTEXT)
- static struct pipe_context *si_pipe_create_context(struct pipe_screen *screen,
- void *priv, unsigned flags)
- {
-@@ -685,6 +701,7 @@ static struct pipe_context *si_pipe_crea
- sscreen->info.drm_major >= 3 ? si_create_fence : NULL,
- &((struct si_context*)ctx)->tc);
- }
-+#endif
-
- /*
- * pipe_screen
-@@ -920,7 +937,11 @@ struct pipe_screen *radeonsi_screen_crea
- debug_options, 0);
-
- /* Set functions first. */
-+#if defined(REVERT_THREADED_CONTEXT)
-+ sscreen->b.context_create = si_create_context;
-+#else
- sscreen->b.context_create = si_pipe_create_context;
-+#endif
- sscreen->b.destroy = si_destroy_screen;
- sscreen->b.set_max_shader_compiler_threads =
- si_set_max_shader_compiler_threads;
-@@ -1200,8 +1221,13 @@ struct pipe_screen *radeonsi_screen_crea
- si_init_compiler(sscreen, &sscreen->compiler_lowp[i]);
-
- /* Create the auxiliary context. This must be done last. */
-+#if defined(REVERT_THREADED_CONTEXT)
-+ sscreen->aux_context = sscreen->b.context_create(
-+ &sscreen->b, NULL, sscreen->options.aux_debug ? PIPE_CONTEXT_DEBUG : 0);
-+#else
- sscreen->aux_context = si_create_context(
- &sscreen->b, sscreen->options.aux_debug ? PIPE_CONTEXT_DEBUG : 0);
-+#endif
- if (sscreen->options.aux_debug) {
- struct u_log_context *log = CALLOC_STRUCT(u_log_context);
- u_log_context_init(log);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__state__shaders.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__state__shaders.c
deleted file mode 100644
index 9905344d81..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_radeonsi_si__state__shaders.c
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-src_gallium_drivers_radeonsi_si__state__shaders.c,v 1.3 2019/01/20 09:50:28 tnn Exp $
-
-#if'out some debug code on SunOS. There is no open_memstream(3)
-
---- src/gallium/drivers/radeonsi/si_state_shaders.c.orig 2019-01-17 11:26:22.000000000 +0000
-+++ src/gallium/drivers/radeonsi/si_state_shaders.c
-@@ -1721,12 +1721,14 @@ static void si_build_shader_variant(stru
- }
-
- if (shader->compiler_ctx_state.is_debug_context) {
-+#if defined(HAVE_OPEN_MEMSTREAM)
- FILE *f = open_memstream(&shader->shader_log,
- &shader->shader_log_size);
- if (f) {
- si_shader_dump(sscreen, shader, NULL, sel->type, f, false);
- fclose(f);
- }
-+#endif
- }
-
- si_shader_init_pm4_state(sscreen, shader);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c
deleted file mode 100644
index 2eec8e3d7f..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_gallium_drivers_vc4_vc4__bufmgr.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Patch from FreeBSD ports graphics/mesa-dri 17.1.0
-
-# define ETIME as ETIMEOUT same as in intel driver
-
---- src/gallium/drivers/vc4/vc4_bufmgr.c.orig 2017-05-25 07:13:13.000000000 +0000
-+++ src/gallium/drivers/vc4/vc4_bufmgr.c
-@@ -27,6 +27,9 @@
- #include <fcntl.h>
- #include <xf86drm.h>
- #include <xf86drmMode.h>
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
-
- #include "util/u_hash_table.h"
- #include "util/u_memory.h"
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_include_pipe_p__config.h b/MesaLib-dfbsd-meson/patches/patch-src_gallium_include_pipe_p__config.h
deleted file mode 100644
index b66a74e446..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_include_pipe_p__config.h
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-src_gallium_include_pipe_p__config.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Patches for Sparc from FreeBSD ports for mesa-dri 17.2.3.
-
-* Definitions for DragonFly already in upstream source.
-
---- src/gallium/include/pipe/p_config.h.orig 2017-10-19 12:23:53.000000000 +0000
-+++ src/gallium/include/pipe/p_config.h
-@@ -77,6 +77,12 @@
- #define PIPE_CC_ICL
- #endif
-
-+#if defined(__sparc__) || defined(__sparc64__)
-+#define PIPE_ARCH_SPARC
-+#if defined(__sparc64__)
-+#define PIPE_ARCH_SPARC_64
-+#endif
-+#endif
-
- /*
- * Processor architecture
-@@ -131,7 +137,8 @@
-
- #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
- #define PIPE_ARCH_LITTLE_ENDIAN
--#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390)
-+#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_SPARC) || defined(PIPE_ARCH_SPARC_64)
-+
- #define PIPE_ARCH_BIG_ENDIAN
- #endif
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp b/MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
deleted file mode 100644
index 10ebcf46ac..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-src_gallium_state__trackers_clover_llvm_invocation.cpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Patch from FreeBSD ports graphics/mesa-dri 17.1.0
-
-# fix errors like the following
-#
-# llvm/invocation.cpp:(.text+0x1275): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::c_str()
- const'
-# /usr/bin/ld: ../../../../src/gallium/state_trackers/clover/.libs/libclover.a(libclllvm_la-invocation.o): relocation R_X86_64_PC32 against `_ZNKSt3__112bas
-ic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv' can not be used when making a shared object; recompile with -fPIC
-# /usr/bin/ld: final link failed: Bad value
-#
-
---- src/gallium/state_trackers/clover/llvm/invocation.cpp.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/gallium/state_trackers/clover/llvm/invocation.cpp
-@@ -181,6 +181,10 @@ namespace {
- return get_lang_standard_from_version_str(device_version);
- }
-
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+ const char* cstr(const std::string& str) { return str.c_str(); }
-+#endif
-+
- std::unique_ptr<clang::CompilerInstance>
- create_compiler_instance(const device &dev,
- const std::vector<std::string> &opts,
-@@ -193,8 +197,13 @@ namespace {
- // Parse the compiler options. A file name should be present at the end
- // and must have the .cl extension in order for the CompilerInvocation
- // class to recognize it as an OpenCL source file.
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+ std::vector<const char *> copts(opts.size());
-+ std::transform(opts.begin(), opts.end(), copts.begin(), cstr);
-+#else
- const std::vector<const char *> copts =
- map(std::mem_fn(&std::string::c_str), opts);
-+#endif
-
- const target &target = dev.ir_target();
- const std::string &device_clc_version = dev.device_clc_version();
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp b/MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp
deleted file mode 100644
index cc9ecdf93d..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-src_gallium_state__trackers_clover_llvm_metadata.hpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-From FreeBSD ports graphics/libGL mesa 13.0.5
-
-# Fix error: no matching constructor for initialization of 'std::vector<const ::llvm::MDNode *>'
-#
-
---- src/gallium/state_trackers/clover/llvm/metadata.hpp.orig 2017-02-13 11:55:49.000000000 +0000
-+++ src/gallium/state_trackers/clover/llvm/metadata.hpp
-@@ -42,7 +42,11 @@ namespace clover {
- get_kernel_nodes(const ::llvm::Module &mod) {
- if (const ::llvm::NamedMDNode *n =
- mod.getNamedMetadata("opencl.kernels"))
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+ return { n->getOperand(0), n->getOperand(n->getNumOperands()) };
-+#else
- return { n->op_begin(), n->op_end() };
-+#endif
- else
- return {};
- }
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_util_range.hpp b/MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_util_range.hpp
deleted file mode 100644
index 6ba36d1996..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_state__trackers_clover_util_range.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-src_gallium_state__trackers_clover_util_range.hpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-From FreeBSD ports for mesa 17.1.10:
-
-From b95533b981af9a6687b41418e7cc2a5652fc2bdb Mon Sep 17 00:00:00 2001
-Date: Fri, 7 Mar 2014 15:16:08 +0100
-Subject: [PATCH 3/3] Work around for clang 3.4 which fails to build Clover
-
-See:
- https://bugs.freedesktop.org/show_bug.cgi?id=74098#c3
-
---- src/gallium/state_trackers/clover/util/range.hpp.orig 2017-09-25 16:56:19.000000000 +0000
-+++ src/gallium/state_trackers/clover/util/range.hpp
-@@ -362,6 +362,14 @@ namespace clover {
- return { i, i + n };
- }
-
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+ namespace detail {
-+ template<typename T>
-+ using fixup_function_type =
-+ typename std::conditional<std::is_function<T>::value, T &, T>::type;
-+ }
-+#endif
-+
- ///
- /// Create a range by transforming the contents of a number of
- /// source ranges \a rs element-wise using a provided functor \a f.
-@@ -369,7 +377,11 @@ namespace clover {
- /// \sa adaptor_range.
- ///
- template<typename F, typename... Rs>
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+ adaptor_range<detail::fixup_function_type<F>, Rs...>
-+#else
- adaptor_range<F, Rs...>
-+#endif
- map(F &&f, Rs &&... rs) {
- return { std::forward<F>(f), std::forward<Rs>(rs)... };
- }
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c
deleted file mode 100644
index 521800ccd7..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c,v 1.1 2015/04/25 11:19:18 tnn Exp $
-
-Don't create pipe thread on NetBSD. It triggers some kernel bug.
-kern/49838.
-
---- src/gallium/winsys/radeon/drm/radeon_drm_winsys.c.orig 2018-07-06 23:20:10.000000000 +0000
-+++ src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
-@@ -906,8 +906,10 @@ radeon_drm_winsys_create(int fd, const s
- /* TTM aligns the BO size to the CPU page size */
- ws->info.gart_page_size = sysconf(_SC_PAGESIZE);
-
-+#if !defined(NO_CS_QUEUE)
- if (ws->num_cpus > 1 && debug_get_option_thread())
- util_queue_init(&ws->cs_queue, "rcs", 8, 1, 0);
-+#endif
-
- /* Create the screen at the end. The winsys must be initialized
- * completely.
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_glx_apple_apple__glapi.c b/MesaLib-dfbsd-meson/patches/patch-src_glx_apple_apple__glapi.c
deleted file mode 100644
index fa323569e3..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_glx_apple_apple__glapi.c
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-src_glx_apple_apple__glapi.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-https://bugs.freedesktop.org/show_bug.cgi?id=90311
-See also hacks.mk.
-
---- src/glx/apple/apple_glapi.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/glx/apple/apple_glapi.c
-@@ -39,6 +39,7 @@
- #include <GL/gl.h>
-
- #include "main/glheader.h"
-+#include "main/remap.h"
- #include "glapi.h"
- #include "glapitable.h"
-
-@@ -53,6 +54,8 @@ static void _apple_glapi_create_table(vo
- if (__applegl_api)
- return;
-
-+ _mesa_init_remap_table();
-+
- __ogl_framework_api = _glapi_create_table_from_handle(apple_cgl_get_dl_handle(), "gl");
- assert(__ogl_framework_api);
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_glx_dri__common.h b/MesaLib-dfbsd-meson/patches/patch-src_glx_dri__common.h
deleted file mode 100644
index 46647b3cf6..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_glx_dri__common.h
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-src_glx_dri__common.h,v 1.1 2019/01/19 21:54:03 tnn Exp $
-
-Fix error on OSX.
-
---- src/glx/dri_common.h.orig 2019-01-17 11:26:23.000000000 +0000
-+++ src/glx/dri_common.h
-@@ -55,8 +55,10 @@ extern struct glx_config *driConvertConf
-
- extern void driDestroyConfigs(const __DRIconfig **configs);
-
-+#if !defined(GLX_USE_APPLEGL)
- extern __GLXDRIdrawable *
- driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable);
-+#endif
-
- extern void
- driReleaseDrawables(struct glx_context *gc);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_glx_dri__glx.c b/MesaLib-dfbsd-meson/patches/patch-src_glx_dri__glx.c
deleted file mode 100644
index 3bfc863be7..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_glx_dri__glx.c
+++ /dev/null
@@ -1,43 +0,0 @@
-$NetBSD: patch-src_glx_dri__glx.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-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/glx/dri_glx.c.orig 2018-01-18 21:30:28.000000000 +0000
-+++ src/glx/dri_glx.c
-@@ -183,9 +183,21 @@ static struct driver_config_entry *drive
- /* Called as an atexit function. Otherwise, this would have to be called with
- * driver_config_mutex locked.
- */
-+#if defined(HAVE_NOATEXIT)
-+static Bool e_next_ever_null = False;
-+
-+static void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- clear_driver_config_cache()
- {
-+
-+#if defined(HAVE_NOATEXIT)
-+ if (!e_next_ever_null)
-+ return;
-+#endif
-+
- while (driver_config_cache) {
- struct driver_config_entry *e = driver_config_cache;
- driver_config_cache = e->next;
-@@ -276,7 +288,11 @@ glXGetDriverConfig(const char *driverNam
- driver_config_cache = e;
-
- if (!e->next)
-+#if defined(HAVE_NOATEXIT)
-+ e_next_ever_null = True;
-+#else
- atexit(clear_driver_config_cache);
-+#endif
-
- out:
- pthread_mutex_unlock(&driver_config_mutex);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_glx_glxclient.h b/MesaLib-dfbsd-meson/patches/patch-src_glx_glxclient.h
deleted file mode 100644
index 55908db8b8..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_glx_glxclient.h
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_glx_glxclient.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-NetBSD only supports zero-initialized initial-exec tls variables in conjuction
-with dlopen(3) at the moment.
-
---- src/glx/glxclient.h.orig 2017-02-13 11:55:49.000000000 +0000
-+++ src/glx/glxclient.h
-@@ -661,7 +661,11 @@ extern void __glXSetCurrentContext(struc
- extern __thread void *__glX_tls_Context
- __attribute__ ((tls_model("initial-exec")));
-
-+#if defined(NO_INITIAL_EXEC_NONNULL)
-+# define __glXGetCurrentContext() (likely(__glX_tls_Context) ? __glX_tls_Context : (void*)&dummyContext)
-+#else
- # define __glXGetCurrentContext() __glX_tls_Context
-+#endif
-
- # else
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_glx_glxcurrent.c b/MesaLib-dfbsd-meson/patches/patch-src_glx_glxcurrent.c
deleted file mode 100644
index adaacdd206..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_glx_glxcurrent.c
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-src_glx_glxcurrent.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Interim fix for toolchain/50277.
-
-NetBSD only supports zero-initialized initial-exec tls variables in conjuction
-with dlopen(3) at the moment.
-
---- src/glx/glxcurrent.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/glx/glxcurrent.c
-@@ -40,6 +40,18 @@
- #include "glx_error.h"
-
- /*
-+ * MASSIVE KLUDGE!
-+ * We need these to not be extern in libGL.so because of
-+ * PR toolchain/50277
-+ */
-+#if defined(GLX_USE_TLS) && defined(NO_INITIAL_EXEC_NONNULL)
-+_X_EXPORT __thread struct _glapi_table * _glapi_tls_Dispatch
-+ __attribute__((tls_model("initial-exec"))) = NULL;
-+_X_EXPORT __thread void * _glapi_tls_Context
-+ __attribute__((tls_model("initial-exec")));
-+#endif
-+
-+/*
- ** We setup some dummy structures here so that the API can be used
- ** even if no context is current.
- */
-@@ -77,7 +89,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(NO_INITIAL_EXEC_NONNULL)
-+ = NULL; /* non-zero initializers not supported with dlopen */
-+#else
- = &dummyContext;
-+#endif
-
- _X_HIDDEN void
- __glXSetCurrentContext(struct glx_context * c)
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_glx_glxext.c b/MesaLib-dfbsd-meson/patches/patch-src_glx_glxext.c
deleted file mode 100644
index 1ce9e9b86e..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_glx_glxext.c
+++ /dev/null
@@ -1,47 +0,0 @@
-$NetBSD: patch-src_glx_glxext.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Patch from FreeBSD ports graphics/mesa-dri 18.0.0
-
-# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
-
-* Extended to DragonFly and NetBSD. Other OSes might need this as well.
-
-* Added logging statements to note dri3 initialization being invoked.
-
---- src/glx/glxext.c.orig 2017-12-08 13:49:11.000000000 +0000
-+++ src/glx/glxext.c
-@@ -55,6 +55,7 @@
- #include <xcb/xcb.h>
- #include <xcb/glx.h>
-
-+#include "dri_common.h"
-
- #ifdef DEBUG
- void __glXDumpDrawBuffer(struct glx_context * ctx);
-@@ -817,7 +818,11 @@ AllocAndFetchScreenConfigs(Display * dpy
- #if defined(GLX_USE_DRM)
- #if defined(HAVE_DRI3)
- if (priv->dri3Display)
-+ InfoMessageF("glxext.c: AllocAndFetchScreenConfigs: priv->dri3Display\n");
-+ if (priv->dri3Display)
- psc = (*priv->dri3Display->createScreen) (i, priv);
-+ if (psc != NULL && priv->dri3Display)
-+ InfoMessageF("glxext.c: AllocAndFetchScreenConfigs: psc set by priv->dri3Display\n");
- #endif /* HAVE_DRI3 */
- if (psc == NULL && priv->dri2Display)
- psc = (*priv->dri2Display->createScreen) (i, priv);
-@@ -920,8 +925,13 @@ __glXInitialize(Display * dpy)
- #if defined(GLX_USE_DRM)
- if (glx_direct && glx_accel) {
- #if defined(HAVE_DRI3)
-- if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
-+#if ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)) || defined(__DragonFly__) || defined(__NetBSD__)
-+ if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false))
-+#endif
-+ if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false)) {
-+ InfoMessageF("glxext.c: __glxInitialize: dpyPriv->dri3Display = dri3_create_display\n");
- dpyPriv->dri3Display = dri3_create_display(dpy);
-+ }
- #endif /* HAVE_DRI3 */
- dpyPriv->dri2Display = dri2CreateDisplay(dpy);
- dpyPriv->driDisplay = driCreateDisplay(dpy);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp b/MesaLib-dfbsd-meson/patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
deleted file mode 100644
index da81a98c10..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-src_intel_compiler_brw__fs__bank__conflicts.cpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-FreeBSD Bugzilla: Bug 225415 graphics/mesa-dri: update to 18.0.0
-
-compiler/brw_fs_bank_conflicts.cpp:719:25: error: scalar initializer cannot be empty
- vector_type s_p = {}, s_n = {};
- ^~
-compiler/brw_fs_bank_conflicts.cpp:719:35: error: scalar initializer cannot be empty
- vector_type s_p = {}, s_n = {};
- ^~
-
---- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/intel/compiler/brw_fs_bank_conflicts.cpp
-@@ -716,7 +716,7 @@ namespace {
- const weight_vector_type &conflicts)
- {
- const unsigned m = DIV_ROUND_UP(conflicts.size, vector_width);
-- vector_type s_p = {}, s_n = {};
-+ vector_type s_p = {0}, s_n = {0};
-
- for (unsigned r = 0; r < m; r++) {
- s_p = adds(s_p, mask(bank_mask_p.v[r], conflicts.v[r]));
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_intel_isl_isl__tiled__memcpy.c b/MesaLib-dfbsd-meson/patches/patch-src_intel_isl_isl__tiled__memcpy.c
deleted file mode 100644
index 0342ae9cac..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_isl_isl__tiled__memcpy.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-src_mesa_drivers_dri_i965_intel__tiled__memcpy.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-From wip/MesaLib 13.0.1.
-
---- src/intel/isl/isl_tiled_memcpy.c.orig 2019-04-12 23:16:58.000000000 +0000
-+++ src/intel/isl/isl_tiled_memcpy.c
-@@ -64,6 +64,11 @@ ror(uint32_t n, uint32_t d)
- return (n >> d) | (n << (32 - d));
- }
-
-+#if defined(__NetBSD__)
-+/* Handle conflicting declaration and conflicting macro in netbsd */
-+#undef bswap32
-+#define bswap32(n) __builtin_bswap32(n)
-+#else /* !__NetBSD__ */
- static inline uint32_t
- bswap32(uint32_t n)
- {
-@@ -76,6 +81,7 @@ bswap32(uint32_t n)
- (n << 24);
- #endif
- }
-+#endif /* NetBSD */
-
- /**
- * Copy RGBA to BGRA - swap R and B.
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_intel_perf_gen__perf.h b/MesaLib-dfbsd-meson/patches/patch-src_intel_perf_gen__perf.h
deleted file mode 100644
index b01d65e18f..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_perf_gen__perf.h
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD$
-
---- src/intel/perf/gen_perf.h.orig 2019-04-17 15:42:13.000000000 +0000
-+++ src/intel/perf/gen_perf.h
-@@ -28,7 +28,9 @@
- #include <stdint.h>
- #include <string.h>
-
-+#ifdef MAJOR_IN_SYSMACROS
- #include <sys/sysmacros.h>
-+#endif
-
- #include "util/hash_table.h"
- #include "util/ralloc.h"
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_intel_tools_aub__mem.c b/MesaLib-dfbsd-meson/patches/patch-src_intel_tools_aub__mem.c
deleted file mode 100644
index eeac52b416..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_tools_aub__mem.c
+++ /dev/null
@@ -1,43 +0,0 @@
-$NetBSD: patch-src_intel_tools_aub__mem.c,v 1.2 2019/05/01 19:31:46 maya Exp $
-
-* Partially implement memfd_create() via mkostemp()
-
---- src/intel/tools/aub_mem.c.orig 2018-12-11 21:13:57.000000000 +0000
-+++ src/intel/tools/aub_mem.c
-@@ -30,11 +30,36 @@
-
- #ifndef HAVE_MEMFD_CREATE
- #include <sys/syscall.h>
-+#if defined(__FreeBSD__)
-+#include <fcntl.h>
-+#endif
-
- static inline int
- memfd_create(const char *name, unsigned int flags)
- {
-+#if defined(SYS_memfd_create)
- return syscall(SYS_memfd_create, name, flags);
-+#elif defined(__FreeBSD__)
-+ return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600);
-+#else /* DragonFly, NetBSD, OpenBSD, Solaris */
-+ char template[] = "/tmp/shmfd-XXXXXX";
-+#ifdef HAVE_MKOSTEMP
-+ int fd = mkostemp(template, flags);
-+#else
-+ int fd = mkstemp(template);
-+ if (flags & O_CLOEXEC) {
-+ int flags = fcntl(fd, F_GETFD);
-+ if (flags != -1) {
-+ flags |= FD_CLOEXEC;
-+ (void) fcntl(fd, F_SETFD, &flags);
-+ }
-+ }
-+#endif /* HAVE_MKOSTEMP */
-+ if (fd >= 0)
-+ unlink(template);
-+
-+ return fd;
-+#endif /* __linux__ */
- }
- #endif
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_intel_tools_aubinator__error__decode.c b/MesaLib-dfbsd-meson/patches/patch-src_intel_tools_aubinator__error__decode.c
deleted file mode 100644
index f35b477226..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_tools_aubinator__error__decode.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_intel_tools_aubinator__error__decode.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Patch from FreeBSD ports graphics/mesa-dri 17.1.0
-
-# expose getline in FreeBSD's stdio.h
-#
-
---- src/intel/tools/aubinator_error_decode.c.orig 2017-05-25 07:13:13.000000000 +0000
-+++ src/intel/tools/aubinator_error_decode.c
-@@ -22,6 +22,9 @@
- *
- */
-
-+#if defined(__FreeBSD__) && __FreeBSD__ < 12
-+#define _WITH_GETLINE
-+#endif
- #include <stdbool.h>
- #include <stdio.h>
- #include <stdlib.h>
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_intel_tools_error2aub.c b/MesaLib-dfbsd-meson/patches/patch-src_intel_tools_error2aub.c
deleted file mode 100644
index 021e598a4f..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_tools_error2aub.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD$
-
-Patch from FreeBSD ports graphics/mesa-dri 18.2.0
-
-# expose getline in FreeBSD's stdio.h
-#
-
---- src/intel/tools/error2aub.c.orig 2018-08-09 00:34:30.000000000 +0000
-+++ src/intel/tools/error2aub.c
-@@ -26,6 +26,9 @@
- #include <getopt.h>
- #include <inttypes.h>
- #include <signal.h>
-+#if defined(__FreeBSD__) && __FreeBSD__ < 12
-+#define _WITH_GETLINE
-+#endif
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__allocator.c b/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__allocator.c
deleted file mode 100644
index c9702282c4..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__allocator.c
+++ /dev/null
@@ -1,62 +0,0 @@
-$NetBSD: patch-src_intel_vulkan_anv__allocator.c,v 1.2 2019/05/01 19:31:46 maya Exp $
-
-* Partially implement memfd_create() via mkostemp()
-* Ignore MAP_POPULATE if unsupported
-
-FreeBSD Bugzilla - Bug 225415: graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
---- src/intel/vulkan/anv_allocator.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/intel/vulkan/anv_allocator.c
-@@ -25,9 +25,21 @@
- #include <unistd.h>
- #include <limits.h>
- #include <assert.h>
-+#ifdef __linux__
- #include <linux/memfd.h>
-+#else
-+#include <fcntl.h>
-+#endif
- #include <sys/mman.h>
-
-+#ifndef MAP_POPULATE
-+#define MAP_POPULATE 0
-+#endif
-+
-+#ifndef MFD_CLOEXEC
-+#define MFD_CLOEXEC O_CLOEXEC
-+#endif
-+
- #include "anv_private.h"
-
- #include "util/hash_table.h"
-@@ -113,7 +125,29 @@ struct anv_mmap_cleanup {
- static inline int
- memfd_create(const char *name, unsigned int flags)
- {
-+#if defined(SYS_memfd_create)
- return syscall(SYS_memfd_create, name, flags);
-+#elif defined(__FreeBSD__)
-+ return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600);
-+#else /* DragonFly, NetBSD, OpenBSD, Solaris */
-+ char template[] = "/tmp/shmfd-XXXXXX";
-+#ifdef HAVE_MKOSTEMP
-+ int fd = mkostemp(template, flags);
-+#else
-+ int fd = mkstemp(template);
-+ if (flags & O_CLOEXEC) {
-+ int flags = fcntl(fd, F_GETFD);
-+ if (flags != -1) {
-+ flags |= FD_CLOEXEC;
-+ (void) fcntl(fd, F_SETFD, &flags);
-+ }
-+ }
-+#endif /* HAVE_MKOSTEMP */
-+ if (fd >= 0)
-+ unlink(template);
-+
-+ return fd;
-+#endif /* __linux__ */
- }
- #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
deleted file mode 100644
index 0a31d5c8d0..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__device.c
+++ /dev/null
@@ -1,61 +0,0 @@
-$NetBSD: patch-src_intel_vulkan_anv__device.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Without sysinfo() fall back to sysconf()
-* Define ETIME if missing
-
-FreeBSD Bugzilla - Bug 225415: graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
-https://reviews.freebsd.org/D17872
-
-* Define CLOCK_MONOTONIC_RAW if missing
-
---- 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>
- #include <string.h>
- #include <sys/mman.h>
-+#ifdef __GLIBC__
- #include <sys/sysinfo.h>
-+#endif
- #include <unistd.h>
- #include <fcntl.h>
- #include <xf86drm.h>
-@@ -49,6 +51,17 @@
- */
- #define MAX_DEBUG_MESSAGE_LENGTH 4096
-
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
-+#ifndef CLOCK_MONOTONIC_RAW
-+# ifdef CLOCK_MONOTONIC_FAST
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
-+# else
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
-+# endif
-+#endif
-+
- static void
- compiler_debug_log(void *data, const char *fmt, ...)
- {
-@@ -85,10 +98,18 @@ static uint64_t
- anv_compute_heap_size(int fd, uint64_t gtt_size)
- {
- /* Query the total ram from the system */
-+#ifdef __GLIBC__
- struct sysinfo info;
- sysinfo(&info);
-
- uint64_t total_ram = (uint64_t)info.totalram * (uint64_t)info.mem_unit;
-+#else
-+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
-+ uint64_t total_ram = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
-+#else
-+ uint64_t total_ram = sysctlbyname(SYSCTL_MEMSIZE, &mem, &size, nullptr, 0);
-+#endif
-+#endif
-
- /* We don't want to burn too much ram with the GPU. If the user has 4GiB
- * or less, we use at most half. If they have more than 4GiB, we use 3/4.
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__gem.c b/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__gem.c
deleted file mode 100644
index aa6716cc1a..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__gem.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_intel_vulkan_anv__gem.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Define ETIME if missing
-
-FreeBSD Bugzilla - Bug 225415: graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
---- src/intel/vulkan/anv_gem.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/intel/vulkan/anv_gem.c
-@@ -26,6 +26,9 @@
- #include <sys/mman.h>
- #include <string.h>
- #include <errno.h>
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
- #include <unistd.h>
- #include <fcntl.h>
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__gem__stubs.c b/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__gem__stubs.c
deleted file mode 100644
index 8f57f1b9bc..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__gem__stubs.c
+++ /dev/null
@@ -1,36 +0,0 @@
-$NetBSD: patch-src_intel_vulkan_anv__gem__stubs.c,v 1.2 2019/05/01 19:31:46 maya Exp $
-
-* Partially implement memfd_create() via mkostemp()
-
---- src/intel/vulkan/anv_gem_stubs.c.orig 2018-12-11 21:13:57.000000000 +0000
-+++ src/intel/vulkan/anv_gem_stubs.c
-@@ -31,7 +31,29 @@
- static inline int
- memfd_create(const char *name, unsigned int flags)
- {
-+#if defined(SYS_memfd_create)
- return syscall(SYS_memfd_create, name, flags);
-+#elif defined(__FreeBSD__)
-+ return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600);
-+#else /* DragonFly, NetBSD, OpenBSD, Solaris */
-+ char template[] = "/tmp/shmfd-XXXXXX";
-+#ifdef HAVE_MKOSTEMP
-+ int fd = mkostemp(template, flags);
-+#else
-+ int fd = mkstemp(template);
-+ if (flags & O_CLOEXEC) {
-+ int flags = fcntl(fd, F_GETFD);
-+ if (flags != -1) {
-+ flags |= FD_CLOEXEC;
-+ (void) fcntl(fd, F_SETFD, &flags);
-+ }
-+ }
-+#endif /* HAVE_MKOSTEMP */
-+ if (fd >= 0)
-+ unlink(template);
-+
-+ return fd;
-+#endif /* __linux__ */
- }
- #endif
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__queue.c b/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__queue.c
deleted file mode 100644
index 5be2fd92e2..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_intel_vulkan_anv__queue.c
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-src_intel_vulkan_anv__queue.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Define ETIME if missing
-* Drop header that was never used (modified for Linux inclusion)
-
-FreeBSD Bugzilla - Bug 225415: graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
---- src/intel/vulkan/anv_queue.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/intel/vulkan/anv_queue.c
-@@ -26,8 +26,14 @@
- */
-
- #include <fcntl.h>
-+#include <errno.h>
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
- #include <unistd.h>
-+#if defined(__linux__)
- #include <sys/eventfd.h>
-+#endif
-
- #include "anv_private.h"
- #include "vk_util.h"
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86-64__tls.h b/MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86-64__tls.h
deleted file mode 100644
index 44ac37d49d..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86-64__tls.h
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-src_mapi_entry__x86-64__tls.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-NetBSD only supports zero-initialized initial-exec tls variables in conjuction
-with dlopen(3) at the moment.
-
-Fix --enable-glx-tls with clang. From FreeBSD.
-
-table_noop_array is only defined for shared-glapi.
-es1api and es2api are not going to be patched for NetBSD.
-
---- src/mapi/entry_x86-64_tls.h.orig 2017-11-20 14:25:47.000000000 +0000
-+++ src/mapi/entry_x86-64_tls.h
-@@ -43,10 +43,19 @@ __asm__(".text\n"
-
- #ifndef __ILP32__
-
-+#if defined(NO_INITIAL_EXEC_NONNULL) && defined(MAPI_MODE_GLAPI)
- #define STUB_ASM_CODE(slot) \
- "movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \
- "movq %fs:(%rax), %r11\n\t" \
-+ "testq %r11, %r11\n\t" \
-+ "cmoveq table_noop_array@GOTPCREL(%rip), %r11\n\t" \
- "jmp *(8 * " slot ")(%r11)"
-+#else
-+#define STUB_ASM_CODE(slot) \
-+ "movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \
-+ "movq %fs:(%rax), %r11\n\t" \
-+ "jmp *(8 * " slot ")(%r11)"
-+#endif
-
- #else
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86__tls.h b/MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86__tls.h
deleted file mode 100644
index 4671b9e42d..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86__tls.h
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-src_mapi_entry__x86__tls.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-NetBSD only supports zero-initialized initial-exec tls variables in conjuction
-with dlopen(3) at the moment.
-
-Fix --enable-glx-tls with clang. From FreeBSD.
-
-table_noop_array is only defined for shared-glapi.
-es1api and es2api are not going to be patched for NetBSD.
-
---- src/mapi/entry_x86_tls.h.orig 2018-01-18 21:30:29.000000000 +0000
-+++ src/mapi/entry_x86_tls.h
-@@ -56,10 +56,27 @@ __asm__(".balign 16\n"
- ".balign 16\n" \
- func ":"
-
-+#if defined(NO_INITIAL_EXEC_NONNULL) && defined(MAPI_MODE_GLAPI)
-+extern const mapi_func table_noop_array[];
- #define STUB_ASM_CODE(slot) \
- "call x86_current_tls\n\t" \
- "movl %gs:(%eax), %eax\n\t" \
-+ "testl %eax, %eax\n\t" \
-+ "je 1f\n\t" \
-+ "jmp *(4 * " slot ")(%eax)\n\t" \
-+ "1:\n\t" \
-+ "call 2f\n" \
-+ "2:\n\t" \
-+ "popl %eax\n\t" \
-+ "addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax\n\t" \
-+ "movl table_noop_array@GOT(%eax), %eax\n\t" \
- "jmp *(4 * " slot ")(%eax)"
-+#else
-+#define STUB_ASM_CODE(slot) \
-+ "call x86_current_tls\n\t" \
-+ "movl %gs:(%eax), %eax\n\t" \
-+ "jmp *(4 * " slot ")(%eax)"
-+#endif
-
- #define MAPI_TMP_STUB_ASM_GCC
- #include "mapi_tmp.h"
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
deleted file mode 100644
index 96e0232156..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mapi_entry__x86__tsd.h
+++ /dev/null
@@ -1,86 +0,0 @@
-$NetBSD$
-
-From OpenBSD xenocara
-
-Make similiar changes to the i386 tsd dispatch assembly as libglvnd to
-avoid a text relocation fixing the build with lld.
-
-This time store the address of the GOT in ebx as required before calling
-the PLT stub and change .balign value to match X86_ENTRY_SIZE as suggested
-by naddy.
-
---- 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_mapi_glapi_gen_gl__gentable.py b/MesaLib-dfbsd-meson/patches/patch-src_mapi_glapi_gen_gl__gentable.py
deleted file mode 100644
index 4145993160..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mapi_glapi_gen_gl__gentable.py
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-src_mapi_glapi_gen_gl__gentable.py,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-FreeBSD support.
-
---- src/mapi/glapi/gen/gl_gentable.py.orig 2017-02-13 11:55:49.000000000 +0000
-+++ src/mapi/glapi/gen/gl_gentable.py
-@@ -44,7 +44,7 @@ header = """/* GLXEXT is the define used
- #endif
-
- #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
-- || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__))
-+ || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__))
- #define USE_BACKTRACE
- #endif
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mapi_u__current.c b/MesaLib-dfbsd-meson/patches/patch-src_mapi_u__current.c
deleted file mode 100644
index 27f505d9ad..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mapi_u__current.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-src_mapi_u__current.c,v 1.1 2018/10/07 23:49:31 ryoon 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 _glapi_table *u_current_table
- __attribute__((tls_model("initial-exec")))
-+#if defined(NO_INITIAL_EXEC_NONNULL)
-+ = NULL; /* non-zero initializers not supported with dlopen */
-+#else
- = (struct _glapi_table *) table_noop_array;
-+#endif
-
- __thread void *u_current_context
- __attribute__((tls_model("initial-exec")));
-@@ -283,7 +287,11 @@ struct _glapi_table *
- u_current_get_table_internal(void)
- {
- #if defined(GLX_USE_TLS)
-+# if defined(NO_INITIAL_EXEC_NONNULL)
-+ return (likely(u_current_table) ? u_current_table : (struct _glapi_table *) table_noop_array);
-+# else
- return u_current_table;
-+# endif
- #else
- if (ThreadSafe)
- return (struct _glapi_table *) tss_get(u_current_table_tsd);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mapi_u__current.h b/MesaLib-dfbsd-meson/patches/patch-src_mapi_u__current.h
deleted file mode 100644
index 8b393394a4..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mapi_u__current.h
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-src_mapi_u__current.h,v 1.1 2018/10/07 23:49:31 ryoon 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 _glapi_table *
- u_current_get_table(void)
- {
--#ifdef GLX_USE_TLS
-+#if defined(GLX_USE_TLS) && !defined(NO_INITIAL_EXEC_NONNULL)
- return u_current_table;
- #else
- return (likely(u_current_table) ?
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
deleted file mode 100644
index ebb4850734..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i915_intel__screen.c
+++ /dev/null
@@ -1,44 +0,0 @@
-$NetBSD: patch-src_mesa_drivers_dri_i915_intel__screen.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Move sys/sysctl.h include because on NetBSD, sysctl.h includes sys/param.h,
-and sys/param.h defines a one argument ALIGN. Allows mesa to redefine
-to a two argument ALIGN.
-
-Fix build on older NetBSD w/o _SC_PHYS_PAGES.
-
---- src/mesa/drivers/dri/i915/intel_screen.c.orig 2017-11-10 23:18:56.000000000 +0000
-+++ src/mesa/drivers/dri/i915/intel_screen.c
-@@ -28,6 +28,11 @@
- #include <errno.h>
- #include <time.h>
- #include <unistd.h>
-+
-+#if defined(HAVE_SYS_SYSCTL_H) && defined(PHYSMEM_NETBSD)
-+# include <sys/sysctl.h>
-+#endif
-+
- #include "main/glheader.h"
- #include "main/context.h"
- #include "main/framebuffer.h"
-@@ -739,6 +744,13 @@ i915_query_renderer_integer(__DRIscreen
- const unsigned gpu_mappable_megabytes =
- (aper_size / (1024 * 1024)) * 3 / 4;
-
-+#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);
-+ if (sysctl(mib, 2, &system_memory_bytes, &len, NULL, 0) != 0)
-+ return -1;
-+#else
- const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
- const long system_page_size = sysconf(_SC_PAGE_SIZE);
-
-@@ -747,6 +759,7 @@ i915_query_renderer_integer(__DRIscreen
-
- const uint64_t system_memory_bytes = (uint64_t) system_memory_pages
- * (uint64_t) system_page_size;
-+#endif
-
- const unsigned system_memory_megabytes =
- (unsigned) (system_memory_bytes / (1024 * 1024));
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c b/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c
deleted file mode 100644
index d04c4ee68a..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD$
-
-From Ravenports
-
-graphics/mesa-dri: Disable soft-spinning of all buffers (#169)
-
-* It is broken with current DragonFly 5.4 and 5.5 kernels
-
-* This patch is a revert of Mesa's
-commit: a363bb2cd0e2a141f2c60be005009703bffcbe4e
-"i965: Allocate VMA in userspace for full-PPGTT systems."
-Date: Tue Apr 10 01:18:25 2018 -0700
-
-Discussion in
-
-https://bugs.dragonflybsd.org/issues/3171
-
---- src/mesa/drivers/dri/i965/brw_bufmgr.c.orig 2019-05-03 15:59:12.000000000 +0000
-+++ src/mesa/drivers/dri/i965/brw_bufmgr.c
-@@ -1721,7 +1721,11 @@ brw_bufmgr_init(struct gen_device_info *
- bufmgr->initial_kflags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
-
- /* Allocate VMA in userspace if we have softpin and full PPGTT. */
-+#if defined(REVERT_I965_SOFTPIN)
-+ if (false && gem_param(fd, I915_PARAM_HAS_EXEC_SOFTPIN) > 0 &&
-+#else
- if (gem_param(fd, I915_PARAM_HAS_EXEC_SOFTPIN) > 0 &&
-+#endif
- gem_param(fd, I915_PARAM_HAS_ALIASING_PPGTT) > 1) {
- bufmgr->initial_kflags |= EXEC_OBJECT_PINNED;
-
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
deleted file mode 100644
index 4b9bb6484a..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_intel__screen.c
+++ /dev/null
@@ -1,81 +0,0 @@
-$NetBSD: patch-src_mesa_drivers_dri_i965_intel__screen.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Move sys/sysctl.h include because on NetBSD, sysctl.h includes sys/param.h,
-and sys/param.h defines a one argument ALIGN. Allows mesa to redefine
-to a two argument ALIGN.
-
-Fix build on older NetBSD w/o _SC_PHYS_PAGES.
-
-From FreeBSD ports graphics/mesa-dri 18.1.4
-
-# Partial revert of the following commit because the feature check fails on 10.x
-# which disables HW accel on gen4+ (the new check occurs for gen6+ as well)
-
-From 088449487ebcb72561d73ffb91c96302583445a8 Mon Sep 17 00:00:00 2001
-Date: Wed, 22 Mar 2017 15:20:51 -0700
-Subject: i965: Require Kernel 3.6 for Gen4-5 platforms.
-
-We've already required Kernel 3.6 on Gen6+ since Mesa 9.2 (May 2013,
-commit 92d2f5acfadea672417b6785710c9e8b7f605e41). It seems reasonable
-to require it for Gen4-5 as well, bumping the requirement from 2.6.39.
-
-This is necessary for glClientWaitSync with a timeout to work, which
-is a feature we expose on Gen4-5. Without it, we would fall back to an
-infinite wait, which is pretty bad.
-
-See kernel commit 172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+.
-
---- src/mesa/drivers/dri/i965/intel_screen.c.orig 2017-11-10 23:18:56.000000000 +0000
-+++ src/mesa/drivers/dri/i965/intel_screen.c
-@@ -27,6 +27,11 @@
- #include <errno.h>
- #include <time.h>
- #include <unistd.h>
-+
-+#if defined(HAVE_SYS_SYSCTL_H) && defined(PHYSMEM_NETBSD)
-+# include <sys/sysctl.h>
-+#endif
-+
- #include "main/context.h"
- #include "main/framebuffer.h"
- #include "main/renderbuffer.h"
-@@ -1470,6 +1475,13 @@ brw_query_renderer_integer(__DRIscreen *
- const unsigned gpu_mappable_megabytes =
- screen->aperture_threshold / (1024 * 1024);
-
-+#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);
-+ if (sysctl(mib, 2, &system_memory_bytes, &len, NULL, 0) != 0)
-+ return -1;
-+#else
- const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
- const long system_page_size = sysconf(_SC_PAGE_SIZE);
-
-@@ -1478,6 +1490,7 @@ brw_query_renderer_integer(__DRIscreen *
-
- const uint64_t system_memory_bytes = (uint64_t) system_memory_pages
- * (uint64_t) system_page_size;
-+#endif
-
- const unsigned system_memory_megabytes =
- (unsigned) (system_memory_bytes / (1024 * 1024));
-@@ -1840,10 +1853,17 @@ intel_init_bufmgr(struct intel_screen *s
- return false;
- }
-
-+#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;
-+ }
-+#else
- if (!intel_get_boolean(screen, I915_PARAM_HAS_EXEC_NO_RELOC)) {
- fprintf(stderr, "[%s: %u] Kernel 3.9 required.\n", __func__, __LINE__);
- return false;
- }
-+#endif
-
- return true;
- }
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
deleted file mode 100644
index 997e89a030..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_swrast_swrast.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_mesa_drivers_dri_swrast_swrast.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Fix build on older NetBSD w/o _SC_PHYS_PAGES.
-
---- src/mesa/drivers/dri/swrast/swrast.c.orig 2017-10-19 12:23:53.000000000 +0000
-+++ src/mesa/drivers/dri/swrast/swrast.c
-@@ -151,6 +151,12 @@ swrast_query_renderer_integer(__DRIscree
- 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(PHYSMEM_NETBSD)
-+ int mib[2] = { CTL_HW, HW_PHYSMEM64 };
-+ uint64_t system_memory_bytes;
-+ size_t len = sizeof(system_memory_bytes);
-+ if (sysctl(mib, 2, &system_memory_bytes, &len, NULL, 0) != 0)
-+ return -1;
- #elif defined(_SC_PHYS_PAGES) && defined(_SC_PAGE_SIZE)
- /* XXX: Do we want to return the full amount of system memory ? */
- const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_context.c b/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_context.c
deleted file mode 100644
index 7c32f870db..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_context.c
+++ /dev/null
@@ -1,57 +0,0 @@
-$NetBSD: patch-src_mesa_main_context.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Fix exit time segfault of qt5 application with modular xorg
-
-Bug 82246 (atexit) - Libraries should not call atexit()
-
-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 2019-05-03 15:59:12.000000000 +0000
-+++ src/mesa/main/context.c
-@@ -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 void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- one_time_fini(void)
- {
-+#if defined(HAVE_NOATEXIT)
-+ if (api_init_mask) {
-+ _mesa_destroy_shader_compiler();
-+ _mesa_locale_fini();
-+ }
-+#else
- _mesa_destroy_shader_compiler();
- _mesa_locale_fini();
-+#endif
- }
-
- /**
-@@ -376,7 +388,9 @@ one_time_fini(void)
- static void
- one_time_init( struct gl_context *ctx )
- {
-+#if !defined(HAVE_NOATEXIT)
- static GLbitfield api_init_mask = 0x0;
-+#endif
-
- mtx_lock(&OneTimeLock);
-
-@@ -401,7 +415,9 @@ one_time_init( struct gl_context *ctx )
- _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
- }
-
-+#if !defined(HAVE_NOATEXIT)
- atexit(one_time_fini);
-+#endif
-
- #if defined(DEBUG)
- if (MESA_VERBOSE != 0) {
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_extensions.c b/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_extensions.c
deleted file mode 100644
index f95e76ba3f..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_extensions.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-src_mesa_main_extensions.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-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/mesa/main/extensions.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/mesa/main/extensions.c
-@@ -203,7 +203,11 @@ set_extension(struct gl_extensions *ext,
- * This string is allocated early during the first context creation by
- * _mesa_one_time_init_extension_overrides.
- */
-+#if defined(HAVE_NOATEXIT)
-+static void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- free_unknown_extensions_strings(void)
- {
- free(unrecognized_extensions);
-@@ -293,7 +297,9 @@ _mesa_one_time_init_extension_overrides(
- free(env);
- } else {
- unrecognized_extensions = env;
-+#if !defined(HAVE_NOATEXIT)
- atexit(free_unknown_extensions_strings);
-+#endif
- }
- }
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_macros.h b/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_macros.h
deleted file mode 100644
index 4c2ab4bb54..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_macros.h
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_mesa_main_macros.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-ALIGN is also defined in sys/param.h on NetBSD.
-
-Extend undefining ALIGN to all other OSes.
-
---- src/mesa/main/macros.h.orig 2017-11-10 23:18:56.000000000 +0000
-+++ src/mesa/main/macros.h
-@@ -677,6 +677,9 @@ minify(unsigned value, unsigned levels)
- *
- * \sa ROUND_DOWN_TO()
- */
-+#ifdef ALIGN
-+#undef ALIGN
-+#endif
- static inline uintptr_t
- ALIGN(uintptr_t value, int32_t alignment)
- {
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_shader__query.cpp b/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_shader__query.cpp
deleted file mode 100644
index 5947beff03..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_main_shader__query.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-$NetBSD: patch-src_mesa_main_shader__query.cpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-https://bugs.freedesktop.org/show_bug.cgi?id=66346
-
-From c4a1fec68d2508ff0c4fc2831465aca8c4ca783a Mon Sep 17 00:00:00 2001
-From: Julien Isorce <j.isorce%samsung.com@localhost>
-Date: Wed, 22 Apr 2015 23:04:42 +0100
-Subject: [PATCH 1/2] shader_query: convert GLhandleARB to uintptr_t before
- troncating to GLuint
-
-Fixes compiler error on OSX as GLhandleARB is defined as void* if __APPLE__.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=66346
----
- src/mesa/main/shader_query.cpp | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- src/mesa/main/shader_query.cpp.orig 2016-11-10 22:05:17.000000000 +0000
-+++ src/mesa/main/shader_query.cpp
-@@ -70,7 +70,12 @@ _mesa_BindAttribLocation(GLuint program,
- GET_CURRENT_CONTEXT(ctx);
-
- struct gl_shader_program *const shProg =
-+#if defined(__APPLE__)
-+ _mesa_lookup_shader_program_err(ctx, (GLuint)(uintptr_t)program, "glBindAttribLocation");
-+#else
- _mesa_lookup_shader_program_err(ctx, program, "glBindAttribLocation");
-+#endif
-+
- if (!shProg)
- return;
-
-@@ -114,7 +119,12 @@ _mesa_GetActiveAttrib(GLuint program, GL
- return;
- }
-
-+#if defined(__APPLE__)
-+ shProg = _mesa_lookup_shader_program_err(ctx, (GLuint)(uintptr_t)program, "glGetActiveAttrib");
-+#else
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
-+#endif
-+
- if (!shProg)
- return;
-
-@@ -159,7 +169,12 @@ _mesa_GetAttribLocation(GLuint program,
- {
- GET_CURRENT_CONTEXT(ctx);
- struct gl_shader_program *const shProg =
-+
-+#if defined(__APPLE__)
-+ _mesa_lookup_shader_program_err(ctx, (GLuint)(uintptr_t)program, "glGetAttribLocation");
-+#else
- _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation");
-+#endif
-
- if (!shProg) {
- return -1;
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_x86_common__x86.c b/MesaLib-dfbsd-meson/patches/patch-src_mesa_x86_common__x86.c
deleted file mode 100644
index d3f37abba4..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_x86_common__x86.c
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-src_mesa_x86_common__x86.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-DragonFly support.
-
---- src/mesa/x86/common_x86.c.orig 2017-05-10 14:13:58.000000000 +0000
-+++ src/mesa/x86/common_x86.c
-@@ -35,7 +35,7 @@
- */
-
- /* XXX these includes should probably go into imports.h or glheader.h */
--#if defined(USE_SSE_ASM) && defined(__FreeBSD__)
-+#if defined(USE_SSE_ASM) && (defined(__FreeBSD__) || defined(__DragonFly__))
- #include <sys/types.h>
- #include <sys/sysctl.h>
- #endif
-@@ -125,7 +125,7 @@ static LONG WINAPI ExceptionFilter(LPEXC
- */
- void _mesa_check_os_sse_support( void )
- {
--#if defined(__FreeBSD__)
-+#if defined(__FreeBSD__) || defined(__DragonFly__)
- {
- int ret, enabled;
- unsigned int len;
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_build__id.c b/MesaLib-dfbsd-meson/patches/patch-src_util_build__id.c
deleted file mode 100644
index 501bb73520..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_build__id.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-src_util_build__id.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Patch combining DragonFly dports and FreeBSD ports graphics/mesa-dri 18.2.0
-
---- src/util/build_id.c.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/util/build_id.c
-@@ -35,7 +35,19 @@
- #endif
-
- #ifndef ElfW
-+#if defined(__DragonFly__)
-+#ifdef __LP64__
-+#define ElfW(type) Elf64_##type
-+#else
-+#define ElfW(type) Elf32_##type
-+#endif /* __LP64__ */
-+#else
- #define ElfW(type) Elf_##type
-+#endif /* __DragonFly__ */
-+#endif
-+
-+#if defined(__FreeBSD__) && __FreeBSD__ < 12
-+typedef Elf_Note Elf_Nhdr;
- #endif
-
- struct build_id_note {
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_disk__cache.c b/MesaLib-dfbsd-meson/patches/patch-src_util_disk__cache.c
deleted file mode 100644
index 8fd302e35c..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_disk__cache.c
+++ /dev/null
@@ -1,29 +0,0 @@
-$NetBSD: patch-src_util_disk__cache.c,v 1.1 2018/10/16 15:21:20 jperkin Exp $
-
-Use fcntl() on SunOS.
-
---- src/util/disk_cache.c.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/util/disk_cache.c
-@@ -857,6 +857,9 @@ cache_put(void *job, int thread_index)
- unsigned i = 0;
- char *filename = NULL, *filename_tmp = NULL;
- struct disk_cache_put_job *dc_job = (struct disk_cache_put_job *) job;
-+#ifdef __sun
-+ struct flock lock = {0};
-+#endif
-
- filename = get_cache_file(dc_job->cache, dc_job->key);
- if (filename == NULL)
-@@ -895,7 +898,12 @@ cache_put(void *job, int thread_index)
- * open with the flock held. So just let that file be responsible
- * for writing the file.
- */
-+#ifdef __sun
-+ lock.l_type = F_WRLCK;
-+ err = fcntl(fd, F_SETLK, &lock);
-+#else
- err = flock(fd, LOCK_EX | LOCK_NB);
-+#endif
- if (err == -1)
- goto done;
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_os__time.c b/MesaLib-dfbsd-meson/patches/patch-src_util_os__time.c
deleted file mode 100644
index 07a3d4cb03..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_os__time.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD$
-
-- Use monotonic clock for timeouts
-
-FreeBSD Bugzilla - Bug 225415 graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
---- src/util/os_time.c.orig 2018-05-11 23:27:04.000000000 +0000
-+++ src/util/os_time.c
-@@ -95,7 +95,7 @@ os_time_get_nano(void)
- void
- os_time_sleep(int64_t usecs)
- {
--#if 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_ralloc.c b/MesaLib-dfbsd-meson/patches/patch-src_util_ralloc.c
deleted file mode 100644
index 46f1e97651..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_ralloc.c
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-src_util_ralloc.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-FreeBSD reported atexit bug for 10.6:
-https://bugs.freedesktop.org/show_bug.cgi?id=91869
-
-* Fix exit time segfault of qt5 application with modular xorg
-* Provide compat strnlen for older Darwin.
-
---- src/util/ralloc.c.orig 2017-05-10 14:13:58.000000000 +0000
-+++ src/util/ralloc.c
-@@ -368,7 +368,14 @@ ralloc_strndup(const void *ctx, const ch
- if (unlikely(str == NULL))
- return NULL;
-
-+#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
-+ for (n = 0; n < max; n++, str++) {
-+ if (!*str)
-+ break;
-+ }
-+#else
- n = strnlen(str, max);
-+#endif
- ptr = ralloc_array(ctx, char, n + 1);
- memcpy(ptr, str, n);
- ptr[n] = '\0';
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_ralloc.h b/MesaLib-dfbsd-meson/patches/patch-src_util_ralloc.h
deleted file mode 100644
index 12125d2ef1..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_ralloc.h
+++ /dev/null
@@ -1,51 +0,0 @@
-$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_strndup.h b/MesaLib-dfbsd-meson/patches/patch-src_util_strndup.h
deleted file mode 100644
index bca6f2d575..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_strndup.h
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-src_util_strndup.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Provide compat strndup for older Darwin.
-
---- src/util/strndup.h.orig 2017-05-10 14:13:58.000000000 +0000
-+++ src/util/strndup.h
-@@ -24,7 +24,7 @@
- #ifndef STRNDUP_H
- #define STRNDUP_H
-
--#if defined(_WIN32)
-+#if defined(_WIN32) || (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
-
- #include <stdlib.h> // size_t
- #include <string.h>
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_u__atomic.h b/MesaLib-dfbsd-meson/patches/patch-src_util_u__atomic.h
deleted file mode 100644
index b81aef1e77..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_u__atomic.h
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-src_util_u__atomic.h,v 1.2 2018/10/16 15:21:20 jperkin Exp $
-
-Fix SunOS atomic macros.
-
---- src/util/u_atomic.h.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/util/u_atomic.h
-@@ -20,7 +20,7 @@
- * locally coded assembly, compiler intrinsic or ultimately a
- * mutex-based implementation.
- */
--#if defined(__sun)
-+#if defined(__sun) && !defined(__GNUC__)
- #define PIPE_ATOMIC_OS_SOLARIS
- #elif defined(_MSC_VER)
- #define PIPE_ATOMIC_MSVC_INTRINSIC
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_u__process.c b/MesaLib-dfbsd-meson/patches/patch-src_util_u__process.c
deleted file mode 100644
index 0b5b84eac3..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_u__process.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$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) || defined(NO_GETPROGRAMNAME)
- /* 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
deleted file mode 100644
index d163b3ce6c..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_u__queue.c
+++ /dev/null
@@ -1,72 +0,0 @@
-$NetBSD: patch-src_util_u__queue.c,v 1.2 2019/01/10 22:30:11 tnn Exp $
-
-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
-
-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;
- static mtx_t exit_mutex = _MTX_INITIALIZER_NP;
-
-+#if defined(HAVE_NOATEXIT)
-+static int global_init_called = 0;
-+
-+static void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- atexit_handler(void)
- {
- struct util_queue *iter;
-
-+#if defined(HAVE_NOATEXIT)
-+ if (!global_init_called)
-+ return;
-+#endif
-+
- mtx_lock(&exit_mutex);
- /* Wait for all queues to assert idle. */
- LIST_FOR_EACH_ENTRY(iter, &queue_list, head) {
-@@ -63,7 +74,11 @@ static void
- global_init(void)
- {
- LIST_INITHEAD(&queue_list);
-+#if defined(HAVE_NOATEXIT)
-+ global_init_called = 1;
-+#else
- atexit(atexit_handler);
-+#endif
- }
-
- static void
-@@ -244,12 +259,25 @@ util_queue_thread_func(void *input)
- /* Don't inherit the thread affinity from the parent thread.
- * Set the full mask.
- */
-+#if defined(__NetBSD__) && defined(SETAFFINITY_NP_NETBSD)
-+ cpuset_t *cpuset;
-+ cpuset = cpuset_create();
-+ if (cpuset != NULL) {
-+ cpuset_zero(cpuset);
-+ for (unsigned i = 0; i < cpuset_size(cpuset); i++)
-+ cpuset_set(i, cpuset);
-+
-+ pthread_setaffinity_np(pthread_self(), cpuset_size(cpuset), cpuset);
-+ cpuset_destroy(cpuset);
-+ }
-+#else
- cpu_set_t cpuset;
- CPU_ZERO(&cpuset);
- for (unsigned i = 0; i < CPU_SETSIZE; i++)
- CPU_SET(i, &cpuset);
-
- pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset);
-+#endif
- }
- #endif
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h b/MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h
deleted file mode 100644
index 8f27f91a28..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_u__thread.h
+++ /dev/null
@@ -1,113 +0,0 @@
-$NetBSD: patch-src_util_u__thread.h,v 1.2 2019/01/20 09:50:28 tnn Exp $
-
-handle NetBSD-style pthread_setaffinity_np(3)
-
-From FreeBSD ports / DragonFly dports
-
-- Implement setting thread name
-- Use monotonic clock for timeouts
-
---- src/util/u_thread.h.orig 2019-03-15 01:02:19.000000000 +0000
-+++ src/util/u_thread.h
-@@ -34,6 +34,13 @@
-
- #ifdef HAVE_PTHREAD
- #include <signal.h>
-+#if defined(__DragonFly__) || defined(__FreeBSD__)
-+#include <pthread_np.h>
-+# if !defined(__DragonFly__)
-+# define cpu_set_t cpuset_t
-+# endif
-+#undef ALIGN /* Avoid conflict on FreeBSD in main/macros.h */
-+#endif
- #endif
-
- static inline thrd_t u_thread_create(int (*routine)(void *), void *param)
-@@ -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);
-+# elif defined(__DragonFly__) || defined(__FreeBSD__)
-+ pthread_set_name_np(pthread_self(), name);
- # endif
- #endif
- (void)name;
-@@ -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__) && defined(SETAFFINITY_NP_NETBSD)
-+ cpuset_t *cpuset;
-+ cpuset = cpuset_create();
-+ if (cpuset == NULL)
-+ return;
-+ cpuset_zero(cpuset);
-+ for (unsigned i = 0; i < cores_per_L3; i++)
-+ cpuset_set(L3_index * cores_per_L3 + i, cpuset);
-+ pthread_setaffinity_np(thread, cpuset_size(cpuset), cpuset);
-+ cpuset_destroy(cpuset);
-+#else
- cpu_set_t cpuset;
-
- CPU_ZERO(&cpuset);
-@@ -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
-+#endif
- }
-
- /**
-@@ -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__) && defined(SETAFFINITY_NP_NETBSD)
-+ cpuset_t *cpuset;
-+
-+ cpuset = cpuset_create();
-+ if (cpuset == NULL)
-+ return -1;
-+
-+ if (pthread_getaffinity_np(thread, cpuset_size(cpuset), cpuset) == 0) {
-+ int L3_index = -1;
-+
-+ for (unsigned i = 0; i < cpuset_size(cpuset); i++) {
-+ if (cpuset_isset(i, cpuset)) {
-+ int x = i / cores_per_L3;
-+
-+ if (L3_index != x) {
-+ if (L3_index == -1)
-+ L3_index = x;
-+ else {
-+ cpuset_destroy(cpuset);
-+ return -1; /* multiple L3s are set */
-+ }
-+ }
-+ }
-+ }
-+ cpuset_destroy(cpuset);
-+ return L3_index;
-+ }
-+ cpuset_destroy(cpuset);
-+#else
- cpu_set_t cpuset;
-
- if (pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset) == 0) {
-@@ -124,6 +174,7 @@ util_get_L3_for_pinned_thread(thrd_t thr
- return L3_index;
- }
- #endif
-+#endif
- return -1;
- }
-
-@@ -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)
- {
--#if defined(__linux__) && defined(HAVE_PTHREAD)
-+#if (defined(__linux__) || defined(USE_PTHREAD_GETCPUCLOCKID)) && defined(HAVE_PTHREAD)
- struct timespec ts;
- clockid_t cid;
-
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_xmlconfig.c b/MesaLib-dfbsd-meson/patches/patch-src_util_xmlconfig.c
deleted file mode 100644
index 87def19ed9..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_xmlconfig.c
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-src_util_xmlconfig.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-PR pkg/50202.
-Provide compat strndup for older Darwin.
-
---- src/util/xmlconfig.c.orig 2019-03-05 18:53:12.177053000 +0000
-+++ src/util/xmlconfig.c
-@@ -47,6 +47,24 @@
- #define PATH_MAX 4096
- #endif
-
-+#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
-+static char *
-+strndup(const char *str, size_t n)
-+{
-+ size_t len;
-+ char *copy;
-+
-+ for (len = 0; len < n && str[len]; len++)
-+ continue;
-+
-+ if ((copy = (char *)malloc(len + 1)) == NULL)
-+ return (NULL);
-+ memcpy(copy, str, len);
-+ copy[len] = '\0';
-+ return (copy);
-+}
-+#endif
-+
- /** \brief Find an option in an option cache with the name as key */
- static uint32_t
- findOption(const driOptionCache *cache, const char *name)
diff --git a/MesaLib-dfbsd/DESCR b/MesaLib-dfbsd/DESCR
deleted file mode 100644
index 8a8cccf5b9..0000000000
--- a/MesaLib-dfbsd/DESCR
+++ /dev/null
@@ -1,5 +0,0 @@
-MesaLib is a 3-D graphics library with an API which is very similar to
-that of OpenGL*. To the extent that Mesa utilizes the OpenGL command syntax
-or state machine, it is being used with authorization from Silicon Graphics,
-Inc. However, the author makes no claim that Mesa is in any way a
-compatible replacement for OpenGL or associated with Silicon Graphics, Inc.
diff --git a/MesaLib-dfbsd/Makefile b/MesaLib-dfbsd/Makefile
deleted file mode 100644
index 0caa958962..0000000000
--- a/MesaLib-dfbsd/Makefile
+++ /dev/null
@@ -1,131 +0,0 @@
-# $NetBSD: Makefile,v 1.20 2019/04/25 07:32:56 maya Exp $
-
-DISTNAME= mesa-18.3.6
-PKGNAME= ${DISTNAME:S/mesa/MesaLib/}
-# DISTNAME= mesa-18.2.0-rc6
-# PKGNAME= MesaLib-18.2.0
-# PKGREVISION= 1
-CATEGORIES= graphics x11
-MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/
-# MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/${PKGVERSION_NOREV}/
-EXTRACT_SUFX= .tar.xz
-
-MAINTAINER= pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE= https://www.mesa3d.org/
-COMMENT= The Mesa 3D Graphics Library
-LICENSE= mit
-
-# GNU_CONFIGURE= yes
-# USE_TOOLS+= autoconf automake autoreconf bison pkg-config flex
-USE_TOOLS+= bison pkg-config flex
-USE_LANGUAGES= c99 c++
-# USE_LIBTOOL= yes
-
-PKGCONFIG_OVERRIDE+= src/egl/main/egl.pc.in
-PKGCONFIG_OVERRIDE+= src/gallium/targets/d3dadapter9/d3d.pc.in
-PKGCONFIG_OVERRIDE+= src/gallium/targets/osmesa/osmesa.pc.in
-PKGCONFIG_OVERRIDE+= src/gallium/targets/xa/xatracker.pc.in
-PKGCONFIG_OVERRIDE+= src/gbm/main/gbm.pc.in
-PKGCONFIG_OVERRIDE+= src/glx/windows/windowsdriproto.pc.in
-PKGCONFIG_OVERRIDE+= src/mapi/es1api/glesv1_cm.pc.in
-PKGCONFIG_OVERRIDE+= src/mapi/es2api/glesv2.pc.in
-PKGCONFIG_OVERRIDE+= src/mesa/drivers/dri/dri.pc.in
-PKGCONFIG_OVERRIDE+= src/mesa/drivers/osmesa/osmesa.pc.in
-PKGCONFIG_OVERRIDE+= src/mesa/gl.pc.in
-
-CONFIGURE_ARGS+= --enable-shared-glapi
-MESON_ARGS+= -Dshared-glapi=true
-
-# Work around a buildlink and/or libtool bug:
-# In the libtool install/relink stage, if we want to link with two static
-# archives named libglapi.la but in different directories, bad things happen.
-SUBST_CLASSES+= wrapper-bug
-SUBST_STAGE.wrapper-bug= pre-configure
-SUBST_MESSAGE.wrapper-bug= Renaming non-shared libglapi.la in Makefiles
-SUBST_FILES.wrapper-bug= src/gallium/targets/libgl-xlib/Makefile.am
-SUBST_FILES.wrapper-bug+= src/gallium/targets/osmesa/Makefile.am
-SUBST_FILES.wrapper-bug+= src/glx/Makefile.am
-SUBST_FILES.wrapper-bug+= src/mapi/Makefile.am
-SUBST_FILES.wrapper-bug+= src/mesa/drivers/osmesa/Makefile.am
-SUBST_FILES.wrapper-bug+= src/mesa/drivers/x11/Makefile.am
-SUBST_SED.wrapper-bug= -e 's,shared-glapi/libglapi\.la,shared-glapi/libglapi_tmp_rename.la,g'
-SUBST_SED.wrapper-bug+= -e 's,shared_glapi_libglapi_la,shared_glapi_libglapi_tmp_rename_la,g'
-SUBST_SED.wrapper-bug+= -e 's,libglapi\.la,libglapi_impl.la,g'
-SUBST_SED.wrapper-bug+= -e 's,libglapi_la,libglapi_impl_la,g'
-SUBST_SED.wrapper-bug+= -e 's,libglapi_tmp_rename\.la,libglapi.la,g'
-SUBST_SED.wrapper-bug+= -e 's,libglapi_tmp_rename_la,libglapi_la,g'
-
-# Replace /etc/drirc.d with ${PREFIX}/etc/drirc.d
-SUBST_CLASSES+= drirc
-SUBST_STAGE.drirc= pre-configure
-SUBST_MESSAGE.drirc= Fixing hardcoded /etc/drirc.d references
-SUBST_FILES.drirc+= src/util/xmlconfig.c
-SUBST_SED.drirc+= -e 's|/etc|${PREFIX}/etc|g'
-
-CFLAGS.SunOS+= -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS
-CXXFLAGS.SunOS+= -Drestrict=__restrict__
-LDFLAGS.SunOS+= -lsocket -lnsl
-
-.include "../../mk/bsd.prefs.mk"
-.include "../../mk/compiler.mk"
-.include "options.mk"
-
-.if ${MACHINE_ARCH} == "i386"
-CONFIGURE_ARGS+= --enable-glx-read-only-text
-MESON_ARGS+= -Dglx-read-only-text=true
-.endif
-
-PYTHON_FOR_BUILD_ONLY= yes
-TOOL_DEPENDS+= ${PYPKGPREFIX}-mako-[0-9]*:../../devel/py-mako
-# needed to build vulkan support
-TOOL_DEPENDS+= ${PYPKGPREFIX}-cElementTree-[0-9]*:../../textproc/py-cElementTree
-CONFIGURE_ENV+= PYTHON=${PYTHONBIN}
-.include "../../lang/python/tool.mk"
-
-# Handle platforms without exp2
-.if !empty(MACHINE_PLATFORM:MNetBSD-[1-5].*-*)
-CPPFLAGS+= -Dexp2\(x\)=exp\(\(x\)\*M_LN2\)
-CPPFLAGS+= -Dexp2f\(x\)=expf\(\(x\)\*M_LN2\)
-.endif
-
-# Work around Xorg segfaulting in radeon driver due to wrong alloca being used
-CFLAGS.NetBSD+= -Dalloca=__builtin_alloca
-CXXFLAGS.NetBSD+= -Dalloca=__builtin_alloca
-
-# Autotools is being phased out
-CONFIGURE_ARGS+= --enable-autotools
-
-pre-configure:
- touch ${WRKSRC}/src/glx/apple_dummy.cpp
-# cd ${WRKSRC} && autoreconf -vif
-
-DRIRC_DIR= ${PKG_SYSCONFDIR}/drirc.d
-EGDIR= ${PREFIX}/share/examples/mesa
-OWN_DIRS+= ${DRIRC_DIR}
-INSTALLATION_DIRS+= ${EGDIR}
-CONF_FILES+= ${EGDIR}/00-mesa-defaults.conf \
- ${DRIRC_DIR}/00-mesa-defaults.conf
-
-post-install:
- ${INSTALL_DATA} ${WRKSRC}/src/util/00-mesa-defaults.conf ${DESTDIR}${EGDIR}
-
-# FreeBSD bug 225414 --build-id=sha1 used by i965
-.if ${OPSYS} == "FreeBSD"
-PKG_LD= ${PREFIX}/bin/gld
-LDFLAGS+= -fuse-ld=${PKG_LD:Q}
-_WRAP_EXTRA_ARGS.CXX+= -fuse-ld=${PKG_LD:Q}
-CWRAPPERS_APPEND.cxx+= -fuse-ld=${PKG_LD:Q}
-.include "../../devel/binutils/buildlink3.mk"
-.endif
-
-# Meson
-CFLAGS+= -Wno-return-type
-.include "../../devel/meson/build.mk"
-
-.include "../../devel/zlib/buildlink3.mk"
-.include "../../x11/libXrandr/buildlink3.mk"
-.include "../../x11/libX11/buildlink3.mk"
-.include "../../x11/libXext/buildlink3.mk"
-.include "../../x11/libxcb/buildlink3.mk"
-.include "../../textproc/expat/buildlink3.mk"
-.include "../../mk/bsd.pkg.mk"
diff --git a/MesaLib-dfbsd/PLIST b/MesaLib-dfbsd/PLIST
deleted file mode 100644
index 117247be07..0000000000
--- a/MesaLib-dfbsd/PLIST
+++ /dev/null
@@ -1,130 +0,0 @@
-@comment $NetBSD: PLIST,v 1.5 2019/01/19 21:54:03 tnn Exp $
-${PLIST.egl}include/EGL/egl.h
-${PLIST.egl}include/EGL/eglext.h
-${PLIST.egl}include/EGL/eglextchromium.h
-${PLIST.egl}include/EGL/eglmesaext.h
-${PLIST.egl}include/EGL/eglplatform.h
-include/GL/gl.h
-include/GL/gl_mangle.h
-include/GL/glcorearb.h
-include/GL/glext.h
-include/GL/glx.h
-include/GL/glx_mangle.h
-include/GL/glxext.h
-${PLIST.osmesa}include/GL/osmesa.h
-${PLIST.dri}include/GL/internal/dri_interface.h
-${PLIST.glesv1}include/GLES/egl.h
-${PLIST.glesv1}include/GLES/gl.h
-${PLIST.glesv1}include/GLES/glext.h
-${PLIST.glesv1}include/GLES/glplatform.h
-${PLIST.glesv2}include/GLES2/gl2.h
-${PLIST.glesv2}include/GLES2/gl2ext.h
-${PLIST.glesv2}include/GLES2/gl2platform.h
-${PLIST.glesv2}include/GLES3/gl3.h
-${PLIST.glesv2}include/GLES3/gl31.h
-${PLIST.glesv2}include/GLES3/gl32.h
-${PLIST.glesv2}include/GLES3/gl3ext.h
-${PLIST.glesv2}include/GLES3/gl3platform.h
-include/KHR/khrplatform.h
-${PLIST.gbm}include/gbm.h
-${PLIST.vulkan}include/vulkan/vulkan_intel.h
-${PLIST.xatracker}include/xa_composite.h
-${PLIST.xatracker}include/xa_context.h
-${PLIST.xatracker}include/xa_tracker.h
-@comment ${PLIST.vaapi}lib/dri/gallium_drv_video.la
-@comment ${PLIST.vaapi}lib/dri/gallium_drv_video.so
-${PLIST.i915}lib/dri/i915_dri.so
-${PLIST.i965}lib/dri/i965_dri.so
-@comment ${PLIST.ilo}lib/dri/ilo_dri.so
-${PLIST.freedreno}lib/dri/kgsl_dri.so
-${PLIST.swrast}lib/dri/kms_swrast_dri.so
-${PLIST.freedreno}lib/dri/msm_dri.so
-${PLIST.nouveau}lib/dri/nouveau_dri.so
-${PLIST.nouveau_dri}lib/dri/nouveau_vieux_dri.so
-${PLIST.r200}lib/dri/r200_dri.so
-${PLIST.r300}lib/dri/r300_dri.so
-${PLIST.r600}lib/dri/r600_dri.so
-${PLIST.radeon_dri}lib/dri/radeon_dri.so
-${PLIST.radeonsi}lib/dri/radeonsi_dri.so
-${PLIST.swrast_dri}lib/dri/swrast_dri.so
-${PLIST.vc4}lib/dri/vc4_dri.so
-${PLIST.svga}lib/dri/vmwgfx_dri.so
-@comment ${PLIST.egl}lib/libEGL.la
-${PLIST.egl}lib/libEGL.so
-${PLIST.egl}lib/libEGL.so.1
-${PLIST.egl}lib/libEGL.so.1.0.0
-@comment lib/libGL.la
-lib/libGL.so
-lib/libGL.so.1
-lib/libGL.so.1.2.0
-@comment ${PLIST.glesv1}lib/libGLESv1_CM.la
-${PLIST.glesv1}lib/libGLESv1_CM.so
-${PLIST.glesv1}lib/libGLESv1_CM.so.1
-${PLIST.glesv1}lib/libGLESv1_CM.so.1.0.0
-@comment ${PLIST.glesv2}lib/libGLESv2.la
-${PLIST.glesv2}lib/libGLESv2.so
-${PLIST.glesv2}lib/libGLESv2.so.2
-${PLIST.glesv2}lib/libGLESv2.so.2.0.0
-@comment ${PLIST.osmesa}lib/libOSMesa.la
-${PLIST.osmesa}lib/libOSMesa.so
-${PLIST.osmesa}lib/libOSMesa.so.8
-${PLIST.osmesa}lib/libOSMesa.so.8.0.0
-${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so
-@comment ${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so.1
-@comment ${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so.1.0
-@comment ${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so.1.0.0
-${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so
-@comment ${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so.1
-@comment ${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so.1.0
-@comment ${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so.1.0.0
-@comment ${PLIST.gbm}lib/libgbm.la
-${PLIST.gbm}lib/libgbm.so
-${PLIST.gbm}lib/libgbm.so.1
-${PLIST.gbm}lib/libgbm.so.1.0.0
-@comment lib/libglapi.la
-lib/libglapi.so
-lib/libglapi.so.0
-lib/libglapi.so.0.0.0
-@comment ${PLIST.wayland}lib/libwayland-egl.la
-@comment ${PLIST.xatracker}lib/libxatracker.la
-${PLIST.xatracker}lib/libxatracker.so
-${PLIST.xatracker}lib/libxatracker.so.2
-${PLIST.xatracker}lib/libxatracker.so.2.4.0
-${PLIST.dri}lib/pkgconfig/dri.pc
-${PLIST.egl}lib/pkgconfig/egl.pc
-${PLIST.gbm}lib/pkgconfig/gbm.pc
-${PLIST.osmesa}lib/pkgconfig/osmesa.pc
-lib/pkgconfig/gl.pc
-${PLIST.glesv1}lib/pkgconfig/glesv1_cm.pc
-${PLIST.glesv2}lib/pkgconfig/glesv2.pc
-${PLIST.wayland}lib/pkgconfig/wayland-egl.pc
-${PLIST.xatracker}lib/pkgconfig/xatracker.pc
-${PLIST.vdpau}lib/vdpau/libvdpau_gallium.so
-${PLIST.nouveau}${PLIST.vdpau}lib/vdpau/libvdpau_nouveau.so
-${PLIST.nouveau}${PLIST.vdpau}lib/vdpau/libvdpau_nouveau.so.1
-${PLIST.nouveau}${PLIST.vdpau}lib/vdpau/libvdpau_nouveau.so.1.0
-${PLIST.nouveau}${PLIST.vdpau}lib/vdpau/libvdpau_nouveau.so.1.0.0
-${PLIST.vdpau}lib/vdpau/libvdpau_r300.so
-${PLIST.vdpau}lib/vdpau/libvdpau_r300.so.1
-${PLIST.vdpau}lib/vdpau/libvdpau_r300.so.1.0
-${PLIST.vdpau}lib/vdpau/libvdpau_r300.so.1.0.0
-${PLIST.vdpau}lib/vdpau/libvdpau_r600.so
-${PLIST.vdpau}lib/vdpau/libvdpau_r600.so.1
-${PLIST.vdpau}lib/vdpau/libvdpau_r600.so.1.0
-${PLIST.vdpau}lib/vdpau/libvdpau_r600.so.1.0.0
-${PLIST.vdpau}lib/vdpau/libvdpau_radeonsi.so
-${PLIST.vdpau}lib/vdpau/libvdpau_radeonsi.so.1
-${PLIST.vdpau}lib/vdpau/libvdpau_radeonsi.so.1.0
-${PLIST.vdpau}lib/vdpau/libvdpau_radeonsi.so.1.0.0
-@comment ${PLIST.vdpau}lib/dri/nouveau_drv_video.la
-${PLIST.nouveau}${PLIST.vaapi}lib/dri/nouveau_drv_video.so
-@comment ${PLIST.vdpau}lib/dri/r600_drv_video.la
-${PLIST.vaapi}lib/dri/r600_drv_video.so
-@comment ${PLIST.vdpau}lib/dri/radeonsi_drv_video.la
-${PLIST.vaapi}lib/dri/radeonsi_drv_video.so
-${PLIST.vulkan}lib/libvulkan_intel.la
-${PLIST.vulkan}lib/libvulkan_radeon.la
-${PLIST.vulkan}share/vulkan/icd.d/intel_icd.${MACHINE_ARCH}.json
-${PLIST.vulkan}share/vulkan/icd.d/radeon_icd.${MACHINE_ARCH}.json
-share/drirc.d/00-mesa-defaults.conf
-share/examples/mesa/00-mesa-defaults.conf
diff --git a/MesaLib-dfbsd/TODO b/MesaLib-dfbsd/TODO
deleted file mode 100644
index e780c72e57..0000000000
--- a/MesaLib-dfbsd/TODO
+++ /dev/null
@@ -1,23 +0,0 @@
-Copy port to graphics/MesaLib, do not install from wip.
-
-* See what can be done on NetBSD build for glesv1 and glesv2
-* See if libLLVM 3.9+ on FreeBSD can build nouveau
-* Test OSX quartz, check if bug 90311 patch needs regen
-* Test Solaris
-* Test Linux
-* Fully port Vulkan support from FreeBSD ports.
-* See what can be ported from latest OpenBSD xenocara and NetBSD xsrc
-
-* Is HAVE_NOATEXIT required even for NetBSD
-* Does static EGLBoolean registered = EGL_FALSE; in function
- _eglAddAtExitCall() of src/egl/main/eglglobals.c make a difference.
-* Should NetBSD pkgsrc pthread_setaffinity_np() fixes be ported to xsrc
-* Are no_cs_queue, revert_threaded_context, and revert_copy_clear
- needed for NetBSD radeon(si)?
-* Should !defined(_NETBSD_SOURCE) #if for p_compiler.h be ported
- from NetBSD xsrc
-* Is extra env_var_as_boolean("LIBGL_DRI3_ENABLE", false) test
- required for NetBSD
-* Should memfd_create fix using mkostemp(3) be ported for NetBSD
-* Is HW_PHYSMEM64 fix in pkgsrc still needed for NetBSD
-* Port NetBSD xsrc tests for 64-bit atomic ops
diff --git a/MesaLib-dfbsd/buildlink3.mk b/MesaLib-dfbsd/buildlink3.mk
deleted file mode 100644
index 939ef86eb8..0000000000
--- a/MesaLib-dfbsd/buildlink3.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-# $NetBSD: buildlink3.mk,v 1.2 2018/10/10 11:03:02 maya Exp $
-
-BUILDLINK_TREE+= MesaLib
-
-.if !defined(MESALIB_BUILDLINK3_MK)
-MESALIB_BUILDLINK3_MK:=
-
-BUILDLINK_API_DEPENDS.MesaLib+= MesaLib>=3.4.2
-BUILDLINK_ABI_DEPENDS.MesaLib+= MesaLib>=7.11.2
-BUILDLINK_PKGSRCDIR.MesaLib?= ../../graphics/MesaLib
-
-.include "../../mk/bsd.fast.prefs.mk"
-
-.if ${X11_TYPE} == "modular"
-BUILDLINK_ABI_DEPENDS.MesaLib+= MesaLib>=10.5.3
-# This is needed to avoid linking conflicting libstdc++ versions
-. if defined(USE_LANGUAGES) && !empty(USE_LANGUAGES:Mc++)
-GCC_REQD+= 4.2
-. endif
-.endif
-
-# See <http://developer.apple.com/qa/qa2007/qa1567.html>.
-.if ${X11_TYPE} == "native" && !empty(MACHINE_PLATFORM:MDarwin-[9].*-*)
-BUILDLINK_LDFLAGS.MesaLib+= -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
-.endif
-
-pkgbase:= MesaLib
-.include "../../mk/pkg-build-options.mk"
-
-.if ${X11_TYPE} == "native" && ${OPSYS} != "Cygwin" && exists(${X11BASE}/lib/pkgconfig/dri.pc)
-PKG_BUILD_OPTIONS.MesaLib+= dri
-.endif
-
-.if !empty(PKG_BUILD_OPTIONS.MesaLib:Mdri)
-. include "../../graphics/MesaLib/dri.mk"
-.endif
-
-.if ${X11_TYPE} == "modular" && !empty(PKG_BUILD_OPTIONS.MesaLib:Mdri) || \
- ${X11_TYPE} == "native" && exists(${X11BASE}/include/EGL/egl.h)
-MESALIB_SUPPORTS_EGL= yes
-.else
-MESALIB_SUPPORTS_EGL= no
-.endif
-
-.include "../../mk/pthread.buildlink3.mk"
-
-.include "../../x11/libXext/buildlink3.mk"
-.endif # MESALIB_BUILDLINK3_MK
-
-BUILDLINK_TREE+= -MesaLib
diff --git a/MesaLib-dfbsd/builtin.mk b/MesaLib-dfbsd/builtin.mk
deleted file mode 100644
index f9bab9d959..0000000000
--- a/MesaLib-dfbsd/builtin.mk
+++ /dev/null
@@ -1,87 +0,0 @@
-# $NetBSD: builtin.mk,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-BUILTIN_PKG:= MesaLib
-
-BUILTIN_FIND_FILES_VAR:= H_MESALIB PC_GL
-BUILTIN_FIND_FILES.H_MESALIB= ${X11BASE}/include/GL/glx.h
-BUILTIN_FIND_FILES.PC_GL= ${X11BASE}/lib/pkgconfig/gl.pc
-BUILTIN_FIND_FILES.PC_GL+= ${X11BASE}/lib${LIBABISUFFIX}/pkgconfig/gl.pc
-
-.include "../../mk/buildlink3/bsd.builtin.mk"
-
-###
-### Determine if there is a built-in implementation of the package and
-### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
-###
-.if !defined(IS_BUILTIN.MesaLib)
-. if empty(PC_GL:M__nonexistent__)
-IS_BUILTIN.MesaLib= yes
-. elif empty(H_MESALIB:M__nonexistent__)
-IS_BUILTIN.MesaLib= yes
-. else
-IS_BUILTIN.MesaLib= no
-. endif
-.endif
-MAKEVARS+= IS_BUILTIN.MesaLib
-
-###
-### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
-### a package name to represent the built-in package.
-###
-.if !defined(BUILTIN_PKG.MesaLib) && \
- !empty(IS_BUILTIN.MesaLib:M[yY][eE][sS])
-. if empty(PC_GL:M__nonexistent__)
-BUILTIN_VERSION.Mesa!= ${SED} -n -e 's/Version: //p' ${PC_GL}
-. elif empty(H_MESALIB:M__nonexistent__)
-. include "../../graphics/Mesa/version.mk"
-. else # ?
-BUILTIN_VERSION.Mesa:= 0.something-weird-happened
-. endif
-BUILTIN_PKG.MesaLib= MesaLib-${BUILTIN_VERSION.Mesa}
-MAKEVARS+= BUILTIN_VERSION.Mesa
-.endif
-MAKEVARS+= BUILTIN_PKG.MesaLib
-
-###
-### Determine whether we should use the built-in implementation if it
-### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
-###
-.if !defined(USE_BUILTIN.MesaLib)
-. if ${PREFER.MesaLib} == "pkgsrc"
-USE_BUILTIN.MesaLib= no
-. else
-USE_BUILTIN.MesaLib= ${IS_BUILTIN.MesaLib}
-. if defined(BUILTIN_PKG.MesaLib) && \
- !empty(IS_BUILTIN.MesaLib:M[yY][eE][sS])
-USE_BUILTIN.MesaLib= yes
-. for dep in ${BUILDLINK_API_DEPENDS.MesaLib}
-. if !empty(USE_BUILTIN.MesaLib:M[yY][eE][sS])
-USE_BUILTIN.MesaLib!= \
- if ${PKG_ADMIN} pmatch ${dep:Q} ${BUILTIN_PKG.MesaLib}; then \
- ${ECHO} yes; \
- else \
- ${ECHO} no; \
- fi
-. endif
-. endfor
-. endif
-. endif # PREFER.MesaLib
-.endif
-MAKEVARS+= USE_BUILTIN.MesaLib
-
-###
-### The section below only applies if we are not including this file
-### solely to determine whether a built-in implementation exists.
-###
-CHECK_BUILTIN.MesaLib?= no
-.if !empty(CHECK_BUILTIN.MesaLib:M[nN][oO])
-
-. if !empty(USE_BUILTIN.MesaLib:M[nN][oO])
-. include "../../mk/pthread.buildlink3.mk"
-. include "../../mk/pthread.builtin.mk"
-BUILTIN_PKG:= MesaLib
-. endif
-
-. include "../../mk/x11.builtin.mk"
-
-.endif # CHECK_BUILTIN.MesaLib
diff --git a/MesaLib-dfbsd/distinfo b/MesaLib-dfbsd/distinfo
deleted file mode 100644
index d053cb367c..0000000000
--- a/MesaLib-dfbsd/distinfo
+++ /dev/null
@@ -1,84 +0,0 @@
-$NetBSD: distinfo,v 1.17 2019/05/01 19:31:45 maya Exp $
-
-RMD160 (mesa-18.3.6.tar.xz) = f4e2812c27f7bffcc1e3a28d721752aad5330f2b
-SHA512 (mesa-18.3.6.tar.xz) = 3a6dcaba99185e28d162b130bbd760fe87e6072065958189b28f41ea287ef041397897e098d93218a64802cf11c73806f7400a866bd8e5ed69694fa15c147487
-Size (mesa-18.3.6.tar.xz) = 11882744 bytes
-SHA1 (patch-configure.ac) = ba9ded10c5a87275db29c9d008d917041b2e0c78
-SHA1 (patch-include_GL_internal_dri__interface.h) = a0e26ce759a8eaf170b3401c763ff76686b0e011
-SHA1 (patch-meson.build) = ec2d164cfaaec526b3d063ade1a7bea941a90c49
-SHA1 (patch-meson__options.txt) = 171ac109444b0ce8ea37e53b72f529a4b5e5c6f6
-SHA1 (patch-src_amd_common_ac__debug.c) = 8233367c3b5bc344442ea8d19488fdd1e3791ae9
-SHA1 (patch-src_amd_common_ac__llvm__util.c) = 311a329c4bd26aa3de4012a4ea513e6857c116d4
-SHA1 (patch-src_amd_vulkan_radv__device.c) = a029ba89311fe62e3712573993fabf38910e9838
-SHA1 (patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c) = 1fe81a7b16e36dc9125400c20543271216a33a45
-SHA1 (patch-src_compiler_builtin__type__macros.h) = 128030d0c532e5f3982dc6ebde1957fc0ca7f5d5
-SHA1 (patch-src_compiler_glsl_glsl__parser__extras.cpp) = ef114d6e288e6d212fce9d1c0606f7d454a171c4
-SHA1 (patch-src_egl_drivers_dri2_platform__drm.c) = e18e7b1ffbc74b8acf3d9095a92c750f9d005479
-SHA1 (patch-src_egl_drivers_dri2_platform__x11.c) = 1b8c7689b18643777d494bbb491866ed0041155d
-SHA1 (patch-src_egl_main_eglglobals.c) = c8db1469859d448635f96a0eac1a936104cd0fdd
-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_util_u__format__tests.c) = 4d5e4677c2825778c43440ab131b8807f6840975
-SHA1 (patch-src_gallium_auxiliary_util_u__helpers.c) = 0489047a1f245bb317d6e22fd26d955ac77d33c7
-SHA1 (patch-src_gallium_drivers_freedreno_freedreno__screen.c) = d76bf52c25609d641dbf4021e81282cbdc925976
-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__compute__blit.c) = 284d5a55c676acf4a13caef5d5b6d27243c7dc06
-SHA1 (patch-src_gallium_drivers_radeonsi_si__pipe.c) = bfc362eba103273c6c8633e8841f0c818dd7d2af
-SHA1 (patch-src_gallium_drivers_radeonsi_si__state__shaders.c) = ed51a57765f2349bc91fd509dc03e709241bd899
-SHA1 (patch-src_gallium_drivers_vc4_vc4__bufmgr.c) = 1d591d346486fdf58893f69ab92a272e6a31a987
-SHA1 (patch-src_gallium_include_pipe_p__config.h) = f4e38eac66167b619c30076bb0144dd716310967
-SHA1 (patch-src_gallium_state__trackers_clover_llvm_invocation.cpp) = 3053db09fbfffffd82e232b60b244a0a80c8f181
-SHA1 (patch-src_gallium_state__trackers_clover_llvm_metadata.hpp) = c97d38098ea03658bc193a50e445b87f1c020839
-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) = f21690d9c2d11f353aa4f9662c98b12fae78becf
-SHA1 (patch-src_glx_Makefile.am) = 869c4f2388f835b9b296b3c84c2a03ef7717f17d
-SHA1 (patch-src_glx_apple_apple__glapi.c) = c4eea8dabf74eb03d22da4eb834b18ae3384c63b
-SHA1 (patch-src_glx_dri__common.h) = 0274877f8c65a4bb729536a897df4704897a4c6e
-SHA1 (patch-src_glx_dri__glx.c) = 8fd48776e9953b18bd17ba130d90ae2935e67242
-SHA1 (patch-src_glx_glxclient.h) = 5e597362c3839f26118fe98983701f33d6047cfd
-SHA1 (patch-src_glx_glxcurrent.c) = 67142b977aadf23b0b0d3a06db3d9450e0b7f892
-SHA1 (patch-src_glx_glxext.c) = 1c044d38faebc310f49248a6b937b1bbc5a16870
-SHA1 (patch-src_intel_Makefile.tools.am) = 5253d5972b48ae3bc8d648bb9f479dcf6cbd3fab
-SHA1 (patch-src_intel_compiler_brw__fs__bank__conflicts.cpp) = 6276d2c6846bb4dd08699921bec4e20202a17478
-SHA1 (patch-src_intel_tools_aub__mem.c) = fe7f8315515618e2becfa5279de613bca200dbf8
-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) = da5a11c95d17d6476e7141572264a215807b8cd7
-SHA1 (patch-src_intel_vulkan_anv__device.c) = 996f64d3524fb644ab063b1b075718f0d098b4ab
-SHA1 (patch-src_intel_vulkan_anv__gem.c) = b8eb487fa704151e7c3c3b1d23973b2b0aa5922e
-SHA1 (patch-src_intel_vulkan_anv__gem__stubs.c) = ad5a4bd9fe521cf73faf2f0cf0f493a0b40f4c20
-SHA1 (patch-src_intel_vulkan_anv__queue.c) = 2dbf7dfd0c77f74f510032bf8d12109f58c50a30
-SHA1 (patch-src_mapi_entry__x86-64__tls.h) = a0cbe5c8412fa626926ade0c72c6bc13b1ab4f36
-SHA1 (patch-src_mapi_entry__x86__tls.h) = 740312f64e4848164482f44642859aecc7025853
-SHA1 (patch-src_mapi_glapi_gen_gl__gentable.py) = 0b1d4ef3f78a9b3726ef7f9921608a48a5e4ac56
-SHA1 (patch-src_mapi_u__current.c) = bee667c667bb1bd6e3b0f774d6ad6da5b7f0546d
-SHA1 (patch-src_mapi_u__current.h) = 13e91936db8d468c4f4744eb5cc01ad879b53539
-SHA1 (patch-src_mesa_drivers_dri_i915_intel__screen.c) = fb9324dcbc8ffbc00bee6aedcc38db2e94b24f9d
-SHA1 (patch-src_mesa_drivers_dri_i965_brw__bufmgr.c) = ad0fc0cacf59dde38d18f9ceb93411105cdd6c89
-SHA1 (patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c) = bb7ca6a8b9e42c1dc4e59a3cf78d063699f7b66e
-SHA1 (patch-src_mesa_drivers_dri_i965_brw__performance__query.c) = 1250b3477c4b8013b928772b7dc7f24e8c4b67aa
-SHA1 (patch-src_mesa_drivers_dri_i965_intel__screen.c) = 1b5de370add6984fb44968c055b7d8d5a54417dd
-SHA1 (patch-src_mesa_drivers_dri_i965_intel__tiled__memcpy.c) = ca311036c3d7fb63d817faa3c61348a821f7af5d
-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_extensions.c) = 2f48bdb1176c2878bb33bcfab7556172b50a987e
-SHA1 (patch-src_mesa_main_macros.h) = c5dceaa8dc02a58e5b2273d82e3fe1cc12e327d3
-SHA1 (patch-src_mesa_main_shader__query.cpp) = 3f9c31645d87855759def11344dee16af23c7be3
-SHA1 (patch-src_mesa_x86_common__x86.c) = f8c4b93443ef66d017f6aa114b877565b30f2598
-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_futex.h) = 35097c3b8baf8b969c6ec5ec1feb6f4e0a48237e
-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__math.h) = 4ed32b818bd29428e4c1ede6d31460bd6ca0fff6
-SHA1 (patch-src_util_u__process.c) = 4f905ab7c812ac3f48165857dbc40455879c9f4b
-SHA1 (patch-src_util_u__queue.c) = 17fb475e139d29ae27a54e6f6104d274e50226f7
-SHA1 (patch-src_util_u__thread.h) = c2f276a9577dfea8d22fce2143d5cb65b043aa74
-SHA1 (patch-src_util_xmlconfig.c) = ad5619e067957b120a70c1c63421c92b356e16ac
diff --git a/MesaLib-dfbsd/dri.mk b/MesaLib-dfbsd/dri.mk
deleted file mode 100644
index c573b3f2f6..0000000000
--- a/MesaLib-dfbsd/dri.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# $NetBSD: dri.mk,v 1.2 2019/04/11 16:27:03 maya Exp $
-#
-# Currently, this is for convenience only.
-#
-.if !defined(DRI_MK)
-DRI_MK= # defined
-
-. if !defined(USE_BUILTIN.MesaLib)
-CHECK_BUILTIN.MesaLib:= yes
-. include "../../graphics/MesaLib/builtin.mk"
-CHECK_BUILTIN.MesaLib:= no
-. endif
-
-. if !empty(USE_BUILTIN.MesaLib:M[Nn][Oo])
-. if ${OPSYS} != "Darwin"
-BUILDLINK_API_DEPENDS.libdrm+= libdrm>=2.4.60
-. endif
-. if ${OPSYS} == "Linux"
-BUILDLINK_API_DEPENDS.libxcb+= libxcb>=1.9.3
-. endif
-. endif
-. include "../../x11/xorgproto/buildlink3.mk"
-# XXX these do not have builtin.mk
-. if ${X11_TYPE} == "modular"
-. include "../../x11/libxshmfence/buildlink3.mk"
-. endif
-. include "../../x11/libXdamage/buildlink3.mk"
-. include "../../x11/libXfixes/buildlink3.mk"
-. include "../../x11/libXxf86vm/buildlink3.mk"
-. if ${OPSYS} != "Darwin"
-. include "../../x11/libdrm/buildlink3.mk"
-. endif
-.endif
diff --git a/MesaLib-dfbsd/options.mk b/MesaLib-dfbsd/options.mk
deleted file mode 100644
index d15359ef55..0000000000
--- a/MesaLib-dfbsd/options.mk
+++ /dev/null
@@ -1,514 +0,0 @@
-# $NetBSD: options.mk,v 1.12 2019/04/11 16:27:03 maya Exp $
-
-PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib
-PKG_SUPPORTED_OPTIONS= llvm dri
-PKG_SUGGESTED_OPTIONS=
-
-PKG_SUPPORTED_OPTIONS+= glx-tls xvmc debug
-PKG_SUPPORTED_OPTIONS+= vdpau vaapi
-PKG_SUPPORTED_OPTIONS+= osmesa
-PKG_SUPPORTED_OPTIONS+= glesv1 glesv2
-PKG_SUPPORTED_OPTIONS+= xa
-PKG_SUPPORTED_OPTIONS+= asm
-PKG_SUPPORTED_OPTIONS+= noatexit
-# PKG_SUPPORTED_OPTIONS+= iris
-# PKG_SUGGESTED_OPTIONS+= iris
-PKG_SUPPORTED_OPTIONS+= vulkan
-
-PKG_SUPPORTED_OPTIONS+= test_dri3_enable
-PKG_SUPPORTED_OPTIONS+= no_render_node
-PKG_SUPPORTED_OPTIONS+= use_clock_nanosleep_os_time
-PKG_SUPPORTED_OPTIONS+= use_pthread_getcpuclockid
-
-PKG_SUPPORTED_OPTIONS+= revert_i965_softpin
-PKG_SUPPORTED_OPTIONS+= revert_sdma_uploader
-PKG_SUPPORTED_OPTIONS+= require_36_gen4
-
-PKG_SUPPORTED_OPTIONS+= physmem_netbsd
-PKG_SUPPORTED_OPTIONS+= setaffinity_np_netbsd
-PKG_SUPPORTED_OPTIONS+= no_initial_exec_nonnull
-
-PKG_SUPPORTED_OPTIONS+= no_cs_queue
-PKG_SUPPORTED_OPTIONS+= revert_threaded_context
-PKG_SUPPORTED_OPTIONS+= revert_copy_clear
-
-PKG_SUPPORTED_OPTIONS+= no_getprogramname
-PKG_SUPPORTED_OPTIONS+= strict_xsrc_netbsd
-
-PKG_SUGGESTED_OPTIONS+= xvmc
-PKG_SUGGESTED_OPTIONS+= vdpau vaapi
-
-PKG_SUGGESTED_OPTIONS+= osmesa
-
-# glesv1 and glesv2 build error on NetBSD
-# due to no table_noop_array for tls patch
-.if ${OPSYS} != "NetBSD"
-PKG_SUGGESTED_OPTIONS+= glesv1 glesv2
-.endif
-
-PKG_SUGGESTED_OPTIONS+= xa
-
-PKG_SUGGESTED_OPTIONS+= asm
-
-# .if ${OPSYS} == "NetBSD"
-# PKG_SUGGESTED_OPTIONS+= noatexit
-# .endif
-
-# The LLVM option enables JIT accelerated software rendering and
-# is also required to support the latest RADEON GPUs, so enable it
-# by default on platforms where such GPUs might be encountered.
-.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \
- ${OPSYS} != "SunOS" && ${OPSYS} != "Darwin" && \
- !(${OPSYS} == "NetBSD" && ${X11_TYPE} == "native")
-PKG_SUGGESTED_OPTIONS+= llvm
-.endif
-
-.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "OpenBSD" || \
- ${OPSYS} == "DragonFly" || ${OPSYS} == "Linux" || \
- ${OPSYS} == "SunOS" || ${OPSYS} == "Darwin" || \
- (${OPSYS} == "NetBSD" && ${X11_TYPE} == "modular")
-PKG_SUGGESTED_OPTIONS+= dri
-.endif
-
-# Use Thread Local Storage in GLX where it is supported by Mesa and works.
-.if \
- !empty(MACHINE_PLATFORM:MNetBSD-[789].*-i386) || \
- !empty(MACHINE_PLATFORM:MNetBSD-[789].*-x86_64) || \
- !empty(MACHINE_PLATFORM:MLinux-*-i386) || \
- !empty(MACHINE_PLATFORM:MLinux-*-x86_64) || \
- !empty(MACHINE_PLATFORM:MFreeBSD-1[0-9].*-x86_64) || \
- !empty(MACHINE_PLATFORM:MDragonFly-*-x86_64)
-PKG_SUGGESTED_OPTIONS+= glx-tls
-.endif
-
-.if ${OPSYS} == "DragonFly" || ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+= test_dri3_enable
-.endif
-
-# Revert patch removing support for no dedicated render nodes
-.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
-PKG_SUGGESTED_OPTIONS+= no_render_node
-.endif
-
-# Use clock_nanosleep() in os_time.c
-.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
-PKG_SUGGESTED_OPTIONS+= use_clock_nanosleep_os_time
-.endif
-
-# pthread_getcpuclockid only in NetBSD 8+
-.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
-PKG_SUGGESTED_OPTIONS+= use_pthread_getcpuclockid
-.endif
-
-.if ${OPSYS} == "DragonFly"
-PKG_SUGGESTED_OPTIONS+= revert_i965_softpin
-PKG_SUGGESTED_OPTIONS+= revert_sdma_uploader
-.endif
-
-# Require Linux 3.6+ intel support for ge4+
-.if ${OPSYS} == "FreeBSD"
-PKG_SUGGESTED_OPTIONS+= require_36_gen4
-.endif
-
-# Option used in pkgsrc NetBSD but not xsrc
-# .if ${OPSYS} == "NetBSD"
-# PKG_SUGGESTED_OPTIONS+= physmem_netbsd
-# .endif
-
-.if ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+= setaffinity_np_netbsd
-.endif
-
-.if ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+= no_initial_exec_nonnull
-.endif
-
-.if ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+= no_cs_queue
-PKG_SUGGESTED_OPTIONS+= revert_threaded_context
-PKG_SUGGESTED_OPTIONS+= revert_copy_clear
-.endif
-
-.if ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+= no_getprogramname
-.endif
-
-.if ${OPSYS} == "NetBSD"
-PKG_SUGGESTED_OPTIONS+= strict_xsrc_netbsd
-.endif
-
-.include "../../mk/bsd.options.mk"
-
-# gallium
-PLIST_VARS+= freedreno i915 i965 nouveau r300 r600 radeonsi \
- swrast svga vc4 virgl vulkan iris
-# classic DRI
-PLIST_VARS+= dri swrast_dri nouveau_dri radeon_dri r200
-# other features
-PLIST_VARS+= egl gbm vaapi vdpau wayland xatracker
-PLIST_VARS+= osmesa xvmc
-PLIST_VARS+= glesv1 glesv2
-
-.if !empty(PKG_OPTIONS:Mdri)
-
-CONFIGURE_ARGS+= --enable-dri
-
-# Having DRI3 and egl compiled in by default doesn't hurt, the X server
-# will only use it if it is supported at run time.
-CONFIGURE_ARGS+= --enable-dri3
-MESON_ARGS+= -Ddri3=true
-.if ${OPSYS} != "Darwin"
-CONFIGURE_ARGS+= --enable-egl
-CONFIGURE_ARGS+= --enable-gbm
-MESON_ARGS+= -Degl=true
-MESON_ARGS+= -Dgbm=true
-PLIST.egl= yes
-PLIST.gbm= yes
-.else
-CONFIGURE_ARGS+= --disable-egl
-CONFIGURE_ARGS+= --disable-gbm
-MESON_ARGS+= -Degl=false
-MESON_ARGS+= -Dgbm=false
-.endif
-
-.if !empty(PKG_OPTIONS:Mosmesa)
-CONFIGURE_ARGS+= --enable-osmesa
-MESON_ARGS+= -Dosmesa=gallium
-PLIST.osmesa= yes
-.endif
-
-.if !empty(PKG_OPTIONS:Mglesv1)
-CONFIGURE_ARGS+= --enable-gles1
-MESON_ARGS+= -Dgles1=true
-PLIST.glesv1= yes
-.else
-CONFIGURE_ARGS+= --disable-gles1
-MESON_ARGS+= -Dgles1=false
-.endif
-
-.if !empty(PKG_OPTIONS:Mglesv2)
-CONFIGURE_ARGS+= --enable-gles2
-MESON_ARGS+= -Dgles2=true
-PLIST.glesv2= yes
-.else
-CONFIGURE_ARGS+= --disable-gles2
-MESON_ARGS+= -Dgles2=false
-.endif
-
-.if !empty(PKG_OPTIONS:Mglx-tls)
-# 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
-CONFIGURE_ARGS.Linux+= --enable-sysfs
-
-PLIST.dri= yes
-
-.if ${OPSYS} != "Darwin"
-BUILDLINK_DEPMETHOD.libpciaccess= full
-.include "../../sysutils/libpciaccess/buildlink3.mk"
-.endif
-.include "../../graphics/MesaLib/dri.mk"
-
-DRI_DRIVERS= #
-GALLIUM_DRIVERS= #
-VULKAN_DRIVERS= #
-
-# Software rasterizer
-# From meson.build
-# if with_dri_swrast and (with_gallium_softpipe or with_gallium_swr)
-# error('Only one swrast provider can be built')
-# endif
-PLIST.swrast_dri= yes
-.if ${OPSYS} != "Darwin"
-PLIST.swrast= yes
-GALLIUM_DRIVERS+= swrast
-.else
-DRI_DRIVERS+= swrast
-.endif
-
-# x86 only drivers
-.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && ${OPSYS} != "Darwin"
-# svga / VMWare driver
-PLIST.svga= yes
-GALLIUM_DRIVERS+= svga
-
-# Intel chipsets, x86 only
-# From meson.build:
-# if with_dri_i915 and with_gallium_i915
-# error('Only one i915 provider can be built')
-# endif
-PLIST.i915= yes
-# GALLIUM_DRIVERS+= i915
-DRI_DRIVERS+= i915
-
-PLIST.i965= yes
-DRI_DRIVERS+= i965
-
-.endif
-
-# Intel Iris support
-# .if !empty(PKG_OPTIONS:Miris)
-# GALLIUM_DRIVERS+= iris
-# PLIST.iris= yes
-# .endif
-
-# Vulkan support
-.if !empty(PKG_OPTIONS:Mvulkan)
-# VULKAN_DRIVERS+= intel
-# VULKAN_DRIVERS+= radeon
-VULKAN_DRIVERS+= auto
-PLIST.vulkan= yes
-.endif
-
-# ARM drivers
-.if !empty(MACHINE_PLATFORM:MNetBSD-*-*arm*)
-# Qualcomm SnapDragon, libdrm_freedreno.pc
-#GALLIUM_DRIVERS+= freedreno
-#PLIST.freedreno= yes
-
-# Broadcom VideoCore 4
-GALLIUM_DRIVERS+= vc4
-PLIST.vc4= yes
-.endif
-
-# qemu Linux guest driver
-.if !empty(MACHINE_PLATFORM:MLinux-*-x86_64)
-# XXX test this
-#GALLIUM_DRIVERS+= virgl
-#PLIST.virgl= yes
-.endif
-
-# theoretically cross platform PCI drivers
-.if ${OPSYS} != "Darwin" && empty(MACHINE_PLATFORM:MNetBSD-*-*arm*) && \
- empty(MACHINE_PLATFORM:MNetBSD-*-mipsel)
-
-# AMD Radeon r600
-PLIST.r600= yes
-GALLIUM_DRIVERS+= r600
-
-# FULL_OS_VERSION_CMD= ${UNAME} -r
-# FULL_OS_VERSION= ${FULL_OS_VERSION_CMD:sh}
-
-# FreeBSD lacks nouveau support (there are official binaries from Nvidia)
-.if ${OPSYS} != "FreeBSD"
-# nVidia
-PLIST.nouveau= yes
-GALLIUM_DRIVERS+= nouveau
-.endif
-
-# Meson build does not compile these correctly anymore.
-# classic DRI radeon
-# PLIST.radeon_dri= yes
-# DRI_DRIVERS+= radeon
-
-# classic DRI r200
-PLIST.r200= yes
-DRI_DRIVERS+= r200
-
-# FreeBSD lacks nouveau support (there are official binaries from Nvidia)
-.if ${OPSYS} != "FreeBSD"
-# classic DRI nouveau
-PLIST.nouveau_dri= yes
-DRI_DRIVERS+= nouveau
-.endif
-.endif # cross platform PCI drivers
-
-.if ${OPSYS} == "Darwin"
-CONFIGURE_ARGS+= --with-platforms=x11
-MESON_ARGS+= -Dplatforms=x11
-#.elif ${OPSYS} == "Linux"
-#.include "../../devel/wayland/buildlink3.mk"
-#CONFIGURE_ARGS+= --with-platforms=x11,drm,wayland
-#PLIST.wayland= yes
-.else
-CONFIGURE_ARGS+= --with-platforms=x11,drm
-MESON_ARGS+= -Dplatforms=x11,drm
-.endif
-
-.if !empty(PKG_OPTIONS:Mllvm)
-# VA-API and VDPAU
-.if !empty(PKG_OPTIONS:Mvaapi)
-.include "../../multimedia/libva/available.mk"
-.if ${VAAPI_AVAILABLE} == "yes"
-PLIST.vaapi= yes
-.include "../../multimedia/libva/buildlink3.mk"
-MESON_ARGS+= -Dgallium-va=true
-.else
-MESON_ARGS+= -Dgallium-va=false
-.endif
-.endif # vaapi
-.if !empty(PKG_OPTIONS:Mvdpau)
-.include "../../multimedia/libvdpau/available.mk"
-.if ${VDPAU_AVAILABLE} == "yes"
-PLIST.vdpau= yes
-.include "../../multimedia/libvdpau/buildlink3.mk"
-MESON_ARGS+= -Dgallium-vdpau=true
-.else
-MESON_ARGS+= -Dgallium-vdpau=false
-.endif
-.endif # vdpau
-
-# XA is useful for accelerating xf86-video-vmware
-.if !empty(PKG_OPTIONS:Mxa)
-CONFIGURE_ARGS+= --enable-xa
-MESON_ARGS+= -Dgallium-xa=true
-PLIST.xatracker= yes
-.else
-MESON_ARGS+= -Dgallium-xa=false
-.endif
-
-# AMD Radeon r300
-PLIST.r300= yes
-GALLIUM_DRIVERS+= r300
-# AMD Canary Islands GPUs
-PLIST.radeonsi= yes
-GALLIUM_DRIVERS+= radeonsi
-CONFIGURE_ARGS+= --enable-llvm
-CONFIGURE_ARGS+= --enable-llvm-shared-libs
-MESON_ARGS+= -Dllvm=true
-MESON_ARGS+= -Dshared-llvm=true
-
-.if !exists(/usr/include/libelf.h)
-.include "../../devel/libelf/buildlink3.mk"
-.endif
-
-# XXX update libLLVM to use it instead
-#BUILDLINK_API_DEPENDS.libLLVM+= libLLVM>=5.0
-.include "../../lang/llvm/buildlink3.mk"
-
-# BUILDLINK_API_DEPENDS.libLLVM+= libLLVM>=4.0
-# .include "../../lang/libLLVM/buildlink3.mk"
-CONFIGURE_ENV+= ac_cv_path_ac_pt_LLVM_CONFIG=${LLVM_CONFIG_PATH}
-.else # !llvm
-CONFIGURE_ARGS+= --disable-xa
-CONFIGURE_ARGS+= --disable-llvm
-CONFIGURE_ARGS+= --disable-llvm-shared-libs
-MESON_ARGS+= -Dgallium-xa=false
-MESON_ARGS+= -Dllvm=false
-MESON_ARGS+= -Dshared-llvm=false
-.endif # llvm
-
-CONFIGURE_ARGS+= --with-gallium-drivers=${GALLIUM_DRIVERS:ts,}
-CONFIGURE_ARGS+= --with-dri-drivers=${DRI_DRIVERS:ts,}
-CONFIGURE_ARGS+= --with-vulkan-drivers=${VULKAN_DRIVERS:ts,}
-MESON_ARGS+= -Dgallium-drivers=${GALLIUM_DRIVERS:ts,}
-MESON_ARGS+= -Ddri-drivers=${DRI_DRIVERS:ts,}
-MESON_ARGS+= -Dvulkan-drivers=${VULKAN_DRIVERS:ts,}
-
-.else # !dri
-CONFIGURE_ARGS+= --with-gallium-drivers=
-CONFIGURE_ARGS+= --with-dri-drivers=
-CONFIGURE_ARGS+= --with-vulkan-drivers=
-CONFIGURE_ARGS+= --disable-dri
-CONFIGURE_ARGS+= --disable-dri3
-CONFIGURE_ARGS+= --disable-egl
-CONFIGURE_ARGS+= --disable-gbm
-CONFIGURE_ARGS+= --disable-gles1
-CONFIGURE_ARGS+= --disable-gles2
-CONFIGURE_ARGS+= --enable-xlib-glx
-CONFIGURE_ARGS+= --with-platforms=x11
-MESON_ARGS+= -Dgallium-drivers=
-MESON_ARGS+= -Ddri-drivers=
-MESON_ARGS+= -Ddri3=false
-MESON_ARGS+= -Degl=false
-MESON_ARGS+= -Dgbm=false
-MESON_ARGS+= -Dgles1=false
-MESON_ARGS+= -Dgles2=false
-MESON_ARGS+= -Dglx=xlib
-MESON_ARGS+= -Dplatforms=x11
-.if !empty(PKG_OPTIONS:Mllvm)
-PKG_FAIL_REASON+= "The llvm PKG_OPTION must also be disabled when dri is disabled"
-.endif
-.endif # dri
-
-.if !empty(PKG_OPTIONS:Mdebug)
-CONFIGURE_ARGS+= --enable-debug
-MESON_ARGS+= --buildtype=debug
-.endif
-
-.if !empty(PKG_OPTIONS:Masm)
-.else
-MESON_ARGS+= -Dasm=false
-.endif
-
-.if !empty(PKG_OPTIONS:Mxvmc)
-.include "../../x11/libXvMC/buildlink3.mk"
-PLIST.xvmc= yes
-MESON_ARGS+= -Dgallium-xvmc=true
-.else
-MESON_ARGS+= -Dgallium-xvmc=false
-.endif
-
-.if !empty(PKG_OPTIONS:Mnoatexit)
-CPPFLAGS+= -DHAVE_NOATEXIT
-.endif
-
-.if !empty(PKG_OPTIONS:Mtest_dri3_enable)
-CPPFLAGS+= -DTEST_DRI3_ENABLE
-.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:Mrevert_i965_softpin)
-CPPFLAGS+= -DREVERT_I965_SOFTPIN
-.endif
-
-.if !empty(PKG_OPTIONS:Mrevert_sdma_uploader)
-CPPFLAGS+= -DREVERT_SDMA_UPLOADER
-.endif
-
-.if !empty(PKG_OPTIONS:Mrequire_36_gen4)
-CPPFLAGS+= -DREQUIRE_36_GEN4
-.endif
-
-.if !empty(PKG_OPTIONS:Mphysmem_netbsd)
-CPPFLAGS+= -DPHYSMEM_NETBSD
-.endif
-
-.if !empty(PKG_OPTIONS:Msetaffinity_np_netbsd)
-CPPFLAGS+= -DSETAFFINITY_NP_NETBSD
-.endif
-
-.if !empty(PKG_OPTIONS:Mno_initial_exec_nonnull)
-CPPFLAGS+= -DNO_INITIAL_EXEC_NONNULL
-.endif
-
-.if !empty(PKG_OPTIONS:Mno_cs_queue)
-CPPFLAGS+= -DNO_CS_QUEUE
-.endif
-
-.if !empty(PKG_OPTIONS:Mrevert_threaded_context)
-CPPFLAGS+= -DREVERT_THREADED_CONTEXT
-.endif
-
-.if !empty(PKG_OPTIONS:Mrevert_copy_clear)
-CPPFLAGS+= -DREVERT_COPY_CLEAR
-.endif
-
-.if !empty(PKG_OPTIONS:Mno_getprogramname)
-CPPFLAGS+= -DNO_GETPROGRAMNAME
-.endif
-
-.if !empty(PKG_OPTIONS:Mstrict_xsrc_netbsd)
-CPPFLAGS+= -DSTRICT_XSRC_NETBSD
-.endif
diff --git a/MesaLib-dfbsd/patches/patch-configure.ac b/MesaLib-dfbsd/patches/patch-configure.ac
deleted file mode 100644
index 5f64f7cb08..0000000000
--- a/MesaLib-dfbsd/patches/patch-configure.ac
+++ /dev/null
@@ -1,127 +0,0 @@
-$NetBSD: patch-configure.ac,v 1.5 2019/01/20 09:50:28 tnn Exp $
-
-Don't check for pthread stubs anywhere, as we don't provide it.
-
-From FreeBSD ports graphics/mesa-dri 18.0.0,
-DragonFly dports graphics/mesa-dri 17.3.1,
-files/patch-configure
-
-For FreeBSD 11.2-RELEASE
- CXXLD mesa_dri_drivers.la
-/usr/bin/ld: unrecognized option '--build-id=sha1'
-
-* But do NOT extend to FreeBSD, instead use binutils ld to link.
-osx: ld does not support --build-ld
-
-* For FreeBSD: Use monotonic clock for timeouts.
-
-* For FreeBSD: Implement futex_wake() and futex_wait() via _umtx_op()
-
-* dri3: Mon Apr 10 19:14:48 2017 UTC
-DRI3 remains enabled at compile time, but it is now disabled at
-runtime for stock FreeBSD. Set LIBGL_DRI3_ENABLE in the
-environment to enable DRI3.
-This change was made to work around a problem in libEGL,
-which fails to fall back to using DRI2 when run on a system
-without DRI3 support.
-
---- configure.ac.orig 2019-01-17 11:26:22.000000000 +0000
-+++ configure.ac
-@@ -726,7 +726,7 @@ dnl
- dnl OSX linker does not support build-id
- dnl
- case "$host_os" in
--darwin*)
-+darwin* | solaris*)
- LD_BUILD_ID=""
- ;;
- *)
-@@ -931,7 +931,7 @@ case "$host_os" in
- darwin*)
- ;;
- *)
-- AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
-+ AC_CHECK_FUNCS([clock_gettime clock_nanosleep], [CLOCK_LIB=],
- [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
- [AC_MSG_ERROR([Could not find clock_gettime])])])
- AC_SUBST([CLOCK_LIB])
-@@ -941,6 +941,9 @@ esac
- dnl See if posix_memalign is available
- AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
-
-+dnl See if open_memstream is available
-+AC_CHECK_FUNC([open_memstream], [DEFINES="$DEFINES -DHAVE_OPEN_MEMSTREAM"])
-+
- dnl Check for zlib
- PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED])
- DEFINES="$DEFINES -DHAVE_ZLIB"
-@@ -966,7 +969,7 @@ PTHREAD_LIBS="$PTHREAD_LIBS -pthread"
- dnl pthread-stubs is mandatory on some BSD platforms, due to the nature of the
- dnl project. Even then there's a notable issue as described in the project README
- case "$host_os" in
--linux* | cygwin* | darwin* | solaris* | *-gnu* | gnu* | openbsd*)
-+*)
- pthread_stubs_possible="no"
- ;;
- * )
-@@ -982,8 +985,12 @@ save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS"
- AC_MSG_CHECKING(whether pthread_setaffinity_np is supported)
- AC_LINK_IFELSE([AC_LANG_SOURCE([[
-+ #if defined(__DragonFly__) || defined(__FreeBSD__)
-+ #include <pthread_np.h>
-+ #else
- #define _GNU_SOURCE
- #include <pthread.h>
-+ #endif
- int main() {
- void *a = (void*) &pthread_setaffinity_np;
- long b = (long) a;
-@@ -995,7 +1002,10 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([[
- LIBS="$save_LIBS"
-
- dnl Check for futex for fast inline simple_mtx_t.
--AC_CHECK_HEADER([linux/futex.h], [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"])
-+AC_CHECK_HEADERS([linux/futex.h sys/umtx.h],
-+ [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"],,
-+ [#include <errno.h>
-+ #include <sys/types.h>])
-
- dnl SELinux awareness.
- AC_ARG_ENABLE([selinux],
-@@ -1278,7 +1288,7 @@ fi
- AC_SUBST(LIBSENSORS_LIBS)
-
- case "$host_os" in
--linux*)
-+linux* | freebsd* | dragonfly*)
- dri3_default=yes
- ;;
- *)
-@@ -1908,7 +1918,7 @@ if test x"$enable_dri3" = xyes; then
- dri3_modifier_modules="xcb-dri3 >= $XCBDRI3_MODIFIERS_REQUIRED xcb-present >= $XCBPRESENT_MODIFIERS_REQUIRED"
- PKG_CHECK_MODULES([XCB_DRI3_MODIFIERS], [$dri3_modifier_modules], [have_dri3_modifiers=yes], [have_dri3_modifiers=no])
-
-- if test "x$have_dri3_modifiers" == xyes; then
-+ if test "x$have_dri3_modifiers" = xyes; then
- DEFINES="$DEFINES -DHAVE_DRI3_MODIFIERS"
- fi
- fi
-@@ -2505,8 +2515,6 @@ if test "x$enable_opencl" = xyes; then
- CLANG_LIBDIR=${LLVM_LIBDIR}
- fi
- CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
-- AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
-- [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
- fi
- AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
- AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
-@@ -2941,7 +2949,7 @@ if test "x$enable_llvm" = xyes; then
- dnl the LLVM library propagated in the Libs.private of the respective .pc
- dnl file which ensures complete dependency information when statically
- dnl linking.
-- if test "x$enable_glx" == xgallium-xlib; then
-+ if test "x$enable_glx" = xgallium-xlib; then
- GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $LLVM_LIBS"
- fi
- if test "x$enable_gallium_osmesa" = xyes; then
diff --git a/MesaLib-dfbsd/patches/patch-include_GL_internal_dri__interface.h b/MesaLib-dfbsd/patches/patch-include_GL_internal_dri__interface.h
deleted file mode 100644
index dfbf75750e..0000000000
--- a/MesaLib-dfbsd/patches/patch-include_GL_internal_dri__interface.h
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-include_GL_internal_dri__interface.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-From FreeBSD ports graphics/mesa-dri 17.2.4.
-
-GCC on 9.x doesn't allow types to be overwritten, these types are defined
-in drm.h also, which causes build issues in xorg-server.
-
-From NetBSD xsrc: prevent re-definitions from drm.h
-
---- include/GL/internal/dri_interface.h.orig 2019-02-18 18:28:15.000000000 +0000
-+++ include/GL/internal/dri_interface.h
-@@ -40,13 +40,19 @@
- #ifndef DRI_INTERFACE_H
- #define DRI_INTERFACE_H
-
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+#include <drm.h>
-+#else
- #ifdef HAVE_LIBDRM
- #include <drm.h>
- #else
-+#if !defined(_DRM_H_) || !defined(__NetBSD__)
- typedef unsigned int drm_context_t;
- typedef unsigned int drm_drawable_t;
- typedef struct drm_clip_rect drm_clip_rect_t;
- #endif
-+#endif
-+#endif /* __FreeBSD__ || __DragonFly__ */
-
- #include <stdint.h>
-
diff --git a/MesaLib-dfbsd/patches/patch-meson.build b/MesaLib-dfbsd/patches/patch-meson.build
deleted file mode 100644
index 7dfc0555ab..0000000000
--- a/MesaLib-dfbsd/patches/patch-meson.build
+++ /dev/null
@@ -1,71 +0,0 @@
-$NetBSD$
-
---- meson.build.orig 2019-04-05 10:53:23.000000000 +0000
-+++ meson.build
-@@ -53,6 +53,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')
-@@ -343,7 +344,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')
-@@ -1008,7 +1012,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
-@@ -1091,11 +1095,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')
--if dep_thread.found() and host_machine.system() != 'windows'
-+if dep_thread.found() and ['freebsd', 'dragonfly'].contains(host_machine.system())
-+ pre_args += '-DHAVE_PTHREAD'
-+ if cc.has_function(
-+ 'pthread_setaffinity_np',
-+ dependencies : dep_thread,
-+ prefix : '#include <pthread_np.h>')
-+ pre_args += '-DHAVE_PTHREAD_SETAFFINITY'
-+ endif
-+elif dep_thread.found() and host_machine.system() != 'windows'
- pre_args += '-DHAVE_PTHREAD'
- if cc.has_function(
- 'pthread_setaffinity_np',
-@@ -1220,6 +1241,7 @@ if _llvm != 'false'
- with_gallium_opencl or _llvm == 'true'
- ),
- static : not _shared_llvm,
-+ method : 'config-tool',
- )
- with_llvm = dep_llvm.found()
- endif
diff --git a/MesaLib-dfbsd/patches/patch-meson__options.txt b/MesaLib-dfbsd/patches/patch-meson__options.txt
deleted file mode 100644
index c5b1045103..0000000000
--- a/MesaLib-dfbsd/patches/patch-meson__options.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-$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/patches/patch-src_amd_common_ac__debug.c b/MesaLib-dfbsd/patches/patch-src_amd_common_ac__debug.c
deleted file mode 100644
index ec2e68097e..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_amd_common_ac__debug.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_amd_common_ac__debug.c,v 1.2 2019/01/20 09:50:28 tnn Exp $
-
-#if'out some debug code on SunOS. There is no open_memstream(3)
-
---- src/amd/common/ac_debug.c.orig 2019-01-17 11:26:22.000000000 +0000
-+++ src/amd/common/ac_debug.c
-@@ -571,10 +571,12 @@ void ac_parse_ib_chunk(FILE *f, uint32_t
-
- char *out;
- size_t outsize;
-+#if defined(HAVE_OPEN_MEMSTREAM)
- FILE *memf = open_memstream(&out, &outsize);
- ib.f = memf;
- ac_do_parse_ib(memf, &ib);
- fclose(memf);
-+#endif
-
- if (out) {
- format_ib_output(f, out);
diff --git a/MesaLib-dfbsd/patches/patch-src_amd_common_ac__llvm__util.c b/MesaLib-dfbsd/patches/patch-src_amd_common_ac__llvm__util.c
deleted file mode 100644
index 9acbe5817a..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_amd_common_ac__llvm__util.c
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD$
-
-From FreeBSD ports graphics/mesa-dri 18.3.2:
-
-amd: Make vgpr-spilling depend on llvm version
-
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230789#c14
-
---- src/amd/common/ac_llvm_util.c.orig 2019-04-05 10:53:23.000000000 +0000
-+++ src/amd/common/ac_llvm_util.c
-@@ -153,7 +153,8 @@ static LLVMTargetMachineRef ac_create_ta
- LLVMTargetRef target = ac_get_llvm_target(triple);
-
- snprintf(features, sizeof(features),
-- "+DumpCode,+vgpr-spilling,-fp32-denormals,+fp64-denormals%s%s%s%s",
-+ "+DumpCode,-fp32-denormals,+fp64-denormals%s%s%s%s%s",
-+ HAVE_LLVM >= 0x0800 ? "" : ",+vgpr-spilling",
- tm_options & AC_TM_SISCHED ? ",+si-scheduler" : "",
- tm_options & AC_TM_FORCE_ENABLE_XNACK ? ",+xnack" : "",
- tm_options & AC_TM_FORCE_DISABLE_XNACK ? ",-xnack" : "",
diff --git a/MesaLib-dfbsd/patches/patch-src_amd_vulkan_radv__device.c b/MesaLib-dfbsd/patches/patch-src_amd_vulkan_radv__device.c
deleted file mode 100644
index 024fc9d848..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_amd_vulkan_radv__device.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD$
-
-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
-@@ -50,6 +50,14 @@
- #include "util/debug.h"
- #include "util/mesa-sha1.h"
-
-+#ifndef CLOCK_MONOTONIC_RAW
-+# ifdef CLOCK_MONOTONIC_FAST
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
-+# else
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
-+# endif
-+#endif
-+
- static int
- radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
- {
diff --git a/MesaLib-dfbsd/patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c b/MesaLib-dfbsd/patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
deleted file mode 100644
index 047dac279f..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Define ETIME if missing
-
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-FreeBSD Bugzilla: Bug 225415 graphics/mesa-dri: update to 18.0.0
-
---- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig 2018-02-09 02:17:57.000000000 +0000
-+++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
-@@ -33,6 +33,9 @@
- #include "radv_amdgpu_bo.h"
- #include "sid.h"
-
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
-
- enum {
- VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024
diff --git a/MesaLib-dfbsd/patches/patch-src_compiler_builtin__type__macros.h b/MesaLib-dfbsd/patches/patch-src_compiler_builtin__type__macros.h
deleted file mode 100644
index b619541018..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_compiler_builtin__type__macros.h
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-src_compiler_builtin__type__macros.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Workaround netbsd headers.
-
---- src/compiler/builtin_type_macros.h.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/compiler/builtin_type_macros.h
-@@ -28,6 +28,18 @@
- * language version or extension might provide them.
- */
-
-+#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
-+#undef uint64_t
-+#undef int8_t
-+#undef int16_t
-+#undef int32_t
-+#undef int64_t
-+#endif
-+
-+
- DECL_TYPE(error, GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0)
- DECL_TYPE(void, GL_INVALID_ENUM, GLSL_TYPE_VOID, 0, 0)
-
diff --git a/MesaLib-dfbsd/patches/patch-src_compiler_glsl_glsl__parser__extras.cpp b/MesaLib-dfbsd/patches/patch-src_compiler_glsl_glsl__parser__extras.cpp
deleted file mode 100644
index c926fe10a6..0000000000
--- a/MesaLib-dfbsd/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/patches/patch-src_egl_drivers_dri2_platform__drm.c b/MesaLib-dfbsd/patches/patch-src_egl_drivers_dri2_platform__drm.c
deleted file mode 100644
index 3920bed657..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_egl_drivers_dri2_platform__drm.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_egl_drivers_dri2_platform__drm.c,v 1.2 2019/01/20 09:50:28 tnn Exp $
-
-netbsd-5 build fix
-
---- src/egl/drivers/dri2/platform_drm.c.orig 2019-01-17 11:26:22.000000000 +0000
-+++ src/egl/drivers/dri2/platform_drm.c
-@@ -725,7 +725,11 @@ dri2_initialize_drm(_EGLDriver *drv, _EG
- }
- dri2_dpy->own_device = true;
- } else {
-+#ifdef F_DUPFD_CLOEXEC
- dri2_dpy->fd = fcntl(gbm_device_get_fd(gbm), F_DUPFD_CLOEXEC, 3);
-+#else
-+ dri2_dpy->fd = -1;
-+#endif
- if (dri2_dpy->fd < 0) {
- err = "DRI2: failed to fcntl() existing gbm device";
- goto cleanup;
diff --git a/MesaLib-dfbsd/patches/patch-src_egl_drivers_dri2_platform__x11.c b/MesaLib-dfbsd/patches/patch-src_egl_drivers_dri2_platform__x11.c
deleted file mode 100644
index 4d7c77b551..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_egl_drivers_dri2_platform__x11.c
+++ /dev/null
@@ -1,60 +0,0 @@
-$NetBSD: patch-src_egl_drivers_dri2_platform__x11.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Provide compat strndup for older Darwin.
-
-* From FreeBSD ports 18.0.0:
-work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
-
-Mon Apr 10 19:14:48 2017 UTC
-DRI3 remains enabled at compile time, but it is now disabled at
-runtime for stock FreeBSD. Set LIBGL_DRI3_ENABLE in the
-environment to enable DRI3.
-This change was made to work around a problem in libEGL,
-which fails to fall back to using DRI2 when run on a system
-without DRI3 support.
-
-* Added logging statement to note dri3 initialization being invoked.
-
---- src/egl/drivers/dri2/platform_x11.c.orig 2018-02-09 02:17:57.000000000 +0000
-+++ src/egl/drivers/dri2/platform_x11.c
-@@ -608,6 +608,23 @@ dri2_x11_local_authenticate(struct dri2_
- return EGL_TRUE;
- }
-
-+#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
-+static char *
-+strndup(const char *s, int length)
-+{
-+ char *d;
-+
-+ d = malloc(length + 1);
-+ if (d == NULL)
-+ return NULL;
-+
-+ memcpy(d, s, length);
-+ d[length] = '\0';
-+
-+ return d;
-+}
-+#endif
-+
- static EGLBoolean
- dri2_x11_connect(struct dri2_egl_display *dri2_dpy)
- {
-@@ -1466,8 +1483,15 @@ dri2_initialize_x11(_EGLDriver *drv, _EG
-
- if (!disp->Options.ForceSoftware) {
- #ifdef HAVE_DRI3
-- if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
-+#if ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)) || defined(TEST_DRI3_ENABLE)
-+ if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false))
-+#endif
-+ if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false)) {
-+ _eglLog(_EGL_INFO, "platform_x11.c: calling dri2_initialize_x11_dri3\n");
- initialized = dri2_initialize_x11_dri3(drv, disp);
-+ if (initialized)
-+ _eglLog(_EGL_INFO, "platform_x11.c: initialized by dri2_initialize_x11_dri3\n");
-+ }
- #endif
-
- if (!initialized)
diff --git a/MesaLib-dfbsd/patches/patch-src_egl_main_eglglobals.c b/MesaLib-dfbsd/patches/patch-src_egl_main_eglglobals.c
deleted file mode 100644
index 2c3a00bc34..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_egl_main_eglglobals.c
+++ /dev/null
@@ -1,68 +0,0 @@
-$NetBSD: patch-src_egl_main_eglglobals.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-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
-
-From NetBSD xsrc:
-The third argument of mincore(2) is unsigned only on linux.
-
---- src/egl/main/eglglobals.c.orig 2019-05-03 15:59:12.000000000 +0000
-+++ src/egl/main/eglglobals.c
-@@ -93,11 +93,22 @@ struct _egl_global _eglGlobal =
- .debugTypesEnabled = _EGL_DEBUG_BIT_CRITICAL | _EGL_DEBUG_BIT_ERROR,
- };
-
-+#if defined(HAVE_NOATEXIT)
-+static EGLBoolean registered = EGL_FALSE;
-
-+static void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- _eglAtExit(void)
- {
- EGLint i;
-+
-+#if defined(HAVE_NOATEXIT)
-+ if (!registered)
-+ return;
-+#endif
-+
- for (i = _eglGlobal.NumAtExitCalls - 1; i >= 0; i--)
- _eglGlobal.AtExitCalls[i]();
- }
-@@ -107,14 +118,20 @@ void
- _eglAddAtExitCall(void (*func)(void))
- {
- if (func) {
-+#if !defined(HAVE_NOATEXIT)
- static EGLBoolean registered = EGL_FALSE;
-+#endif
-
- mtx_lock(_eglGlobal.Mutex);
-
-+#if defined(HAVE_NOATEXIT)
-+ registered = EGL_TRUE;
-+#else
- if (!registered) {
- atexit(_eglAtExit);
- registered = EGL_TRUE;
- }
-+#endif
-
- assert(_eglGlobal.NumAtExitCalls < ARRAY_SIZE(_eglGlobal.AtExitCalls));
- _eglGlobal.AtExitCalls[_eglGlobal.NumAtExitCalls++] = func;
-@@ -162,7 +179,10 @@ _eglPointerIsDereferencable(void *p)
- {
- #ifdef HAVE_MINCORE
- uintptr_t addr = (uintptr_t) p;
-- unsigned char valid = 0;
-+#ifdef __linux__
-+ unsigned
-+#endif
-+ char valid = 0;
- const long page_size = getpagesize();
-
- if (p == NULL)
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_drivers_trace_tr__dump.c b/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_drivers_trace_tr__dump.c
deleted file mode 100644
index 9935beb299..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_drivers_trace_tr__dump.c
+++ /dev/null
@@ -1,50 +0,0 @@
-$NetBSD: patch-src_gallium_auxiliary_drivers_trace_tr__dump.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-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/gallium/auxiliary/driver_trace/tr_dump.c.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/gallium/auxiliary/driver_trace/tr_dump.c
-@@ -63,7 +63,6 @@ static mtx_t call_mutex = _MTX_INITIALIZ
- static long unsigned call_no = 0;
- static boolean dumping = FALSE;
-
--
- static inline void
- trace_dump_write(const char *buf, size_t size)
- {
-@@ -171,9 +170,20 @@ trace_dump_trace_flush(void)
- }
- }
-
-+#if defined(HAVE_NOATEXIT)
-+static boolean trace_dump_has_begun = FALSE;
-+
-+static void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- trace_dump_trace_close(void)
- {
-+#if defined(HAVE_NOATEXIT)
-+ if (!trace_dump_has_begun)
-+ return;
-+#endif
-+
- if (stream) {
- trace_dump_writes("</trace>\n");
- if (close_stream) {
-@@ -233,7 +243,11 @@ trace_dump_trace_begin(void)
- * screen multiple times, so we only write </trace> tag and close at exit
- * time.
- */
-+#if defined(HAVE_NOATEXIT)
-+ trace_dump_has_begun = TRUE;
-+#else
- atexit(trace_dump_trace_close);
-+#endif
- }
-
- return TRUE;
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c b/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
deleted file mode 100644
index 49110fbb10..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
+++ /dev/null
@@ -1,127 +0,0 @@
-$NetBSD: patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c,v 1.2 2019/01/10 22:30:11 tnn Exp $
-
-* From FreeBSD ports / DragonFly dports graphics/mesa-dri
-
-Revert the following commit.
-
-FreeBSD and DragonFly don't have the required render nodes.
-
--------
-
-From 69a1b9959e59653da262185c4e2cf57d24939b19 Mon Sep 17 00:00:00 2001
-Date: Mon, 29 Jun 2015 12:36:45 +0100
-Subject: pipe-loader: drop support for non-render node devices
-
-Render nodes have been around for quite some time. Removing support via
-the master/primary node allows us to clean up the conditional
-compilation and simplify the build greatly.
-
-For example currently we the pipe-loader, which explicitly links against
-xcb and friends (for X auth) if found at compile-time. That
-would cause problems as one will be forced to use X/xcb, even if it's a
-headless system that is used for opencl.
-
-v2: Clarify the linking topic in the commit message.
-
-* Extended for NetBSD.
-
---- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2018-12-11 21:13:57.000000000 +0000
-+++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
-@@ -229,6 +229,16 @@ pipe_loader_drm_probe_fd(struct pipe_loa
- return ret;
- }
-
-+#if defined(NO_RENDER_NODE)
-+static int
-+open_drm_minor(int minor)
-+{
-+ char path[PATH_MAX];
-+ snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor);
-+ return open(path, O_RDWR, 0);
-+}
-+#endif
-+
- static int
- open_drm_render_node_minor(int minor)
- {
-@@ -241,7 +251,19 @@ open_drm_render_node_minor(int minor)
- int
- pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
- {
-+#if defined(NO_RENDER_NODE)
-+ int i, k, fd, num_render_node_devs;
-+ int j = 0;
-+
-+ struct {
-+ unsigned vendor_id;
-+ unsigned chip_id;
-+ } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
-+
-+ /* Look for render nodes first */
-+#else
- int i, j, fd;
-+#endif
-
- for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
- i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
-@@ -256,6 +278,11 @@ pipe_loader_drm_probe(struct pipe_loader
- continue;
- }
-
-+#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;
-+
-+#endif
- if (j < ndev) {
- devs[j] = dev;
- } else {
-@@ -265,6 +292,48 @@ pipe_loader_drm_probe(struct pipe_loader
- j++;
- }
-
-+#if defined(NO_RENDER_NODE)
-+ num_render_node_devs = j;
-+
-+ /* Next look for drm devices. */
-+ for (i = 0; i < DRM_MAX_MINOR; i++) {
-+ struct pipe_loader_device *dev;
-+ boolean duplicate = FALSE;
-+ fd = open_drm_minor(i);
-+ if (fd < 0)
-+ continue;
-+
-+ if (!pipe_loader_drm_probe_fd(&dev, fd)) {
-+ close(fd);
-+ continue;
-+ }
-+
-+ /* Check to make sure we aren't already accessing this device via
-+ * render nodes.
-+ */
-+ for (k = 0; k < num_render_node_devs; k++) {
-+ if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id &&
-+ dev->u.pci.chip_id == render_node_devs[k].chip_id) {
-+ close(fd);
-+ dev->ops->release(&dev);
-+ duplicate = TRUE;
-+ break;
-+ }
-+ }
-+
-+ if (duplicate)
-+ continue;
-+
-+ if (j < ndev) {
-+ devs[j] = dev;
-+ } else {
-+ dev->ops->release(&dev);
-+ }
-+
-+ j++;
-+ }
-+
-+#endif
- return j;
- }
-
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_util_u__format__tests.c b/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_util_u__format__tests.c
deleted file mode 100644
index fb56a9855f..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_util_u__format__tests.c
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-src_gallium_auxiliary_util_u__format__tests.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-On old NetBSD, NAN in math.h is __nanf.__val. Which is not constant.
-
---- src/gallium/auxiliary/util/u_format_tests.c.orig 2014-09-12 21:30:32.000000000 +0000
-+++ src/gallium/auxiliary/util/u_format_tests.c
-@@ -28,6 +28,10 @@
-
- #include <math.h>
- #include <float.h>
-+#if defined(__NetBSD__) && __NetBSD_Version__ < 600000000
-+#undef NAN
-+#define NAN __builtin_nanf("")
-+#endif
-
- #include "pipe/p_config.h"
- #include "u_memory.h"
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_util_u__helpers.c b/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_util_u__helpers.c
deleted file mode 100644
index c26caa59b2..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_auxiliary_util_u__helpers.c
+++ /dev/null
@@ -1,34 +0,0 @@
-$NetBSD: patch-src_gallium_auxiliary_util_u__helpers.c,v 1.2 2019/01/20 09:50:28 tnn Exp $
-
-handle NetBSD-style pthread_setaffinity_np(3)
-
---- src/gallium/auxiliary/util/u_helpers.c.orig 2018-12-11 21:13:57.000000000 +0000
-+++ src/gallium/auxiliary/util/u_helpers.c
-@@ -129,6 +129,19 @@ static once_flag thread_pinning_once_fla
- static void
- util_set_full_cpu_affinity(void)
- {
-+#if defined(__NetBSD__) && defined(SETAFFINITY_NP_NETBSD)
-+ cpuset_t *cpuset;
-+
-+ cpuset = cpuset_create();
-+ if (cpuset != NULL) {
-+ cpuset_zero(cpuset);
-+ for (unsigned i = 0; i < cpuset_size(cpuset); i++)
-+ cpuset_set(i, cpuset);
-+
-+ pthread_setaffinity_np(pthread_self(), cpuset_size(cpuset), cpuset);
-+ cpuset_destroy(cpuset);
-+ }
-+#else
- cpu_set_t cpuset;
-
- CPU_ZERO(&cpuset);
-@@ -136,6 +149,7 @@ util_set_full_cpu_affinity(void)
- CPU_SET(i, &cpuset);
-
- pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset);
-+#endif
- }
-
- static void
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_freedreno_freedreno__screen.c b/MesaLib-dfbsd/patches/patch-src_gallium_drivers_freedreno_freedreno__screen.c
deleted file mode 100644
index 8732e9e5dc..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_freedreno_freedreno__screen.c
+++ /dev/null
@@ -1,34 +0,0 @@
-$NetBSD$
-
-From FreeBSD ports graphics/mesa-dri 18.1.4.
-
-- Without sysinfo() fall back to sysconf()
-
---- src/gallium/drivers/freedreno/freedreno_screen.c.orig 2018-07-13 18:41:27.000000000 +0000
-+++ src/gallium/drivers/freedreno/freedreno_screen.c
-@@ -43,7 +43,11 @@
- #include <errno.h>
- #include <stdio.h>
- #include <stdlib.h>
-+#ifdef __GLIBC__
- #include <sys/sysinfo.h>
-+#else
-+#include <unistd.h>
-+#endif
-
- #include "freedreno_screen.h"
- #include "freedreno_resource.h"
-@@ -837,9 +841,13 @@ fd_screen_create(struct fd_device *dev)
- screen->priority_mask = (1 << val) - 1;
- }
-
-+#ifdef __GLIBC__
- struct sysinfo si;
- sysinfo(&si);
- screen->ram_size = si.totalram;
-+#else
-+ screen->ram_size = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
-+#endif
-
- DBG("Pipe Info:");
- DBG(" GPU-id: %d", screen->gpu_id);
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c b/MesaLib-dfbsd/patches/patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c
deleted file mode 100644
index 91ad33c971..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Fix build on platforms without close-on-exec.
-
---- src/gallium/drivers/nouveau/nouveau_vp3_video.c.orig 2017-02-13 11:55:49.000000000 +0000
-+++ src/gallium/drivers/nouveau/nouveau_vp3_video.c
-@@ -294,7 +294,11 @@ nouveau_vp3_load_firmware(struct nouveau
- if (nouveau_bo_map(dec->fw_bo, NOUVEAU_BO_WR, dec->client))
- return 1;
-
-+#ifdef O_CLOEXEC
- fd = open(path, O_RDONLY | O_CLOEXEC);
-+#else
-+ fd = open(path, O_RDONLY);
-+#endif
- if (fd < 0) {
- fprintf(stderr, "opening firmware file %s failed: %m\n", path);
- return 1;
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_nouveau_nv50_nv84__video.c b/MesaLib-dfbsd/patches/patch-src_gallium_drivers_nouveau_nv50_nv84__video.c
deleted file mode 100644
index 883e4426e9..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_nouveau_nv50_nv84__video.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_gallium_drivers_nouveau_nv50_nv84__video.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Fix build on platforms without close-on-exec.
-
---- src/gallium/drivers/nouveau/nv50/nv84_video.c.orig 2015-03-21 00:51:18.000000000 +0000
-+++ src/gallium/drivers/nouveau/nv50/nv84_video.c
-@@ -34,7 +34,11 @@
- static int
- nv84_copy_firmware(const char *path, void *dest, ssize_t len)
- {
-+#ifdef O_CLOEXEC
- int fd = open(path, O_RDONLY | O_CLOEXEC);
-+#else
-+ int fd = open(path, O_RDONLY);
-+#endif
- ssize_t r;
- if (fd < 0) {
- fprintf(stderr, "opening firmware file %s failed: %m\n", path);
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__compute__blit.c b/MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__compute__blit.c
deleted file mode 100644
index ebbbeb87b0..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__compute__blit.c
+++ /dev/null
@@ -1,180 +0,0 @@
-$NetBSD$
-
-2018-10-16 radeonsi: use compute shaders for clear_buffer & copy_buffer
-Commit: 9b331e462e5021d994859756d46cd2519d9c9c6e
-
-https://cgit.freedesktop.org/mesa/mesa/commit/?id=9b331e462e5021d994859756d46cd2519d9c9c6e
-
---- src/gallium/drivers/radeonsi/si_compute_blit.c.orig 2018-11-01 17:49:16.000000000 +0000
-+++ src/gallium/drivers/radeonsi/si_compute_blit.c
-@@ -32,10 +32,17 @@ static enum si_cache_policy get_cache_po
- enum si_coherency coher,
- uint64_t size)
- {
-+#if defined(REVERT_COPY_CLEAR)
-+ if ((sctx->chip_class >= GFX9 && coher == SI_COHERENCY_CB_META) ||
-+ (sctx->chip_class >= CIK && coher == SI_COHERENCY_SHADER))
-+ return L2_LRU;
-+
-+#else
- if ((sctx->chip_class >= GFX9 && (coher == SI_COHERENCY_CB_META ||
- coher == SI_COHERENCY_CP)) ||
- (sctx->chip_class >= CIK && coher == SI_COHERENCY_SHADER))
- return size <= 256 * 1024 ? L2_LRU : L2_STREAM;
-+#endif
-
- return L2_BYPASS;
- }
-@@ -149,6 +156,51 @@ void si_clear_buffer(struct si_context *
- uint64_t offset, uint64_t size, uint32_t *clear_value,
- uint32_t clear_value_size, enum si_coherency coher)
- {
-+#if defined(REVERT_COPY_CLEAR)
-+
-+/* Recommended maximum sizes for optimal performance.
-+ * Fall back to compute or SDMA if the size is greater.
-+ */
-+#define CP_DMA_COPY_PERF_THRESHOLD (64 * 1024) /* copied from Vulkan */
-+#define CP_DMA_CLEAR_PERF_THRESHOLD (32 * 1024) /* guess (clear is much slower) */
-+
-+ struct radeon_winsys *ws = sctx->ws;
-+ struct r600_resource *rdst = r600_resource(dst);
-+ enum si_cache_policy cache_policy = get_cache_policy(sctx, coher, size);
-+
-+ if (!size)
-+ return;
-+
-+ uint64_t aligned_size = size & ~3ull;
-+
-+ /* dma_clear_buffer can use clear_buffer on failure. Make sure that
-+ * doesn't happen. We don't want an infinite recursion: */
-+ if (sctx->dma_cs &&
-+ !(dst->flags & PIPE_RESOURCE_FLAG_SPARSE) &&
-+ (offset % 4 == 0) &&
-+ /* CP DMA is very slow. Always use SDMA for big clears. This
-+ * alone improves DeusEx:MD performance by 70%. */
-+ (size > CP_DMA_CLEAR_PERF_THRESHOLD ||
-+ /* Buffers not used by the GFX IB yet will be cleared by SDMA.
-+ * This happens to move most buffer clears to SDMA, including
-+ * DCC and CMASK clears, because pipe->clear clears them before
-+ * si_emit_framebuffer_state (in a draw call) adds them.
-+ * For example, DeusEx:MD has 21 buffer clears per frame and all
-+ * of them are moved to SDMA thanks to this. */
-+ !ws->cs_is_buffer_referenced(sctx->gfx_cs, rdst->buf,
-+ RADEON_USAGE_READWRITE))) {
-+ si_sdma_clear_buffer(sctx, dst, offset, aligned_size, *clear_value);
-+
-+ offset += aligned_size;
-+ size -= aligned_size;
-+ } else if (aligned_size >= 4) {
-+ si_cp_dma_clear_buffer(sctx, dst, offset, aligned_size, *clear_value,
-+ coher, get_cache_policy(sctx, coher, size));
-+
-+ offset += aligned_size;
-+ size -= aligned_size;
-+ }
-+#else
- if (!size)
- return;
-
-@@ -227,6 +279,7 @@ void si_clear_buffer(struct si_context *
- offset += aligned_size;
- size -= aligned_size;
- }
-+#endif
-
- /* Handle non-dword alignment. */
- if (size) {
-@@ -244,6 +297,58 @@ static void si_pipe_clear_buffer(struct
- const void *clear_value,
- int clear_value_size)
- {
-+#if defined(REVERT_COPY_CLEAR)
-+ struct si_context *sctx = (struct si_context*)ctx;
-+ uint32_t dword_value;
-+
-+ assert(offset % clear_value_size == 0);
-+ assert(size % clear_value_size == 0);
-+
-+ if (clear_value_size > 4) {
-+ bool clear_dword_duplicated = true;
-+
-+ /* See if we can lower large fills to dword fills. */
-+ for (unsigned i = 1; i < clear_value_size / 4; i++)
-+ if (((uint32_t *)clear_value)[0] != ((uint32_t*)clear_value)[i]) {
-+ clear_dword_duplicated = false;
-+ break;
-+ }
-+
-+ if (!clear_dword_duplicated) {
-+ /* Use transform feedback for 64-bit, 96-bit, and
-+ * 128-bit fills.
-+ */
-+ union pipe_color_union streamout_clear_value;
-+
-+ memcpy(&streamout_clear_value, clear_value, clear_value_size);
-+ si_blitter_begin(sctx, SI_DISABLE_RENDER_COND);
-+ util_blitter_clear_buffer(sctx->blitter, dst, offset,
-+ size, clear_value_size / 4,
-+ &streamout_clear_value);
-+ si_blitter_end(sctx);
-+ return;
-+ }
-+ }
-+
-+ /* Expand the clear value to a dword. */
-+ switch (clear_value_size) {
-+ case 1:
-+ dword_value = *(uint8_t*)clear_value;
-+ dword_value |= (dword_value << 8) |
-+ (dword_value << 16) |
-+ (dword_value << 24);
-+ break;
-+ case 2:
-+ dword_value = *(uint16_t*)clear_value;
-+ dword_value |= dword_value << 16;
-+ break;
-+ default:
-+ dword_value = *(uint32_t*)clear_value;
-+ }
-+
-+ si_clear_buffer(sctx, dst, offset, size, &dword_value,
-+ clear_value_size, SI_COHERENCY_SHADER);
-+#else
- enum si_coherency coher;
-
- if (dst->flags & SI_RESOURCE_FLAG_SO_FILLED_SIZE)
-@@ -253,6 +358,7 @@ static void si_pipe_clear_buffer(struct
-
- si_clear_buffer((struct si_context*)ctx, dst, offset, size, (uint32_t*)clear_value,
- clear_value_size, coher);
-+#endif
- }
-
- void si_copy_buffer(struct si_context *sctx,
-@@ -265,6 +371,17 @@ void si_copy_buffer(struct si_context *s
- enum si_coherency coher = SI_COHERENCY_SHADER;
- enum si_cache_policy cache_policy = get_cache_policy(sctx, coher, size);
-
-+#if defined(REVERT_COPY_CLEAR)
-+ si_cp_dma_copy_buffer(sctx, dst, src, dst_offset, src_offset, size,
-+ 0, coher, cache_policy);
-+
-+ if (cache_policy != L2_BYPASS)
-+ r600_resource(dst)->TC_L2_dirty = true;
-+
-+ /* If it's not a prefetch... */
-+ if (dst_offset != src_offset)
-+ sctx->num_cp_dma_calls++;
-+#else
- /* Only use compute for VRAM copies on dGPUs. */
- if (sctx->screen->info.has_dedicated_vram &&
- r600_resource(dst)->domains & RADEON_DOMAIN_VRAM &&
-@@ -277,6 +394,7 @@ void si_copy_buffer(struct si_context *s
- si_cp_dma_copy_buffer(sctx, dst, src, dst_offset, src_offset, size,
- 0, coher, cache_policy);
- }
-+#endif
- }
-
- void si_init_compute_blit_functions(struct si_context *sctx)
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__pipe.c b/MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__pipe.c
deleted file mode 100644
index f38071be44..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__pipe.c
+++ /dev/null
@@ -1,93 +0,0 @@
-$NetBSD$
-
-Option to revert:
-
-2017-05-15 radeonsi: enable threaded_context
-Commit: 1c8f7d3be6ffb3567041f1e11a037fa7e75e4c28
-
-https://cgit.freedesktop.org/mesa/mesa/commit/?id=1c8f7d3be6ffb3567041f1e11a037fa7e75e4c28
-
-2018-10-16 radeonsi: use compute shaders for clear_buffer & copy_buffer
-Commit: 9b331e462e5021d994859756d46cd2519d9c9c6e
-
-https://cgit.freedesktop.org/mesa/mesa/commit/?id=9b331e462e5021d994859756d46cd2519d9c9c6e
-
---- src/gallium/drivers/radeonsi/si_pipe.c.orig 2019-03-18 15:52:18.000000000 +0000
-+++ src/gallium/drivers/radeonsi/si_pipe.c
-@@ -195,10 +195,12 @@ static void si_destroy_context(struct pi
- sctx->b.delete_vs_state(&sctx->b, sctx->vs_blit_color_layered);
- if (sctx->vs_blit_texcoord)
- sctx->b.delete_vs_state(&sctx->b, sctx->vs_blit_texcoord);
-+#if !defined(REVERT_COPY_CLEAR)
- if (sctx->cs_clear_buffer)
- sctx->b.delete_compute_state(&sctx->b, sctx->cs_clear_buffer);
- if (sctx->cs_copy_buffer)
- sctx->b.delete_compute_state(&sctx->b, sctx->cs_copy_buffer);
-+#endif
-
- if (sctx->blitter)
- util_blitter_destroy(sctx->blitter);
-@@ -367,7 +369,11 @@ static void si_set_context_param(struct
- }
-
- static struct pipe_context *si_create_context(struct pipe_screen *screen,
-+#if defined(REVERT_THREADED_CONTEXT)
-+ void *priv, unsigned flags)
-+#else
- unsigned flags)
-+#endif
- {
- struct si_context *sctx = CALLOC_STRUCT(si_context);
- struct si_screen* sscreen = (struct si_screen *)screen;
-@@ -381,7 +387,11 @@ static struct pipe_context *si_create_co
- sscreen->record_llvm_ir = true; /* racy but not critical */
-
- sctx->b.screen = screen; /* this must be set first */
-+#if defined(REVERT_THREADED_CONTEXT)
-+ sctx->b.priv = priv;
-+#else
- sctx->b.priv = NULL;
-+#endif
- sctx->b.destroy = si_destroy_context;
- sctx->b.emit_string_marker = si_emit_string_marker;
- sctx->b.set_debug_callback = si_set_debug_callback;
-@@ -623,6 +633,7 @@ fail:
- return NULL;
- }
-
-+#if !defined(REVERT_THREADED_CONTEXT)
- static struct pipe_context *si_pipe_create_context(struct pipe_screen *screen,
- void *priv, unsigned flags)
- {
-@@ -653,6 +664,7 @@ static struct pipe_context *si_pipe_crea
- sscreen->info.drm_major >= 3 ? si_create_fence : NULL,
- &((struct si_context*)ctx)->tc);
- }
-+#endif
-
- /*
- * pipe_screen
-@@ -847,7 +859,11 @@ struct pipe_screen *radeonsi_screen_crea
- debug_options, 0);
-
- /* Set functions first. */
-+#if defined(REVERT_THREADED_CONTEXT)
-+ sscreen->b.context_create = si_create_context;
-+#else
- sscreen->b.context_create = si_pipe_create_context;
-+#endif
- sscreen->b.destroy = si_destroy_screen;
-
- si_init_screen_get_functions(sscreen);
-@@ -1111,7 +1127,11 @@ struct pipe_screen *radeonsi_screen_crea
- si_init_compiler(sscreen, &sscreen->compiler_lowp[i]);
-
- /* Create the auxiliary context. This must be done last. */
-+#if defined(REVERT_THREADED_CONTEXT)
-+ sscreen->aux_context = sscreen->b.context_create(&sscreen->b, NULL, 0);
-+#else
- sscreen->aux_context = si_create_context(&sscreen->b, 0);
-+#endif
-
- if (sscreen->debug_flags & DBG(TEST_DMA))
- si_test_dma(sscreen);
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__state__shaders.c b/MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__state__shaders.c
deleted file mode 100644
index 9905344d81..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_radeonsi_si__state__shaders.c
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-src_gallium_drivers_radeonsi_si__state__shaders.c,v 1.3 2019/01/20 09:50:28 tnn Exp $
-
-#if'out some debug code on SunOS. There is no open_memstream(3)
-
---- src/gallium/drivers/radeonsi/si_state_shaders.c.orig 2019-01-17 11:26:22.000000000 +0000
-+++ src/gallium/drivers/radeonsi/si_state_shaders.c
-@@ -1721,12 +1721,14 @@ static void si_build_shader_variant(stru
- }
-
- if (shader->compiler_ctx_state.is_debug_context) {
-+#if defined(HAVE_OPEN_MEMSTREAM)
- FILE *f = open_memstream(&shader->shader_log,
- &shader->shader_log_size);
- if (f) {
- si_shader_dump(sscreen, shader, NULL, sel->type, f, false);
- fclose(f);
- }
-+#endif
- }
-
- si_shader_init_pm4_state(sscreen, shader);
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c b/MesaLib-dfbsd/patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c
deleted file mode 100644
index 2eec8e3d7f..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_gallium_drivers_vc4_vc4__bufmgr.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Patch from FreeBSD ports graphics/mesa-dri 17.1.0
-
-# define ETIME as ETIMEOUT same as in intel driver
-
---- src/gallium/drivers/vc4/vc4_bufmgr.c.orig 2017-05-25 07:13:13.000000000 +0000
-+++ src/gallium/drivers/vc4/vc4_bufmgr.c
-@@ -27,6 +27,9 @@
- #include <fcntl.h>
- #include <xf86drm.h>
- #include <xf86drmMode.h>
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
-
- #include "util/u_hash_table.h"
- #include "util/u_memory.h"
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_include_pipe_p__config.h b/MesaLib-dfbsd/patches/patch-src_gallium_include_pipe_p__config.h
deleted file mode 100644
index b66a74e446..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_include_pipe_p__config.h
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-src_gallium_include_pipe_p__config.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Patches for Sparc from FreeBSD ports for mesa-dri 17.2.3.
-
-* Definitions for DragonFly already in upstream source.
-
---- src/gallium/include/pipe/p_config.h.orig 2017-10-19 12:23:53.000000000 +0000
-+++ src/gallium/include/pipe/p_config.h
-@@ -77,6 +77,12 @@
- #define PIPE_CC_ICL
- #endif
-
-+#if defined(__sparc__) || defined(__sparc64__)
-+#define PIPE_ARCH_SPARC
-+#if defined(__sparc64__)
-+#define PIPE_ARCH_SPARC_64
-+#endif
-+#endif
-
- /*
- * Processor architecture
-@@ -131,7 +137,8 @@
-
- #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
- #define PIPE_ARCH_LITTLE_ENDIAN
--#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390)
-+#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_SPARC) || defined(PIPE_ARCH_SPARC_64)
-+
- #define PIPE_ARCH_BIG_ENDIAN
- #endif
-
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp b/MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
deleted file mode 100644
index 10ebcf46ac..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-src_gallium_state__trackers_clover_llvm_invocation.cpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Patch from FreeBSD ports graphics/mesa-dri 17.1.0
-
-# fix errors like the following
-#
-# llvm/invocation.cpp:(.text+0x1275): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::c_str()
- const'
-# /usr/bin/ld: ../../../../src/gallium/state_trackers/clover/.libs/libclover.a(libclllvm_la-invocation.o): relocation R_X86_64_PC32 against `_ZNKSt3__112bas
-ic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv' can not be used when making a shared object; recompile with -fPIC
-# /usr/bin/ld: final link failed: Bad value
-#
-
---- src/gallium/state_trackers/clover/llvm/invocation.cpp.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/gallium/state_trackers/clover/llvm/invocation.cpp
-@@ -181,6 +181,10 @@ namespace {
- return get_lang_standard_from_version_str(device_version);
- }
-
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+ const char* cstr(const std::string& str) { return str.c_str(); }
-+#endif
-+
- std::unique_ptr<clang::CompilerInstance>
- create_compiler_instance(const device &dev,
- const std::vector<std::string> &opts,
-@@ -193,8 +197,13 @@ namespace {
- // Parse the compiler options. A file name should be present at the end
- // and must have the .cl extension in order for the CompilerInvocation
- // class to recognize it as an OpenCL source file.
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+ std::vector<const char *> copts(opts.size());
-+ std::transform(opts.begin(), opts.end(), copts.begin(), cstr);
-+#else
- const std::vector<const char *> copts =
- map(std::mem_fn(&std::string::c_str), opts);
-+#endif
-
- const target &target = dev.ir_target();
- const std::string &device_clc_version = dev.device_clc_version();
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp b/MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp
deleted file mode 100644
index cc9ecdf93d..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-src_gallium_state__trackers_clover_llvm_metadata.hpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-From FreeBSD ports graphics/libGL mesa 13.0.5
-
-# Fix error: no matching constructor for initialization of 'std::vector<const ::llvm::MDNode *>'
-#
-
---- src/gallium/state_trackers/clover/llvm/metadata.hpp.orig 2017-02-13 11:55:49.000000000 +0000
-+++ src/gallium/state_trackers/clover/llvm/metadata.hpp
-@@ -42,7 +42,11 @@ namespace clover {
- get_kernel_nodes(const ::llvm::Module &mod) {
- if (const ::llvm::NamedMDNode *n =
- mod.getNamedMetadata("opencl.kernels"))
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+ return { n->getOperand(0), n->getOperand(n->getNumOperands()) };
-+#else
- return { n->op_begin(), n->op_end() };
-+#endif
- else
- return {};
- }
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_util_range.hpp b/MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_util_range.hpp
deleted file mode 100644
index 6ba36d1996..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_state__trackers_clover_util_range.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-src_gallium_state__trackers_clover_util_range.hpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-From FreeBSD ports for mesa 17.1.10:
-
-From b95533b981af9a6687b41418e7cc2a5652fc2bdb Mon Sep 17 00:00:00 2001
-Date: Fri, 7 Mar 2014 15:16:08 +0100
-Subject: [PATCH 3/3] Work around for clang 3.4 which fails to build Clover
-
-See:
- https://bugs.freedesktop.org/show_bug.cgi?id=74098#c3
-
---- src/gallium/state_trackers/clover/util/range.hpp.orig 2017-09-25 16:56:19.000000000 +0000
-+++ src/gallium/state_trackers/clover/util/range.hpp
-@@ -362,6 +362,14 @@ namespace clover {
- return { i, i + n };
- }
-
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+ namespace detail {
-+ template<typename T>
-+ using fixup_function_type =
-+ typename std::conditional<std::is_function<T>::value, T &, T>::type;
-+ }
-+#endif
-+
- ///
- /// Create a range by transforming the contents of a number of
- /// source ranges \a rs element-wise using a provided functor \a f.
-@@ -369,7 +377,11 @@ namespace clover {
- /// \sa adaptor_range.
- ///
- template<typename F, typename... Rs>
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+ adaptor_range<detail::fixup_function_type<F>, Rs...>
-+#else
- adaptor_range<F, Rs...>
-+#endif
- map(F &&f, Rs &&... rs) {
- return { std::forward<F>(f), std::forward<Rs>(rs)... };
- }
diff --git a/MesaLib-dfbsd/patches/patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c b/MesaLib-dfbsd/patches/patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c
deleted file mode 100644
index 521800ccd7..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c,v 1.1 2015/04/25 11:19:18 tnn Exp $
-
-Don't create pipe thread on NetBSD. It triggers some kernel bug.
-kern/49838.
-
---- src/gallium/winsys/radeon/drm/radeon_drm_winsys.c.orig 2018-07-06 23:20:10.000000000 +0000
-+++ src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
-@@ -906,8 +906,10 @@ radeon_drm_winsys_create(int fd, const s
- /* TTM aligns the BO size to the CPU page size */
- ws->info.gart_page_size = sysconf(_SC_PAGESIZE);
-
-+#if !defined(NO_CS_QUEUE)
- if (ws->num_cpus > 1 && debug_get_option_thread())
- util_queue_init(&ws->cs_queue, "rcs", 8, 1, 0);
-+#endif
-
- /* Create the screen at the end. The winsys must be initialized
- * completely.
diff --git a/MesaLib-dfbsd/patches/patch-src_gbm_Makefile.am b/MesaLib-dfbsd/patches/patch-src_gbm_Makefile.am
deleted file mode 100644
index bc09de51da..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gbm_Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-src_gbm_Makefile.am,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
---- src/gbm/Makefile.am.orig 2017-11-20 14:25:47.000000000 +0000
-+++ src/gbm/Makefile.am
-@@ -28,6 +28,7 @@ libgbm_la_LIBADD = \
- $(top_builddir)/src/loader/libloader.la \
- $(top_builddir)/src/util/libmesautil.la \
- $(top_builddir)/src/util/libxmlconfig.la \
-+ $(PTHREAD_LIBS) \
- $(DLOPEN_LIBS)
-
- if HAVE_PLATFORM_WAYLAND
diff --git a/MesaLib-dfbsd/patches/patch-src_gbm_backends_dri_gbm__dri.c b/MesaLib-dfbsd/patches/patch-src_gbm_backends_dri_gbm__dri.c
deleted file mode 100644
index 9fdaaa6c40..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_gbm_backends_dri_gbm__dri.c
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD$
-
-Patch from NetBSD xsrc:
-don't return void
-
---- src/gbm/backends/dri/gbm_dri.c.orig 2019-04-05 10:53:23.000000000 +0000
-+++ src/gbm/backends/dri/gbm_dri.c
-@@ -182,8 +182,13 @@ swrast_put_image(__DRIdrawable *driDrawa
- char *data,
- void *loaderPrivate)
- {
-+#if defined(STRICT_XSRC_NETBSD)
-+ swrast_put_image2(driDrawable, op, x, y, width, height,
-+ width * 4, data, loaderPrivate);
-+#else
- return swrast_put_image2(driDrawable, op, x, y, width, height,
- width * 4, data, loaderPrivate);
-+#endif
- }
-
- static void
diff --git a/MesaLib-dfbsd/patches/patch-src_glx_Makefile.am b/MesaLib-dfbsd/patches/patch-src_glx_Makefile.am
deleted file mode 100644
index 8b397f010e..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_glx_Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
-$NetBSD: patch-src_glx_Makefile.am,v 1.3 2019/01/19 23:21:43 tnn Exp $
-
-- We don't need libmesautil.la here. Those symbols seem to already be
- included in libmesa.la.
-- force libtool to use clang++ to link libGL on OSX.
- Otherwise we get:
- Undefined symbols for architecture x86_64:
- "std::terminate()", referenced from:
- ___clang_call_terminate in libglx.a(glsl_parser.o)
- ...
-
---- src/glx/Makefile.am.orig 2019-01-17 11:26:23.000000000 +0000
-+++ src/glx/Makefile.am
-@@ -89,10 +89,16 @@ libglx_la_SOURCES = \
- singlepix.c \
- vertarr.c
-
-+if HAVE_APPLEDRI
-+libglx_la_LIBADD = \
-+ $(top_builddir)/src/loader/libloader.la \
-+ $(top_builddir)/src/util/libxmlconfig.la
-+else
- libglx_la_LIBADD = \
- $(top_builddir)/src/loader/libloader.la \
- $(top_builddir)/src/util/libmesautil.la \
- $(top_builddir)/src/util/libxmlconfig.la
-+endif
-
- if HAVE_DRISW
- libglx_la_SOURCES += \
-@@ -136,6 +142,7 @@ libglx_la_SOURCES += \
-
- SUBDIRS += apple
- libglx_la_LIBADD += $(builddir)/apple/libappleglx.la
-+libglx_la_LIBADD += $(top_builddir)/src/mesa/libmesa.la
- endif
-
- if HAVE_WINDOWSDRI
-@@ -187,6 +194,10 @@ lib@GL_LIB@_la_SOURCES =
- lib@GL_LIB@_la_LIBADD = $(GL_LIBS)
- lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS)
-
-+if HAVE_APPLEDRI
-+lib@GL_LIB@_la_SOURCES += apple_dummy.cpp
-+endif
-+
- if HAVE_WINDOWSDRI
- lib@GL_LIB@_la_LDFLAGS += -lgdi32 -lopengl32 -Wl,--disable-stdcall-fixup
- endif
diff --git a/MesaLib-dfbsd/patches/patch-src_glx_apple_apple__glapi.c b/MesaLib-dfbsd/patches/patch-src_glx_apple_apple__glapi.c
deleted file mode 100644
index fa323569e3..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_glx_apple_apple__glapi.c
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-src_glx_apple_apple__glapi.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-https://bugs.freedesktop.org/show_bug.cgi?id=90311
-See also hacks.mk.
-
---- src/glx/apple/apple_glapi.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/glx/apple/apple_glapi.c
-@@ -39,6 +39,7 @@
- #include <GL/gl.h>
-
- #include "main/glheader.h"
-+#include "main/remap.h"
- #include "glapi.h"
- #include "glapitable.h"
-
-@@ -53,6 +54,8 @@ static void _apple_glapi_create_table(vo
- if (__applegl_api)
- return;
-
-+ _mesa_init_remap_table();
-+
- __ogl_framework_api = _glapi_create_table_from_handle(apple_cgl_get_dl_handle(), "gl");
- assert(__ogl_framework_api);
-
diff --git a/MesaLib-dfbsd/patches/patch-src_glx_dri__common.h b/MesaLib-dfbsd/patches/patch-src_glx_dri__common.h
deleted file mode 100644
index 46647b3cf6..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_glx_dri__common.h
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-src_glx_dri__common.h,v 1.1 2019/01/19 21:54:03 tnn Exp $
-
-Fix error on OSX.
-
---- src/glx/dri_common.h.orig 2019-01-17 11:26:23.000000000 +0000
-+++ src/glx/dri_common.h
-@@ -55,8 +55,10 @@ extern struct glx_config *driConvertConf
-
- extern void driDestroyConfigs(const __DRIconfig **configs);
-
-+#if !defined(GLX_USE_APPLEGL)
- extern __GLXDRIdrawable *
- driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable);
-+#endif
-
- extern void
- driReleaseDrawables(struct glx_context *gc);
diff --git a/MesaLib-dfbsd/patches/patch-src_glx_dri__glx.c b/MesaLib-dfbsd/patches/patch-src_glx_dri__glx.c
deleted file mode 100644
index 3bfc863be7..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_glx_dri__glx.c
+++ /dev/null
@@ -1,43 +0,0 @@
-$NetBSD: patch-src_glx_dri__glx.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-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/glx/dri_glx.c.orig 2018-01-18 21:30:28.000000000 +0000
-+++ src/glx/dri_glx.c
-@@ -183,9 +183,21 @@ static struct driver_config_entry *drive
- /* Called as an atexit function. Otherwise, this would have to be called with
- * driver_config_mutex locked.
- */
-+#if defined(HAVE_NOATEXIT)
-+static Bool e_next_ever_null = False;
-+
-+static void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- clear_driver_config_cache()
- {
-+
-+#if defined(HAVE_NOATEXIT)
-+ if (!e_next_ever_null)
-+ return;
-+#endif
-+
- while (driver_config_cache) {
- struct driver_config_entry *e = driver_config_cache;
- driver_config_cache = e->next;
-@@ -276,7 +288,11 @@ glXGetDriverConfig(const char *driverNam
- driver_config_cache = e;
-
- if (!e->next)
-+#if defined(HAVE_NOATEXIT)
-+ e_next_ever_null = True;
-+#else
- atexit(clear_driver_config_cache);
-+#endif
-
- out:
- pthread_mutex_unlock(&driver_config_mutex);
diff --git a/MesaLib-dfbsd/patches/patch-src_glx_glxclient.h b/MesaLib-dfbsd/patches/patch-src_glx_glxclient.h
deleted file mode 100644
index 55908db8b8..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_glx_glxclient.h
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_glx_glxclient.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-NetBSD only supports zero-initialized initial-exec tls variables in conjuction
-with dlopen(3) at the moment.
-
---- src/glx/glxclient.h.orig 2017-02-13 11:55:49.000000000 +0000
-+++ src/glx/glxclient.h
-@@ -661,7 +661,11 @@ extern void __glXSetCurrentContext(struc
- extern __thread void *__glX_tls_Context
- __attribute__ ((tls_model("initial-exec")));
-
-+#if defined(NO_INITIAL_EXEC_NONNULL)
-+# define __glXGetCurrentContext() (likely(__glX_tls_Context) ? __glX_tls_Context : (void*)&dummyContext)
-+#else
- # define __glXGetCurrentContext() __glX_tls_Context
-+#endif
-
- # else
-
diff --git a/MesaLib-dfbsd/patches/patch-src_glx_glxcurrent.c b/MesaLib-dfbsd/patches/patch-src_glx_glxcurrent.c
deleted file mode 100644
index adaacdd206..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_glx_glxcurrent.c
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-src_glx_glxcurrent.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Interim fix for toolchain/50277.
-
-NetBSD only supports zero-initialized initial-exec tls variables in conjuction
-with dlopen(3) at the moment.
-
---- src/glx/glxcurrent.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/glx/glxcurrent.c
-@@ -40,6 +40,18 @@
- #include "glx_error.h"
-
- /*
-+ * MASSIVE KLUDGE!
-+ * We need these to not be extern in libGL.so because of
-+ * PR toolchain/50277
-+ */
-+#if defined(GLX_USE_TLS) && defined(NO_INITIAL_EXEC_NONNULL)
-+_X_EXPORT __thread struct _glapi_table * _glapi_tls_Dispatch
-+ __attribute__((tls_model("initial-exec"))) = NULL;
-+_X_EXPORT __thread void * _glapi_tls_Context
-+ __attribute__((tls_model("initial-exec")));
-+#endif
-+
-+/*
- ** We setup some dummy structures here so that the API can be used
- ** even if no context is current.
- */
-@@ -77,7 +89,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(NO_INITIAL_EXEC_NONNULL)
-+ = NULL; /* non-zero initializers not supported with dlopen */
-+#else
- = &dummyContext;
-+#endif
-
- _X_HIDDEN void
- __glXSetCurrentContext(struct glx_context * c)
diff --git a/MesaLib-dfbsd/patches/patch-src_glx_glxext.c b/MesaLib-dfbsd/patches/patch-src_glx_glxext.c
deleted file mode 100644
index af8f679e4d..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_glx_glxext.c
+++ /dev/null
@@ -1,47 +0,0 @@
-$NetBSD: patch-src_glx_glxext.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Patch from FreeBSD ports graphics/mesa-dri 18.0.0
-
-# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
-
-* Extended to DragonFly and NetBSD. Other OSes might need this as well.
-
-* Added logging statements to note dri3 initialization being invoked.
-
---- src/glx/glxext.c.orig 2017-12-08 13:49:11.000000000 +0000
-+++ src/glx/glxext.c
-@@ -55,6 +55,7 @@
- #include <xcb/xcb.h>
- #include <xcb/glx.h>
-
-+#include "dri_common.h"
-
- #ifdef DEBUG
- void __glXDumpDrawBuffer(struct glx_context * ctx);
-@@ -817,7 +818,11 @@ AllocAndFetchScreenConfigs(Display * dpy
- #if defined(GLX_USE_DRM)
- #if defined(HAVE_DRI3)
- if (priv->dri3Display)
-+ InfoMessageF("glxext.c: AllocAndFetchScreenConfigs: priv->dri3Display\n");
-+ if (priv->dri3Display)
- psc = (*priv->dri3Display->createScreen) (i, priv);
-+ if (psc != NULL && priv->dri3Display)
-+ InfoMessageF("glxext.c: AllocAndFetchScreenConfigs: psc set by priv->dri3Display\n");
- #endif /* HAVE_DRI3 */
- if (psc == NULL && priv->dri2Display)
- psc = (*priv->dri2Display->createScreen) (i, priv);
-@@ -920,8 +925,13 @@ __glXInitialize(Display * dpy)
- #if defined(GLX_USE_DRM)
- if (glx_direct && glx_accel) {
- #if defined(HAVE_DRI3)
-- if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
-+#if ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)) || defined(TEST_DRI3_ENABLE)
-+ if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false))
-+#endif
-+ if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false)) {
-+ InfoMessageF("glxext.c: __glxInitialize: dpyPriv->dri3Display = dri3_create_display\n");
- dpyPriv->dri3Display = dri3_create_display(dpy);
-+ }
- #endif /* HAVE_DRI3 */
- dpyPriv->dri2Display = dri2CreateDisplay(dpy);
- dpyPriv->driDisplay = driCreateDisplay(dpy);
diff --git a/MesaLib-dfbsd/patches/patch-src_intel_Makefile.tools.am b/MesaLib-dfbsd/patches/patch-src_intel_Makefile.tools.am
deleted file mode 100644
index cc2f67a2dc..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_intel_Makefile.tools.am
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-src_intel_Makefile.tools.am,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
--lrt for shm_open in aubinator.c, a more portable alternative to memfd_create
-
---- src/intel/Makefile.tools.am.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/intel/Makefile.tools.am
-@@ -43,6 +43,7 @@ tools_aubinator_LDADD = \
- $(PTHREAD_LIBS) \
- $(DLOPEN_LIBS) \
- $(ZLIB_LIBS) \
-+ -lrt \
- -lm
-
-
diff --git a/MesaLib-dfbsd/patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp b/MesaLib-dfbsd/patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
deleted file mode 100644
index da81a98c10..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-src_intel_compiler_brw__fs__bank__conflicts.cpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-FreeBSD Bugzilla: Bug 225415 graphics/mesa-dri: update to 18.0.0
-
-compiler/brw_fs_bank_conflicts.cpp:719:25: error: scalar initializer cannot be empty
- vector_type s_p = {}, s_n = {};
- ^~
-compiler/brw_fs_bank_conflicts.cpp:719:35: error: scalar initializer cannot be empty
- vector_type s_p = {}, s_n = {};
- ^~
-
---- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/intel/compiler/brw_fs_bank_conflicts.cpp
-@@ -716,7 +716,7 @@ namespace {
- const weight_vector_type &conflicts)
- {
- const unsigned m = DIV_ROUND_UP(conflicts.size, vector_width);
-- vector_type s_p = {}, s_n = {};
-+ vector_type s_p = {0}, s_n = {0};
-
- for (unsigned r = 0; r < m; r++) {
- s_p = adds(s_p, mask(bank_mask_p.v[r], conflicts.v[r]));
diff --git a/MesaLib-dfbsd/patches/patch-src_intel_tools_aub__mem.c b/MesaLib-dfbsd/patches/patch-src_intel_tools_aub__mem.c
deleted file mode 100644
index eeac52b416..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_intel_tools_aub__mem.c
+++ /dev/null
@@ -1,43 +0,0 @@
-$NetBSD: patch-src_intel_tools_aub__mem.c,v 1.2 2019/05/01 19:31:46 maya Exp $
-
-* Partially implement memfd_create() via mkostemp()
-
---- src/intel/tools/aub_mem.c.orig 2018-12-11 21:13:57.000000000 +0000
-+++ src/intel/tools/aub_mem.c
-@@ -30,11 +30,36 @@
-
- #ifndef HAVE_MEMFD_CREATE
- #include <sys/syscall.h>
-+#if defined(__FreeBSD__)
-+#include <fcntl.h>
-+#endif
-
- static inline int
- memfd_create(const char *name, unsigned int flags)
- {
-+#if defined(SYS_memfd_create)
- return syscall(SYS_memfd_create, name, flags);
-+#elif defined(__FreeBSD__)
-+ return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600);
-+#else /* DragonFly, NetBSD, OpenBSD, Solaris */
-+ char template[] = "/tmp/shmfd-XXXXXX";
-+#ifdef HAVE_MKOSTEMP
-+ int fd = mkostemp(template, flags);
-+#else
-+ int fd = mkstemp(template);
-+ if (flags & O_CLOEXEC) {
-+ int flags = fcntl(fd, F_GETFD);
-+ if (flags != -1) {
-+ flags |= FD_CLOEXEC;
-+ (void) fcntl(fd, F_SETFD, &flags);
-+ }
-+ }
-+#endif /* HAVE_MKOSTEMP */
-+ if (fd >= 0)
-+ unlink(template);
-+
-+ return fd;
-+#endif /* __linux__ */
- }
- #endif
-
diff --git a/MesaLib-dfbsd/patches/patch-src_intel_tools_aubinator__error__decode.c b/MesaLib-dfbsd/patches/patch-src_intel_tools_aubinator__error__decode.c
deleted file mode 100644
index f35b477226..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_intel_tools_aubinator__error__decode.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_intel_tools_aubinator__error__decode.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Patch from FreeBSD ports graphics/mesa-dri 17.1.0
-
-# expose getline in FreeBSD's stdio.h
-#
-
---- src/intel/tools/aubinator_error_decode.c.orig 2017-05-25 07:13:13.000000000 +0000
-+++ src/intel/tools/aubinator_error_decode.c
-@@ -22,6 +22,9 @@
- *
- */
-
-+#if defined(__FreeBSD__) && __FreeBSD__ < 12
-+#define _WITH_GETLINE
-+#endif
- #include <stdbool.h>
- #include <stdio.h>
- #include <stdlib.h>
diff --git a/MesaLib-dfbsd/patches/patch-src_intel_tools_error2aub.c b/MesaLib-dfbsd/patches/patch-src_intel_tools_error2aub.c
deleted file mode 100644
index 021e598a4f..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_intel_tools_error2aub.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD$
-
-Patch from FreeBSD ports graphics/mesa-dri 18.2.0
-
-# expose getline in FreeBSD's stdio.h
-#
-
---- src/intel/tools/error2aub.c.orig 2018-08-09 00:34:30.000000000 +0000
-+++ src/intel/tools/error2aub.c
-@@ -26,6 +26,9 @@
- #include <getopt.h>
- #include <inttypes.h>
- #include <signal.h>
-+#if defined(__FreeBSD__) && __FreeBSD__ < 12
-+#define _WITH_GETLINE
-+#endif
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
diff --git a/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__allocator.c b/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__allocator.c
deleted file mode 100644
index c9702282c4..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__allocator.c
+++ /dev/null
@@ -1,62 +0,0 @@
-$NetBSD: patch-src_intel_vulkan_anv__allocator.c,v 1.2 2019/05/01 19:31:46 maya Exp $
-
-* Partially implement memfd_create() via mkostemp()
-* Ignore MAP_POPULATE if unsupported
-
-FreeBSD Bugzilla - Bug 225415: graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
---- src/intel/vulkan/anv_allocator.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/intel/vulkan/anv_allocator.c
-@@ -25,9 +25,21 @@
- #include <unistd.h>
- #include <limits.h>
- #include <assert.h>
-+#ifdef __linux__
- #include <linux/memfd.h>
-+#else
-+#include <fcntl.h>
-+#endif
- #include <sys/mman.h>
-
-+#ifndef MAP_POPULATE
-+#define MAP_POPULATE 0
-+#endif
-+
-+#ifndef MFD_CLOEXEC
-+#define MFD_CLOEXEC O_CLOEXEC
-+#endif
-+
- #include "anv_private.h"
-
- #include "util/hash_table.h"
-@@ -113,7 +125,29 @@ struct anv_mmap_cleanup {
- static inline int
- memfd_create(const char *name, unsigned int flags)
- {
-+#if defined(SYS_memfd_create)
- return syscall(SYS_memfd_create, name, flags);
-+#elif defined(__FreeBSD__)
-+ return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600);
-+#else /* DragonFly, NetBSD, OpenBSD, Solaris */
-+ char template[] = "/tmp/shmfd-XXXXXX";
-+#ifdef HAVE_MKOSTEMP
-+ int fd = mkostemp(template, flags);
-+#else
-+ int fd = mkstemp(template);
-+ if (flags & O_CLOEXEC) {
-+ int flags = fcntl(fd, F_GETFD);
-+ if (flags != -1) {
-+ flags |= FD_CLOEXEC;
-+ (void) fcntl(fd, F_SETFD, &flags);
-+ }
-+ }
-+#endif /* HAVE_MKOSTEMP */
-+ if (fd >= 0)
-+ unlink(template);
-+
-+ return fd;
-+#endif /* __linux__ */
- }
- #endif
-
diff --git a/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__device.c b/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__device.c
deleted file mode 100644
index 8b05296a0b..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__device.c
+++ /dev/null
@@ -1,61 +0,0 @@
-$NetBSD: patch-src_intel_vulkan_anv__device.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Without sysinfo() fall back to sysconf()
-* Define ETIME if missing
-
-FreeBSD Bugzilla - Bug 225415: graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
-https://reviews.freebsd.org/D17872
-
-* Define CLOCK_MONOTONIC_RAW if missing
-
---- src/intel/vulkan/anv_device.c.orig 2018-12-11 21:13:57.000000000 +0000
-+++ src/intel/vulkan/anv_device.c
-@@ -25,7 +25,9 @@
- #include <stdbool.h>
- #include <string.h>
- #include <sys/mman.h>
-+#ifdef __GLIBC__
- #include <sys/sysinfo.h>
-+#endif
- #include <unistd.h>
- #include <fcntl.h>
- #include <xf86drm.h>
-@@ -44,6 +46,17 @@
-
- #include "genxml/gen7_pack.h"
-
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
-+#ifndef CLOCK_MONOTONIC_RAW
-+# ifdef CLOCK_MONOTONIC_FAST
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
-+# else
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
-+# endif
-+#endif
-+
- static void
- compiler_debug_log(void *data, const char *fmt, ...)
- { }
-@@ -64,10 +77,18 @@ static VkResult
- anv_compute_heap_size(int fd, uint64_t gtt_size, uint64_t *heap_size)
- {
- /* Query the total ram from the system */
-+#ifdef __GLIBC__
- struct sysinfo info;
- sysinfo(&info);
-
- uint64_t total_ram = (uint64_t)info.totalram * (uint64_t)info.mem_unit;
-+#else
-+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
-+ uint64_t total_ram = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
-+#else
-+ uint64_t total_ram = sysctlbyname(SYSCTL_MEMSIZE, &mem, &size, nullptr, 0);
-+#endif
-+#endif
-
- /* We don't want to burn too much ram with the GPU. If the user has 4GiB
- * or less, we use at most half. If they have more than 4GiB, we use 3/4.
diff --git a/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__gem.c b/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__gem.c
deleted file mode 100644
index aa6716cc1a..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__gem.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_intel_vulkan_anv__gem.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Define ETIME if missing
-
-FreeBSD Bugzilla - Bug 225415: graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
---- src/intel/vulkan/anv_gem.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/intel/vulkan/anv_gem.c
-@@ -26,6 +26,9 @@
- #include <sys/mman.h>
- #include <string.h>
- #include <errno.h>
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
- #include <unistd.h>
- #include <fcntl.h>
-
diff --git a/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__gem__stubs.c b/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__gem__stubs.c
deleted file mode 100644
index 8f57f1b9bc..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__gem__stubs.c
+++ /dev/null
@@ -1,36 +0,0 @@
-$NetBSD: patch-src_intel_vulkan_anv__gem__stubs.c,v 1.2 2019/05/01 19:31:46 maya Exp $
-
-* Partially implement memfd_create() via mkostemp()
-
---- src/intel/vulkan/anv_gem_stubs.c.orig 2018-12-11 21:13:57.000000000 +0000
-+++ src/intel/vulkan/anv_gem_stubs.c
-@@ -31,7 +31,29 @@
- static inline int
- memfd_create(const char *name, unsigned int flags)
- {
-+#if defined(SYS_memfd_create)
- return syscall(SYS_memfd_create, name, flags);
-+#elif defined(__FreeBSD__)
-+ return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600);
-+#else /* DragonFly, NetBSD, OpenBSD, Solaris */
-+ char template[] = "/tmp/shmfd-XXXXXX";
-+#ifdef HAVE_MKOSTEMP
-+ int fd = mkostemp(template, flags);
-+#else
-+ int fd = mkstemp(template);
-+ if (flags & O_CLOEXEC) {
-+ int flags = fcntl(fd, F_GETFD);
-+ if (flags != -1) {
-+ flags |= FD_CLOEXEC;
-+ (void) fcntl(fd, F_SETFD, &flags);
-+ }
-+ }
-+#endif /* HAVE_MKOSTEMP */
-+ if (fd >= 0)
-+ unlink(template);
-+
-+ return fd;
-+#endif /* __linux__ */
- }
- #endif
-
diff --git a/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__queue.c b/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__queue.c
deleted file mode 100644
index 5be2fd92e2..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_intel_vulkan_anv__queue.c
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-src_intel_vulkan_anv__queue.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Define ETIME if missing
-* Drop header that was never used (modified for Linux inclusion)
-
-FreeBSD Bugzilla - Bug 225415: graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
---- src/intel/vulkan/anv_queue.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/intel/vulkan/anv_queue.c
-@@ -26,8 +26,14 @@
- */
-
- #include <fcntl.h>
-+#include <errno.h>
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
- #include <unistd.h>
-+#if defined(__linux__)
- #include <sys/eventfd.h>
-+#endif
-
- #include "anv_private.h"
- #include "vk_util.h"
diff --git a/MesaLib-dfbsd/patches/patch-src_mapi_entry__x86-64__tls.h b/MesaLib-dfbsd/patches/patch-src_mapi_entry__x86-64__tls.h
deleted file mode 100644
index 44ac37d49d..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mapi_entry__x86-64__tls.h
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-src_mapi_entry__x86-64__tls.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-NetBSD only supports zero-initialized initial-exec tls variables in conjuction
-with dlopen(3) at the moment.
-
-Fix --enable-glx-tls with clang. From FreeBSD.
-
-table_noop_array is only defined for shared-glapi.
-es1api and es2api are not going to be patched for NetBSD.
-
---- src/mapi/entry_x86-64_tls.h.orig 2017-11-20 14:25:47.000000000 +0000
-+++ src/mapi/entry_x86-64_tls.h
-@@ -43,10 +43,19 @@ __asm__(".text\n"
-
- #ifndef __ILP32__
-
-+#if defined(NO_INITIAL_EXEC_NONNULL) && defined(MAPI_MODE_GLAPI)
- #define STUB_ASM_CODE(slot) \
- "movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \
- "movq %fs:(%rax), %r11\n\t" \
-+ "testq %r11, %r11\n\t" \
-+ "cmoveq table_noop_array@GOTPCREL(%rip), %r11\n\t" \
- "jmp *(8 * " slot ")(%r11)"
-+#else
-+#define STUB_ASM_CODE(slot) \
-+ "movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \
-+ "movq %fs:(%rax), %r11\n\t" \
-+ "jmp *(8 * " slot ")(%r11)"
-+#endif
-
- #else
-
diff --git a/MesaLib-dfbsd/patches/patch-src_mapi_entry__x86__tls.h b/MesaLib-dfbsd/patches/patch-src_mapi_entry__x86__tls.h
deleted file mode 100644
index 4671b9e42d..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mapi_entry__x86__tls.h
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-src_mapi_entry__x86__tls.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-NetBSD only supports zero-initialized initial-exec tls variables in conjuction
-with dlopen(3) at the moment.
-
-Fix --enable-glx-tls with clang. From FreeBSD.
-
-table_noop_array is only defined for shared-glapi.
-es1api and es2api are not going to be patched for NetBSD.
-
---- src/mapi/entry_x86_tls.h.orig 2018-01-18 21:30:29.000000000 +0000
-+++ src/mapi/entry_x86_tls.h
-@@ -56,10 +56,27 @@ __asm__(".balign 16\n"
- ".balign 16\n" \
- func ":"
-
-+#if defined(NO_INITIAL_EXEC_NONNULL) && defined(MAPI_MODE_GLAPI)
-+extern const mapi_func table_noop_array[];
- #define STUB_ASM_CODE(slot) \
- "call x86_current_tls\n\t" \
- "movl %gs:(%eax), %eax\n\t" \
-+ "testl %eax, %eax\n\t" \
-+ "je 1f\n\t" \
-+ "jmp *(4 * " slot ")(%eax)\n\t" \
-+ "1:\n\t" \
-+ "call 2f\n" \
-+ "2:\n\t" \
-+ "popl %eax\n\t" \
-+ "addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax\n\t" \
-+ "movl table_noop_array@GOT(%eax), %eax\n\t" \
- "jmp *(4 * " slot ")(%eax)"
-+#else
-+#define STUB_ASM_CODE(slot) \
-+ "call x86_current_tls\n\t" \
-+ "movl %gs:(%eax), %eax\n\t" \
-+ "jmp *(4 * " slot ")(%eax)"
-+#endif
-
- #define MAPI_TMP_STUB_ASM_GCC
- #include "mapi_tmp.h"
diff --git a/MesaLib-dfbsd/patches/patch-src_mapi_glapi_gen_gl__gentable.py b/MesaLib-dfbsd/patches/patch-src_mapi_glapi_gen_gl__gentable.py
deleted file mode 100644
index 4145993160..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mapi_glapi_gen_gl__gentable.py
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-src_mapi_glapi_gen_gl__gentable.py,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-FreeBSD support.
-
---- src/mapi/glapi/gen/gl_gentable.py.orig 2017-02-13 11:55:49.000000000 +0000
-+++ src/mapi/glapi/gen/gl_gentable.py
-@@ -44,7 +44,7 @@ header = """/* GLXEXT is the define used
- #endif
-
- #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
-- || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__))
-+ || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__))
- #define USE_BACKTRACE
- #endif
-
diff --git a/MesaLib-dfbsd/patches/patch-src_mapi_u__current.c b/MesaLib-dfbsd/patches/patch-src_mapi_u__current.c
deleted file mode 100644
index 27f505d9ad..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mapi_u__current.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-src_mapi_u__current.c,v 1.1 2018/10/07 23:49:31 ryoon 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 _glapi_table *u_current_table
- __attribute__((tls_model("initial-exec")))
-+#if defined(NO_INITIAL_EXEC_NONNULL)
-+ = NULL; /* non-zero initializers not supported with dlopen */
-+#else
- = (struct _glapi_table *) table_noop_array;
-+#endif
-
- __thread void *u_current_context
- __attribute__((tls_model("initial-exec")));
-@@ -283,7 +287,11 @@ struct _glapi_table *
- u_current_get_table_internal(void)
- {
- #if defined(GLX_USE_TLS)
-+# if defined(NO_INITIAL_EXEC_NONNULL)
-+ return (likely(u_current_table) ? u_current_table : (struct _glapi_table *) table_noop_array);
-+# else
- return u_current_table;
-+# endif
- #else
- if (ThreadSafe)
- return (struct _glapi_table *) tss_get(u_current_table_tsd);
diff --git a/MesaLib-dfbsd/patches/patch-src_mapi_u__current.h b/MesaLib-dfbsd/patches/patch-src_mapi_u__current.h
deleted file mode 100644
index 8b393394a4..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mapi_u__current.h
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-src_mapi_u__current.h,v 1.1 2018/10/07 23:49:31 ryoon 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 _glapi_table *
- u_current_get_table(void)
- {
--#ifdef GLX_USE_TLS
-+#if defined(GLX_USE_TLS) && !defined(NO_INITIAL_EXEC_NONNULL)
- return u_current_table;
- #else
- return (likely(u_current_table) ?
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i915_intel__screen.c b/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i915_intel__screen.c
deleted file mode 100644
index ebb4850734..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i915_intel__screen.c
+++ /dev/null
@@ -1,44 +0,0 @@
-$NetBSD: patch-src_mesa_drivers_dri_i915_intel__screen.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Move sys/sysctl.h include because on NetBSD, sysctl.h includes sys/param.h,
-and sys/param.h defines a one argument ALIGN. Allows mesa to redefine
-to a two argument ALIGN.
-
-Fix build on older NetBSD w/o _SC_PHYS_PAGES.
-
---- src/mesa/drivers/dri/i915/intel_screen.c.orig 2017-11-10 23:18:56.000000000 +0000
-+++ src/mesa/drivers/dri/i915/intel_screen.c
-@@ -28,6 +28,11 @@
- #include <errno.h>
- #include <time.h>
- #include <unistd.h>
-+
-+#if defined(HAVE_SYS_SYSCTL_H) && defined(PHYSMEM_NETBSD)
-+# include <sys/sysctl.h>
-+#endif
-+
- #include "main/glheader.h"
- #include "main/context.h"
- #include "main/framebuffer.h"
-@@ -739,6 +744,13 @@ i915_query_renderer_integer(__DRIscreen
- const unsigned gpu_mappable_megabytes =
- (aper_size / (1024 * 1024)) * 3 / 4;
-
-+#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);
-+ if (sysctl(mib, 2, &system_memory_bytes, &len, NULL, 0) != 0)
-+ return -1;
-+#else
- const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
- const long system_page_size = sysconf(_SC_PAGE_SIZE);
-
-@@ -747,6 +759,7 @@ i915_query_renderer_integer(__DRIscreen
-
- const uint64_t system_memory_bytes = (uint64_t) system_memory_pages
- * (uint64_t) system_page_size;
-+#endif
-
- const unsigned system_memory_megabytes =
- (unsigned) (system_memory_bytes / (1024 * 1024));
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c b/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c
deleted file mode 100644
index d04c4ee68a..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD$
-
-From Ravenports
-
-graphics/mesa-dri: Disable soft-spinning of all buffers (#169)
-
-* It is broken with current DragonFly 5.4 and 5.5 kernels
-
-* This patch is a revert of Mesa's
-commit: a363bb2cd0e2a141f2c60be005009703bffcbe4e
-"i965: Allocate VMA in userspace for full-PPGTT systems."
-Date: Tue Apr 10 01:18:25 2018 -0700
-
-Discussion in
-
-https://bugs.dragonflybsd.org/issues/3171
-
---- src/mesa/drivers/dri/i965/brw_bufmgr.c.orig 2019-05-03 15:59:12.000000000 +0000
-+++ src/mesa/drivers/dri/i965/brw_bufmgr.c
-@@ -1721,7 +1721,11 @@ brw_bufmgr_init(struct gen_device_info *
- bufmgr->initial_kflags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
-
- /* Allocate VMA in userspace if we have softpin and full PPGTT. */
-+#if defined(REVERT_I965_SOFTPIN)
-+ if (false && gem_param(fd, I915_PARAM_HAS_EXEC_SOFTPIN) > 0 &&
-+#else
- if (gem_param(fd, I915_PARAM_HAS_EXEC_SOFTPIN) > 0 &&
-+#endif
- gem_param(fd, I915_PARAM_HAS_ALIASING_PPGTT) > 1) {
- bufmgr->initial_kflags |= EXEC_OBJECT_PINNED;
-
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c b/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c
deleted file mode 100644
index 7ce4a377cc..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c,v 1.1 2019/01/10 22:30:11 tnn Exp $
-
-XXX compilation takes forever with clang 7.0
-
---- src/mesa/drivers/dri/i965/brw_oa_metrics.c.orig 2018-12-11 21:14:35.000000000 +0000
-+++ src/mesa/drivers/dri/i965/brw_oa_metrics.c
-@@ -1,3 +1,6 @@
-+#if defined(__clang__)
-+#pragma clang optimize off
-+#endif
- /* Autogenerated file, DO NOT EDIT manually! generated by brw_oa.py
- *
- * Copyright (c) 2015 Intel Corporation
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__performance__query.c b/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__performance__query.c
deleted file mode 100644
index 2511b9da14..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_brw__performance__query.c
+++ /dev/null
@@ -1,72 +0,0 @@
-$NetBSD: patch-src_mesa_drivers_dri_i965_brw__performance__query.c,v 1.2 2018/10/16 15:21:20 jperkin Exp $
-
-Prevents libdrm i915_drm.h header from being used.
-libdrm 2.4.88 does not have certain symbols defined in its i915_drm.h.
-
---- src/mesa/drivers/dri/i965/brw_performance_query.c.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/mesa/drivers/dri/i965/brw_performance_query.c
-@@ -56,7 +56,7 @@
- #include <sys/ioctl.h>
-
- #include <xf86drm.h>
--#include <i915_drm.h>
-+#include "drm-uapi/i915_drm.h"
-
- #include "main/hash.h"
- #include "main/macros.h"
-@@ -1796,6 +1796,9 @@ enumerate_sysfs_metrics(struct brw_conte
- DIR *metricsdir = NULL;
- struct dirent *metric_entry;
- int len;
-+#ifdef __sun
-+ struct stat s;
-+#endif
-
- len = snprintf(buf, sizeof(buf), "%s/metrics", brw->perfquery.sysfs_dev_dir);
- if (len < 0 || len >= sizeof(buf)) {
-@@ -1812,10 +1815,18 @@ enumerate_sysfs_metrics(struct brw_conte
- while ((metric_entry = readdir(metricsdir))) {
- struct hash_entry *entry;
-
-+#if defined(__sun)
-+ stat(metric_entry->d_name, &s);
-+ if ((s.st_mode != S_IFDIR &&
-+ s.st_mode != S_IFLNK) ||
-+ metric_entry->d_name[0] == '.')
-+ continue;
-+#else
- if ((metric_entry->d_type != DT_DIR &&
- metric_entry->d_type != DT_LNK) ||
- metric_entry->d_name[0] == '.')
- continue;
-+#endif
-
- DBG("metric set: %s\n", metric_entry->d_name);
- entry = _mesa_hash_table_search(brw->perfquery.oa_metrics_table,
-@@ -2057,6 +2068,9 @@ get_sysfs_dev_dir(struct brw_context *br
- DIR *drmdir;
- struct dirent *drm_entry;
- int len;
-+#ifdef __sun
-+ struct stat s;
-+#endif
-
- brw->perfquery.sysfs_dev_dir[0] = '\0';
-
-@@ -2088,9 +2102,16 @@ get_sysfs_dev_dir(struct brw_context *br
- }
-
- while ((drm_entry = readdir(drmdir))) {
-+#if defined(__sun)
-+ stat(drm_entry->d_name, &s);
-+ if ((s.st_mode == S_IFDIR ||
-+ s.st_mode == S_IFLNK) &&
-+ strncmp(drm_entry->d_name, "card", 4) == 0)
-+#else
- if ((drm_entry->d_type == DT_DIR ||
- drm_entry->d_type == DT_LNK) &&
- strncmp(drm_entry->d_name, "card", 4) == 0)
-+#endif
- {
- len = snprintf(brw->perfquery.sysfs_dev_dir,
- sizeof(brw->perfquery.sysfs_dev_dir),
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_intel__screen.c b/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_intel__screen.c
deleted file mode 100644
index 4b9bb6484a..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_intel__screen.c
+++ /dev/null
@@ -1,81 +0,0 @@
-$NetBSD: patch-src_mesa_drivers_dri_i965_intel__screen.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Move sys/sysctl.h include because on NetBSD, sysctl.h includes sys/param.h,
-and sys/param.h defines a one argument ALIGN. Allows mesa to redefine
-to a two argument ALIGN.
-
-Fix build on older NetBSD w/o _SC_PHYS_PAGES.
-
-From FreeBSD ports graphics/mesa-dri 18.1.4
-
-# Partial revert of the following commit because the feature check fails on 10.x
-# which disables HW accel on gen4+ (the new check occurs for gen6+ as well)
-
-From 088449487ebcb72561d73ffb91c96302583445a8 Mon Sep 17 00:00:00 2001
-Date: Wed, 22 Mar 2017 15:20:51 -0700
-Subject: i965: Require Kernel 3.6 for Gen4-5 platforms.
-
-We've already required Kernel 3.6 on Gen6+ since Mesa 9.2 (May 2013,
-commit 92d2f5acfadea672417b6785710c9e8b7f605e41). It seems reasonable
-to require it for Gen4-5 as well, bumping the requirement from 2.6.39.
-
-This is necessary for glClientWaitSync with a timeout to work, which
-is a feature we expose on Gen4-5. Without it, we would fall back to an
-infinite wait, which is pretty bad.
-
-See kernel commit 172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+.
-
---- src/mesa/drivers/dri/i965/intel_screen.c.orig 2017-11-10 23:18:56.000000000 +0000
-+++ src/mesa/drivers/dri/i965/intel_screen.c
-@@ -27,6 +27,11 @@
- #include <errno.h>
- #include <time.h>
- #include <unistd.h>
-+
-+#if defined(HAVE_SYS_SYSCTL_H) && defined(PHYSMEM_NETBSD)
-+# include <sys/sysctl.h>
-+#endif
-+
- #include "main/context.h"
- #include "main/framebuffer.h"
- #include "main/renderbuffer.h"
-@@ -1470,6 +1475,13 @@ brw_query_renderer_integer(__DRIscreen *
- const unsigned gpu_mappable_megabytes =
- screen->aperture_threshold / (1024 * 1024);
-
-+#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);
-+ if (sysctl(mib, 2, &system_memory_bytes, &len, NULL, 0) != 0)
-+ return -1;
-+#else
- const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
- const long system_page_size = sysconf(_SC_PAGE_SIZE);
-
-@@ -1478,6 +1490,7 @@ brw_query_renderer_integer(__DRIscreen *
-
- const uint64_t system_memory_bytes = (uint64_t) system_memory_pages
- * (uint64_t) system_page_size;
-+#endif
-
- const unsigned system_memory_megabytes =
- (unsigned) (system_memory_bytes / (1024 * 1024));
-@@ -1840,10 +1853,17 @@ intel_init_bufmgr(struct intel_screen *s
- return false;
- }
-
-+#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;
-+ }
-+#else
- if (!intel_get_boolean(screen, I915_PARAM_HAS_EXEC_NO_RELOC)) {
- fprintf(stderr, "[%s: %u] Kernel 3.9 required.\n", __func__, __LINE__);
- return false;
- }
-+#endif
-
- return true;
- }
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_intel__tiled__memcpy.c b/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_intel__tiled__memcpy.c
deleted file mode 100644
index c89b564bca..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_i965_intel__tiled__memcpy.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-src_mesa_drivers_dri_i965_intel__tiled__memcpy.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-From wip/MesaLib 13.0.1.
-
---- src/mesa/drivers/dri/i965/intel_tiled_memcpy.c.orig 2019-02-18 18:28:16.000000000 +0000
-+++ src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
-@@ -64,6 +64,11 @@ ror(uint32_t n, uint32_t d)
- return (n >> d) | (n << (32 - d));
- }
-
-+#if defined(__NetBSD__)
-+/* Handle conflicting declaration and conflicting macro in netbsd */
-+#undef bswap32
-+#define bswap32(n) __builtin_bswap32(n)
-+#else /* !__NetBSD__ */
- static inline uint32_t
- bswap32(uint32_t n)
- {
-@@ -76,6 +81,7 @@ bswap32(uint32_t n)
- (n << 24);
- #endif
- }
-+#endif /* NetBSD */
-
- /**
- * Copy RGBA to BGRA - swap R and B.
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_swrast_swrast.c b/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_swrast_swrast.c
deleted file mode 100644
index 997e89a030..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_dri_swrast_swrast.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-src_mesa_drivers_dri_swrast_swrast.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Fix build on older NetBSD w/o _SC_PHYS_PAGES.
-
---- src/mesa/drivers/dri/swrast/swrast.c.orig 2017-10-19 12:23:53.000000000 +0000
-+++ src/mesa/drivers/dri/swrast/swrast.c
-@@ -151,6 +151,12 @@ swrast_query_renderer_integer(__DRIscree
- 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(PHYSMEM_NETBSD)
-+ int mib[2] = { CTL_HW, HW_PHYSMEM64 };
-+ uint64_t system_memory_bytes;
-+ size_t len = sizeof(system_memory_bytes);
-+ if (sysctl(mib, 2, &system_memory_bytes, &len, NULL, 0) != 0)
-+ return -1;
- #elif defined(_SC_PHYS_PAGES) && defined(_SC_PAGE_SIZE)
- /* XXX: Do we want to return the full amount of system memory ? */
- const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_x11_Makefile.am b/MesaLib-dfbsd/patches/patch-src_mesa_drivers_x11_Makefile.am
deleted file mode 100644
index 6e9b38bd41..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_drivers_x11_Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-src_mesa_drivers_x11_Makefile.am,v 1.1 2019/01/19 21:54:03 tnn Exp $
-
-We don't need libmesautil.la here. Those symbols seem to already be
-included in libmesa.la.
-
---- src/mesa/drivers/x11/Makefile.am.orig 2019-01-17 11:26:23.000000000 +0000
-+++ src/mesa/drivers/x11/Makefile.am
-@@ -68,7 +68,6 @@ GL_PATCH = 0
- lib@GL_LIB@_la_LIBADD = \
- $(top_builddir)/src/mesa/libmesa.la \
- $(top_builddir)/src/mapi/glapi/libglapi.la \
-- $(top_builddir)/src/util/libmesautil.la \
- $(SHARED_GLAPI_LIB) \
- $(GL_LIB_DEPS)
-
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_main_context.c b/MesaLib-dfbsd/patches/patch-src_mesa_main_context.c
deleted file mode 100644
index 255f0c83ca..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_main_context.c
+++ /dev/null
@@ -1,57 +0,0 @@
-$NetBSD: patch-src_mesa_main_context.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-* Fix exit time segfault of qt5 application with modular xorg
-
-Bug 82246 (atexit) - Libraries should not call atexit()
-
-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
-@@ -354,11 +354,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 void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- one_time_fini(void)
- {
-+#if defined(HAVE_NOATEXIT)
-+ if (api_init_mask) {
-+ _mesa_destroy_shader_compiler();
-+ _mesa_locale_fini();
-+ }
-+#else
- _mesa_destroy_shader_compiler();
- _mesa_locale_fini();
-+#endif
- }
-
- /**
-@@ -373,7 +385,9 @@ one_time_fini(void)
- static void
- one_time_init( struct gl_context *ctx )
- {
-+#if !defined(HAVE_NOATEXIT)
- static GLbitfield api_init_mask = 0x0;
-+#endif
-
- mtx_lock(&OneTimeLock);
-
-@@ -398,7 +412,9 @@ one_time_init( struct gl_context *ctx )
- _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
- }
-
-+#if !defined(HAVE_NOATEXIT)
- atexit(one_time_fini);
-+#endif
-
- #if defined(DEBUG)
- if (MESA_VERBOSE != 0) {
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_main_extensions.c b/MesaLib-dfbsd/patches/patch-src_mesa_main_extensions.c
deleted file mode 100644
index f95e76ba3f..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_main_extensions.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-src_mesa_main_extensions.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-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/mesa/main/extensions.c.orig 2018-02-09 02:17:59.000000000 +0000
-+++ src/mesa/main/extensions.c
-@@ -203,7 +203,11 @@ set_extension(struct gl_extensions *ext,
- * This string is allocated early during the first context creation by
- * _mesa_one_time_init_extension_overrides.
- */
-+#if defined(HAVE_NOATEXIT)
-+static void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- free_unknown_extensions_strings(void)
- {
- free(unrecognized_extensions);
-@@ -293,7 +297,9 @@ _mesa_one_time_init_extension_overrides(
- free(env);
- } else {
- unrecognized_extensions = env;
-+#if !defined(HAVE_NOATEXIT)
- atexit(free_unknown_extensions_strings);
-+#endif
- }
- }
-
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_main_macros.h b/MesaLib-dfbsd/patches/patch-src_mesa_main_macros.h
deleted file mode 100644
index 4c2ab4bb54..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_main_macros.h
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-src_mesa_main_macros.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-ALIGN is also defined in sys/param.h on NetBSD.
-
-Extend undefining ALIGN to all other OSes.
-
---- src/mesa/main/macros.h.orig 2017-11-10 23:18:56.000000000 +0000
-+++ src/mesa/main/macros.h
-@@ -677,6 +677,9 @@ minify(unsigned value, unsigned levels)
- *
- * \sa ROUND_DOWN_TO()
- */
-+#ifdef ALIGN
-+#undef ALIGN
-+#endif
- static inline uintptr_t
- ALIGN(uintptr_t value, int32_t alignment)
- {
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_main_shader__query.cpp b/MesaLib-dfbsd/patches/patch-src_mesa_main_shader__query.cpp
deleted file mode 100644
index 5947beff03..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_main_shader__query.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-$NetBSD: patch-src_mesa_main_shader__query.cpp,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-https://bugs.freedesktop.org/show_bug.cgi?id=66346
-
-From c4a1fec68d2508ff0c4fc2831465aca8c4ca783a Mon Sep 17 00:00:00 2001
-From: Julien Isorce <j.isorce%samsung.com@localhost>
-Date: Wed, 22 Apr 2015 23:04:42 +0100
-Subject: [PATCH 1/2] shader_query: convert GLhandleARB to uintptr_t before
- troncating to GLuint
-
-Fixes compiler error on OSX as GLhandleARB is defined as void* if __APPLE__.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=66346
----
- src/mesa/main/shader_query.cpp | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- src/mesa/main/shader_query.cpp.orig 2016-11-10 22:05:17.000000000 +0000
-+++ src/mesa/main/shader_query.cpp
-@@ -70,7 +70,12 @@ _mesa_BindAttribLocation(GLuint program,
- GET_CURRENT_CONTEXT(ctx);
-
- struct gl_shader_program *const shProg =
-+#if defined(__APPLE__)
-+ _mesa_lookup_shader_program_err(ctx, (GLuint)(uintptr_t)program, "glBindAttribLocation");
-+#else
- _mesa_lookup_shader_program_err(ctx, program, "glBindAttribLocation");
-+#endif
-+
- if (!shProg)
- return;
-
-@@ -114,7 +119,12 @@ _mesa_GetActiveAttrib(GLuint program, GL
- return;
- }
-
-+#if defined(__APPLE__)
-+ shProg = _mesa_lookup_shader_program_err(ctx, (GLuint)(uintptr_t)program, "glGetActiveAttrib");
-+#else
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
-+#endif
-+
- if (!shProg)
- return;
-
-@@ -159,7 +169,12 @@ _mesa_GetAttribLocation(GLuint program,
- {
- GET_CURRENT_CONTEXT(ctx);
- struct gl_shader_program *const shProg =
-+
-+#if defined(__APPLE__)
-+ _mesa_lookup_shader_program_err(ctx, (GLuint)(uintptr_t)program, "glGetAttribLocation");
-+#else
- _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation");
-+#endif
-
- if (!shProg) {
- return -1;
diff --git a/MesaLib-dfbsd/patches/patch-src_mesa_x86_common__x86.c b/MesaLib-dfbsd/patches/patch-src_mesa_x86_common__x86.c
deleted file mode 100644
index d3f37abba4..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_mesa_x86_common__x86.c
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-src_mesa_x86_common__x86.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-DragonFly support.
-
---- src/mesa/x86/common_x86.c.orig 2017-05-10 14:13:58.000000000 +0000
-+++ src/mesa/x86/common_x86.c
-@@ -35,7 +35,7 @@
- */
-
- /* XXX these includes should probably go into imports.h or glheader.h */
--#if defined(USE_SSE_ASM) && defined(__FreeBSD__)
-+#if defined(USE_SSE_ASM) && (defined(__FreeBSD__) || defined(__DragonFly__))
- #include <sys/types.h>
- #include <sys/sysctl.h>
- #endif
-@@ -125,7 +125,7 @@ static LONG WINAPI ExceptionFilter(LPEXC
- */
- void _mesa_check_os_sse_support( void )
- {
--#if defined(__FreeBSD__)
-+#if defined(__FreeBSD__) || defined(__DragonFly__)
- {
- int ret, enabled;
- unsigned int len;
diff --git a/MesaLib-dfbsd/patches/patch-src_util_Makefile.am b/MesaLib-dfbsd/patches/patch-src_util_Makefile.am
deleted file mode 100644
index 48facf1ec6..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-src_util_Makefile.am,v 1.1 2019/01/10 22:30:11 tnn Exp $
-
-handled with CONF_FILES
-
---- src/util/Makefile.am.orig 2018-12-11 21:13:57.000000000 +0000
-+++ src/util/Makefile.am
-@@ -75,7 +75,7 @@ libxmlconfig_la_CFLAGS = \
- libxmlconfig_la_LIBADD = $(EXPAT_LIBS) -lm
-
- drircdir = $(datadir)/drirc.d
--drirc_DATA = 00-mesa-defaults.conf
-+drirc_DATA = # 00-mesa-defaults.conf
-
- u_atomic_test_LDADD = libmesautil.la
- roundeven_test_LDADD = -lm
diff --git a/MesaLib-dfbsd/patches/patch-src_util_build__id.c b/MesaLib-dfbsd/patches/patch-src_util_build__id.c
deleted file mode 100644
index 501bb73520..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_build__id.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-src_util_build__id.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Patch combining DragonFly dports and FreeBSD ports graphics/mesa-dri 18.2.0
-
---- src/util/build_id.c.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/util/build_id.c
-@@ -35,7 +35,19 @@
- #endif
-
- #ifndef ElfW
-+#if defined(__DragonFly__)
-+#ifdef __LP64__
-+#define ElfW(type) Elf64_##type
-+#else
-+#define ElfW(type) Elf32_##type
-+#endif /* __LP64__ */
-+#else
- #define ElfW(type) Elf_##type
-+#endif /* __DragonFly__ */
-+#endif
-+
-+#if defined(__FreeBSD__) && __FreeBSD__ < 12
-+typedef Elf_Note Elf_Nhdr;
- #endif
-
- struct build_id_note {
diff --git a/MesaLib-dfbsd/patches/patch-src_util_disk__cache.c b/MesaLib-dfbsd/patches/patch-src_util_disk__cache.c
deleted file mode 100644
index 8fd302e35c..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_disk__cache.c
+++ /dev/null
@@ -1,29 +0,0 @@
-$NetBSD: patch-src_util_disk__cache.c,v 1.1 2018/10/16 15:21:20 jperkin Exp $
-
-Use fcntl() on SunOS.
-
---- src/util/disk_cache.c.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/util/disk_cache.c
-@@ -857,6 +857,9 @@ cache_put(void *job, int thread_index)
- unsigned i = 0;
- char *filename = NULL, *filename_tmp = NULL;
- struct disk_cache_put_job *dc_job = (struct disk_cache_put_job *) job;
-+#ifdef __sun
-+ struct flock lock = {0};
-+#endif
-
- filename = get_cache_file(dc_job->cache, dc_job->key);
- if (filename == NULL)
-@@ -895,7 +898,12 @@ cache_put(void *job, int thread_index)
- * open with the flock held. So just let that file be responsible
- * for writing the file.
- */
-+#ifdef __sun
-+ lock.l_type = F_WRLCK;
-+ err = fcntl(fd, F_SETLK, &lock);
-+#else
- err = flock(fd, LOCK_EX | LOCK_NB);
-+#endif
- if (err == -1)
- goto done;
-
diff --git a/MesaLib-dfbsd/patches/patch-src_util_futex.h b/MesaLib-dfbsd/patches/patch-src_util_futex.h
deleted file mode 100644
index 5120686726..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_futex.h
+++ /dev/null
@@ -1,53 +0,0 @@
-$NetBSD: patch-src_util_futex.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Implement futex_wake() and futex_wait() via _umtx_op()
-
-FreeBSD Bugzilla - Bug 225415: graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
---- src/util/futex.h.orig 2018-02-09 02:18:00.000000000 +0000
-+++ src/util/futex.h
-@@ -29,10 +29,35 @@
- #include <limits.h>
- #include <stdint.h>
- #include <unistd.h>
-+#if defined(__FreeBSD__)
-+#include <errno.h>
-+# if __FreeBSD__ < 11
-+# include <machine/atomic.h>
-+# endif
-+#include <sys/umtx.h>
-+#else
- #include <linux/futex.h>
- #include <sys/syscall.h>
-+#endif
- #include <sys/time.h>
-
-+#if defined(__FreeBSD__)
-+static inline int futex_wake(uint32_t *addr, int count)
-+{
-+ return _umtx_op(addr, UMTX_OP_WAKE, (uint32_t)count, NULL, NULL) == -1 ? errno : 0;
-+}
-+
-+static inline int futex_wait(uint32_t *addr, int32_t value, struct timespec *timeout)
-+{
-+ void *uaddr = NULL, *uaddr2 = NULL;
-+ if (timeout != NULL) {
-+ const struct _umtx_time tmo = { ._timeout = *timeout, ._flags = UMTX_ABSTIME, ._clockid = CLOCK_MONOTONIC };
-+ uaddr = (void *)(uintptr_t)sizeof(tmo);
-+ uaddr2 = (void *)&tmo;
-+ }
-+ return _umtx_op(addr, UMTX_OP_WAIT_UINT, (uint32_t)value, uaddr, uaddr2) == -1 ? errno : 0;
-+}
-+#else
- static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3)
- {
- return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
-@@ -50,6 +75,7 @@ static inline int futex_wait(uint32_t *a
- return sys_futex(addr, FUTEX_WAIT_BITSET, value, timeout, NULL,
- FUTEX_BITSET_MATCH_ANY);
- }
-+#endif
-
- #endif
-
diff --git a/MesaLib-dfbsd/patches/patch-src_util_os__time.c b/MesaLib-dfbsd/patches/patch-src_util_os__time.c
deleted file mode 100644
index 07a3d4cb03..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_os__time.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD$
-
-- Use monotonic clock for timeouts
-
-FreeBSD Bugzilla - Bug 225415 graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
---- src/util/os_time.c.orig 2018-05-11 23:27:04.000000000 +0000
-+++ src/util/os_time.c
-@@ -95,7 +95,7 @@ os_time_get_nano(void)
- void
- os_time_sleep(int64_t usecs)
- {
--#if 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/patches/patch-src_util_ralloc.c b/MesaLib-dfbsd/patches/patch-src_util_ralloc.c
deleted file mode 100644
index 46f1e97651..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_ralloc.c
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-src_util_ralloc.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-FreeBSD reported atexit bug for 10.6:
-https://bugs.freedesktop.org/show_bug.cgi?id=91869
-
-* Fix exit time segfault of qt5 application with modular xorg
-* Provide compat strnlen for older Darwin.
-
---- src/util/ralloc.c.orig 2017-05-10 14:13:58.000000000 +0000
-+++ src/util/ralloc.c
-@@ -368,7 +368,14 @@ ralloc_strndup(const void *ctx, const ch
- if (unlikely(str == NULL))
- return NULL;
-
-+#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
-+ for (n = 0; n < max; n++, str++) {
-+ if (!*str)
-+ break;
-+ }
-+#else
- n = strnlen(str, max);
-+#endif
- ptr = ralloc_array(ctx, char, n + 1);
- memcpy(ptr, str, n);
- ptr[n] = '\0';
diff --git a/MesaLib-dfbsd/patches/patch-src_util_strndup.h b/MesaLib-dfbsd/patches/patch-src_util_strndup.h
deleted file mode 100644
index bca6f2d575..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_strndup.h
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-src_util_strndup.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Provide compat strndup for older Darwin.
-
---- src/util/strndup.h.orig 2017-05-10 14:13:58.000000000 +0000
-+++ src/util/strndup.h
-@@ -24,7 +24,7 @@
- #ifndef STRNDUP_H
- #define STRNDUP_H
-
--#if defined(_WIN32)
-+#if defined(_WIN32) || (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
-
- #include <stdlib.h> // size_t
- #include <string.h>
diff --git a/MesaLib-dfbsd/patches/patch-src_util_u__atomic.h b/MesaLib-dfbsd/patches/patch-src_util_u__atomic.h
deleted file mode 100644
index b81aef1e77..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_u__atomic.h
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-src_util_u__atomic.h,v 1.2 2018/10/16 15:21:20 jperkin Exp $
-
-Fix SunOS atomic macros.
-
---- src/util/u_atomic.h.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/util/u_atomic.h
-@@ -20,7 +20,7 @@
- * locally coded assembly, compiler intrinsic or ultimately a
- * mutex-based implementation.
- */
--#if defined(__sun)
-+#if defined(__sun) && !defined(__GNUC__)
- #define PIPE_ATOMIC_OS_SOLARIS
- #elif defined(_MSC_VER)
- #define PIPE_ATOMIC_MSVC_INTRINSIC
diff --git a/MesaLib-dfbsd/patches/patch-src_util_u__math.h b/MesaLib-dfbsd/patches/patch-src_util_u__math.h
deleted file mode 100644
index 4f46b5d92b..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_u__math.h
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD$
-
-From NetBSD xsrc:
-
-Use a name for the largest representable float
-
-Actually intended to appease vax which has a floating point format
-that doesn't match the same range as IEEE754 float.
-
-(why not exp2f?)
-
---- src/util/u_math.h.orig 2019-04-05 10:53:23.000000000 +0000
-+++ src/util/u_math.h
-@@ -117,7 +117,11 @@ util_fast_exp2(float x)
- union fi epart;
-
- if(x > 129.00000f)
-+#if defined(__NetBSD__)
-+ return FLT_MAX;
-+#else
- return 3.402823466e+38f;
-+#endif
-
- if (x < -126.99999f)
- return 0.0f;
diff --git a/MesaLib-dfbsd/patches/patch-src_util_u__process.c b/MesaLib-dfbsd/patches/patch-src_util_u__process.c
deleted file mode 100644
index 0b5b84eac3..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_u__process.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$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) || defined(NO_GETPROGRAMNAME)
- /* 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/patches/patch-src_util_u__queue.c b/MesaLib-dfbsd/patches/patch-src_util_u__queue.c
deleted file mode 100644
index d163b3ce6c..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_u__queue.c
+++ /dev/null
@@ -1,72 +0,0 @@
-$NetBSD: patch-src_util_u__queue.c,v 1.2 2019/01/10 22:30:11 tnn Exp $
-
-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
-
-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;
- static mtx_t exit_mutex = _MTX_INITIALIZER_NP;
-
-+#if defined(HAVE_NOATEXIT)
-+static int global_init_called = 0;
-+
-+static void __attribute__((__destructor__))
-+#else
- static void
-+#endif
- atexit_handler(void)
- {
- struct util_queue *iter;
-
-+#if defined(HAVE_NOATEXIT)
-+ if (!global_init_called)
-+ return;
-+#endif
-+
- mtx_lock(&exit_mutex);
- /* Wait for all queues to assert idle. */
- LIST_FOR_EACH_ENTRY(iter, &queue_list, head) {
-@@ -63,7 +74,11 @@ static void
- global_init(void)
- {
- LIST_INITHEAD(&queue_list);
-+#if defined(HAVE_NOATEXIT)
-+ global_init_called = 1;
-+#else
- atexit(atexit_handler);
-+#endif
- }
-
- static void
-@@ -244,12 +259,25 @@ util_queue_thread_func(void *input)
- /* Don't inherit the thread affinity from the parent thread.
- * Set the full mask.
- */
-+#if defined(__NetBSD__) && defined(SETAFFINITY_NP_NETBSD)
-+ cpuset_t *cpuset;
-+ cpuset = cpuset_create();
-+ if (cpuset != NULL) {
-+ cpuset_zero(cpuset);
-+ for (unsigned i = 0; i < cpuset_size(cpuset); i++)
-+ cpuset_set(i, cpuset);
-+
-+ pthread_setaffinity_np(pthread_self(), cpuset_size(cpuset), cpuset);
-+ cpuset_destroy(cpuset);
-+ }
-+#else
- cpu_set_t cpuset;
- CPU_ZERO(&cpuset);
- for (unsigned i = 0; i < CPU_SETSIZE; i++)
- CPU_SET(i, &cpuset);
-
- pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset);
-+#endif
- }
- #endif
-
diff --git a/MesaLib-dfbsd/patches/patch-src_util_u__thread.h b/MesaLib-dfbsd/patches/patch-src_util_u__thread.h
deleted file mode 100644
index 4d32d7d34f..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_u__thread.h
+++ /dev/null
@@ -1,117 +0,0 @@
-$NetBSD: patch-src_util_u__thread.h,v 1.2 2019/01/20 09:50:28 tnn Exp $
-
-handle NetBSD-style pthread_setaffinity_np(3)
-
-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 2019-04-05 10:53:23.000000000 +0000
-+++ src/util/u_thread.h
-@@ -34,6 +34,13 @@
-
- #ifdef HAVE_PTHREAD
- #include <signal.h>
-+#if defined(__DragonFly__) || defined(__FreeBSD__)
-+#include <pthread_np.h>
-+# if !defined(__DragonFly__)
-+# define cpu_set_t cpuset_t
-+# endif
-+#undef ALIGN /* Avoid conflict on FreeBSD in main/macros.h */
-+#endif
- #endif
-
- static inline thrd_t u_thread_create(int (*routine)(void *), void *param)
-@@ -64,6 +71,10 @@ static inline void u_thread_setname( con
- (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12)) && \
- defined(__linux__)
- pthread_setname_np(pthread_self(), name);
-+# elif defined(__DragonFly__) || defined(__FreeBSD__)
-+ pthread_set_name_np(pthread_self(), name);
-+# elif defined(__NetBSD__)
-+ pthread_setname_np(pthread_self(), "%s", (void*)name);
- # endif
- #endif
- (void)name;
-@@ -83,6 +94,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__) && defined(SETAFFINITY_NP_NETBSD)
-+ cpuset_t *cpuset;
-+ cpuset = cpuset_create();
-+ if (cpuset == NULL)
-+ return;
-+ cpuset_zero(cpuset);
-+ for (unsigned i = 0; i < cores_per_L3; i++)
-+ cpuset_set(L3_index * cores_per_L3 + i, cpuset);
-+ pthread_setaffinity_np(thread, cpuset_size(cpuset), cpuset);
-+ cpuset_destroy(cpuset);
-+#else
- cpu_set_t cpuset;
-
- CPU_ZERO(&cpuset);
-@@ -90,6 +112,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
-+#endif
- }
-
- /**
-@@ -103,6 +126,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__) && defined(SETAFFINITY_NP_NETBSD)
-+ cpuset_t *cpuset;
-+
-+ cpuset = cpuset_create();
-+ if (cpuset == NULL)
-+ return -1;
-+
-+ if (pthread_getaffinity_np(thread, cpuset_size(cpuset), cpuset) == 0) {
-+ int L3_index = -1;
-+
-+ for (unsigned i = 0; i < cpuset_size(cpuset); i++) {
-+ if (cpuset_isset(i, cpuset)) {
-+ int x = i / cores_per_L3;
-+
-+ if (L3_index != x) {
-+ if (L3_index == -1)
-+ L3_index = x;
-+ else {
-+ cpuset_destroy(cpuset);
-+ return -1; /* multiple L3s are set */
-+ }
-+ }
-+ }
-+ }
-+ cpuset_destroy(cpuset);
-+ return L3_index;
-+ }
-+ cpuset_destroy(cpuset);
-+#else
- cpu_set_t cpuset;
-
- if (pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset) == 0) {
-@@ -123,6 +175,7 @@ util_get_L3_for_pinned_thread(thrd_t thr
- return L3_index;
- }
- #endif
-+#endif
- return -1;
- }
-
-@@ -134,7 +187,7 @@ util_get_L3_for_pinned_thread(thrd_t thr
- static inline int64_t
- u_thread_get_time_nano(thrd_t thread)
- {
--#if defined(__linux__) && defined(HAVE_PTHREAD)
-+#if (defined(__linux__) || defined(USE_PTHREAD_GETCPUCLOCKID)) && defined(HAVE_PTHREAD)
- struct timespec ts;
- clockid_t cid;
-
diff --git a/MesaLib-dfbsd/patches/patch-src_util_xmlconfig.c b/MesaLib-dfbsd/patches/patch-src_util_xmlconfig.c
deleted file mode 100644
index b429692fea..0000000000
--- a/MesaLib-dfbsd/patches/patch-src_util_xmlconfig.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-src_util_xmlconfig.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-PR pkg/50202.
-Provide compat strndup for older Darwin.
-
---- src/util/xmlconfig.c.orig 2018-09-07 21:18:07.000000000 +0000
-+++ src/util/xmlconfig.c
-@@ -39,6 +39,23 @@
- #include "xmlconfig.h"
- #include "u_process.h"
-
-+#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
-+static char *
-+strndup(const char *str, size_t n)
-+{
-+ size_t len;
-+ char *copy;
-+
-+ for (len = 0; len < n && str[len]; len++)
-+ continue;
-+
-+ if ((copy = (char *)malloc(len + 1)) == NULL)
-+ return (NULL);
-+ memcpy(copy, str, len);
-+ copy[len] = '\0';
-+ return (copy);
-+}
-+#endif
-
- /** \brief Find an option in an option cache with the name as key */
- static uint32_t
Home |
Main Index |
Thread Index |
Old Index