diff options
author | tnn <tnn@pkgsrc.org> | 2020-03-08 10:35:03 +0000 |
---|---|---|
committer | tnn <tnn@pkgsrc.org> | 2020-03-08 10:35:03 +0000 |
commit | 781e66f7f9056815ab2e24eabbdfca276c52909a (patch) | |
tree | 24aaf14bbe667738edbe4d612835c97de973d576 /graphics | |
parent | f0c284c7e30a4755b820944e2a7c95a724caa96d (diff) | |
download | pkgsrc-781e66f7f9056815ab2e24eabbdfca276c52909a.tar.gz |
MesaLib: update to mesa-20.0.1
New features in mesa 20:
OpenGL 4.6 on radeonsi.
GL_ARB_gl_spirv on radeonsi.
GL_ARB_spirv_extensions on radeonsi.
GL_EXT_direct_state_access for compatibility profile.
VK_AMD_device_coherent_memory on RADV.
VK_AMD_mixed_attachment_samples on RADV.
VK_AMD_shader_explicit_vertex_parameter on RADV.
VK_AMD_shader_image_load_store_lod on RADV.
VK_AMD_shader_fragment_mask on RADV.
VK_EXT_subgroup_size_control on RADV/LLVM.
VK_KHR_separate_depth_stencil_layouts on Intel, RADV.
VK_KHR_shader_subgroup_extended_types on RADV.
VK_KHR_swapchain_mutable_format on RADV.
VK_KHR_shader_float_controls on RADV/ACO.
GFX6 (Southern Islands) and GFX7 (Sea Islands) support on RADV/ACO.
Wave32 support for GFX10 (Navi) on RADV/ACO.
Compilation of Geometry Shaders on RADV/ACO.
Vulkan 1.2 on Intel, RADV.
GL_INTEL_shader_integer_functions2 and VK_INTEL_shader_integer_functions2 on Intel.
As usual many bugfixes also.
Diffstat (limited to 'graphics')
13 files changed, 108 insertions, 207 deletions
diff --git a/graphics/MesaLib/Makefile b/graphics/MesaLib/Makefile index afcc4bffe18..693ee31420c 100644 --- a/graphics/MesaLib/Makefile +++ b/graphics/MesaLib/Makefile @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.186 2020/02/22 07:52:01 tnn Exp $ +# $NetBSD: Makefile,v 1.187 2020/03/08 10:35:03 tnn Exp $ -DISTNAME= mesa-19.2.7 +DISTNAME= mesa-20.0.1 PKGNAME= ${DISTNAME:S/mesa/MesaLib/} -PKGREVISION= 6 CATEGORIES= graphics MASTER_SITES= https://mesa.freedesktop.org/archive/ EXTRACT_SUFX= .tar.xz @@ -177,9 +176,6 @@ PKGCONFIG_OVERRIDE+= output/meson-private/osmesa.pc PKGCONFIG_OVERRIDE+= output/meson-private/xatracker.pc PKGCONFIG_OVERRIDE+= output/meson-private/gl.pc -pre-configure: - ${TOUCH} ${WRKSRC}/src/glx/apple_dummy.cpp - post-install: ${MV} ${DESTDIR}${PREFIX}/share/drirc.d/00-mesa-defaults.conf ${DESTDIR}${EGDIR} .if ${OPSYS} == "Darwin" diff --git a/graphics/MesaLib/distinfo b/graphics/MesaLib/distinfo index c1051bb0337..54430601afe 100644 --- a/graphics/MesaLib/distinfo +++ b/graphics/MesaLib/distinfo @@ -1,37 +1,34 @@ -$NetBSD: distinfo,v 1.151 2020/02/22 09:25:22 tnn Exp $ +$NetBSD: distinfo,v 1.152 2020/03/08 10:35:03 tnn Exp $ -SHA1 (mesa-19.2.7.tar.xz) = 9b8ebf66770353a48bd710e12e2727fb33645f44 -RMD160 (mesa-19.2.7.tar.xz) = 5323b623ac22c168b86548cf6d842ce004e346a9 -SHA512 (mesa-19.2.7.tar.xz) = 87a82664381432e956ee23dc92bec5accf667606232e38d9458d67132c16fdc44584f65671293b83f00c58ad7742b80e942a5d1bd66d457705be60aaaf35395b -Size (mesa-19.2.7.tar.xz) = 11460812 bytes +SHA1 (mesa-20.0.1.tar.xz) = 32525570f2a22bfa7f1433511d4048c4a646843d +RMD160 (mesa-20.0.1.tar.xz) = 45e4dd0d7b6c6309f4d7967f5ee895bc72d8375b +SHA512 (mesa-20.0.1.tar.xz) = 9e005ebbb699c1ad83b73c503c467907958a3d9cad644d8f7ac95804fd265debcf563784a1054c8e0bf40106e33b13185607e8270a197e9ddc34c50b1b2c4d82 +Size (mesa-20.0.1.tar.xz) = 12174080 bytes SHA1 (patch-include_c11_threads__posix.h) = e1dca04b5c514d20123ef99338c6dabedbc14c5f SHA1 (patch-src_amd_common_ac__debug.c) = 8233367c3b5bc344442ea8d19488fdd1e3791ae9 SHA1 (patch-src_compiler_builtin__type__macros.h) = e4868011711fb89a293580a12eb603b8e7162336 -SHA1 (patch-src_compiler_glsl_glsl__parser__extras.cpp) = ef114d6e288e6d212fce9d1c0606f7d454a171c4 SHA1 (patch-src_egl_drivers_dri2_platform__drm.c) = 9230fbae2c04246ebca8437ecad694bbae857fbe SHA1 (patch-src_egl_drivers_dri2_platform__x11.c) = 49e48c31eacb79d1da357fe70eaffd2926b5280e SHA1 (patch-src_egl_main_eglglobals.c) = 0d52014f52e62fc5fa6650336ddb0011ecf331e6 SHA1 (patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c) = f913b779404e6bd8ae707a4fd66eb7c1dca9b311 SHA1 (patch-src_gallium_auxiliary_rbug_rbug__texture.c) = 57d831b1001419191a27c05d9cb7734481372d27 +SHA1 (patch-src_gallium_drivers_llvmpipe_lp__memory.c) = ca3c1b317c41f6ae56a08272ffabdecb38fea2ec 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__state__shaders.c) = 2a6fb80e2dd8c19a73c1ae9c037e7b1769ca100f 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_llvm_invocation.cpp) = 8c90a8aab876b262967776940774770d802fc2bc SHA1 (patch-src_gallium_state__trackers_clover_util_range.hpp) = cdc78067986c1b92818472c4201c58ef1b42c4f4 +SHA1 (patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c) = 825e6201b1efaff658297abd2f0d9a27d557703c SHA1 (patch-src_glx_dri__common.h) = 0274877f8c65a4bb729536a897df4704897a4c6e SHA1 (patch-src_glx_dri__glx.c) = 8fd48776e9953b18bd17ba130d90ae2935e67242 SHA1 (patch-src_glx_glxclient.h) = f0358179ae397bc8677597b0ccb9a471f40f15de SHA1 (patch-src_glx_glxcurrent.c) = a872950c2cb08f60c1d018d0490c610a764ab468 SHA1 (patch-src_glx_glxext.c) = 15c2c5e0c6b5095ce849fb86ad148aa05d7d907a SHA1 (patch-src_intel_compiler_brw__fs__bank__conflicts.cpp) = 6276d2c6846bb4dd08699921bec4e20202a17478 -SHA1 (patch-src_intel_perf_gen__perf.c) = 526f36d96bd9d72893764da2b9e78cb9b70de92b SHA1 (patch-src_intel_tools_aubinator__error__decode.c) = d8f636e3c3e76763a505a1dce23de0b198ad62fa -SHA1 (patch-src_loader_loader.c) = 303e941f9b8afa6ee8053107af01e2c26e6ff118 SHA1 (patch-src_mapi_entry__x86-64__tls.h) = cbbb95b96414609a9cd05af75c9544f8e6938280 -SHA1 (patch-src_mapi_entry__x86__tls.h) = e5229912def548856662b0d764b0f2fc07457a57 +SHA1 (patch-src_mapi_entry__x86__tls.h) = d85680aa658d159017e8bad1589f95f3830ac577 SHA1 (patch-src_mapi_u__current.c) = 4e3ec6e253af3737f77ecd43e56044ba2b81e699 SHA1 (patch-src_mapi_u__current.h) = 9f4744681381a0959fda2926a436f296c89577f3 SHA1 (patch-src_mesa_main_extensions.c) = 2f48bdb1176c2878bb33bcfab7556172b50a987e @@ -42,5 +39,5 @@ SHA1 (patch-src_mesa_x86_common__x86.c) = f8c4b93443ef66d017f6aa114b877565b30f25 SHA1 (patch-src_util_build__id.c) = 7a9547bbda9d2fb9f0018ccf27b70b59e497aa2c SHA1 (patch-src_util_strndup.h) = 73f49694ca48ad6b9a9d8346c5b84fddec2463bd SHA1 (patch-src_util_u__atomic.h) = 31d4514538ef5ee53012695eb5c66134aaec981e -SHA1 (patch-src_util_u__queue.c) = ed1ea3f6fc37e9a64894a3e865c48691b6e01b2c -SHA1 (patch-src_util_u__thread.h) = 60c14883925ac60e26efbeee5bef257d081bcc51 +SHA1 (patch-src_util_u__queue.c) = fe9515e8fca597962b25a60ae8f2c4cd0c61c251 +SHA1 (patch-src_util_u__thread.h) = be9107c879e7f8506aeafd3bb7e6165b74f78c46 diff --git a/graphics/MesaLib/patches/patch-src_compiler_glsl_glsl__parser__extras.cpp b/graphics/MesaLib/patches/patch-src_compiler_glsl_glsl__parser__extras.cpp deleted file mode 100644 index 601a309ed82..00000000000 --- a/graphics/MesaLib/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.3 2019/08/21 13:35:28 nia 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/graphics/MesaLib/patches/patch-src_gallium_drivers_llvmpipe_lp__memory.c b/graphics/MesaLib/patches/patch-src_gallium_drivers_llvmpipe_lp__memory.c new file mode 100644 index 00000000000..9a38fd348c6 --- /dev/null +++ b/graphics/MesaLib/patches/patch-src_gallium_drivers_llvmpipe_lp__memory.c @@ -0,0 +1,23 @@ +$NetBSD: patch-src_gallium_drivers_llvmpipe_lp__memory.c,v 1.1 2020/03/08 10:35:03 tnn Exp $ + +Force the symbol into data rather than bss to work around linking +problem on OS X. + +Undefined symbols for architecture x86_64: + "_lp_dummy_tile", referenced from: + _lp_rast_create in libllvmpipe.a(lp_rast.c.o) + _llvmpipe_launch_grid in libllvmpipe.a(lp_state_cs.c.o) + _lp_setup_set_fragment_sampler_views in libllvmpipe.a(lp_setup.c.o) + +--- src/gallium/drivers/llvmpipe/lp_memory.c.orig 2020-03-05 21:34:31.000000000 +0000 ++++ src/gallium/drivers/llvmpipe/lp_memory.c +@@ -32,5 +32,9 @@ + /* A single dummy tile used in a couple of out-of-memory situations. + */ + PIPE_ALIGN_VAR(LP_MIN_VECTOR_ALIGN) ++#ifdef __APPLE__ ++uint8_t lp_dummy_tile[TILE_SIZE * TILE_SIZE * 4] = { 0 }; ++#else + uint8_t lp_dummy_tile[TILE_SIZE * TILE_SIZE * 4]; ++#endif + diff --git a/graphics/MesaLib/patches/patch-src_gallium_include_pipe_p__config.h b/graphics/MesaLib/patches/patch-src_gallium_include_pipe_p__config.h deleted file mode 100644 index bf1f0ff5a9e..00000000000 --- a/graphics/MesaLib/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.7 2019/08/21 13:35:28 nia 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/graphics/MesaLib/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp b/graphics/MesaLib/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp index c7fd1cbf56b..ef48dd6c96d 100644 --- a/graphics/MesaLib/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp +++ b/graphics/MesaLib/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp @@ -1,4 +1,4 @@ -$NetBSD: patch-src_gallium_state__trackers_clover_llvm_invocation.cpp,v 1.1 2019/08/21 13:35:28 nia Exp $ +$NetBSD: patch-src_gallium_state__trackers_clover_llvm_invocation.cpp,v 1.2 2020/03/08 10:35:03 tnn Exp $ Patch from FreeBSD ports graphics/mesa-dri 17.1.0 @@ -11,9 +11,9 @@ ic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv' can not be used when # /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.orig 2020-03-05 21:34:31.000000000 +0000 +++ src/gallium/state_trackers/clover/llvm/invocation.cpp -@@ -181,6 +181,10 @@ namespace { +@@ -188,6 +188,10 @@ namespace { return get_lang_standard_from_version_str(device_version); } @@ -22,9 +22,9 @@ ic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv' can not be used when +#endif + std::unique_ptr<clang::CompilerInstance> - create_compiler_instance(const device &dev, + create_compiler_instance(const device &dev, const std::string& ir_target, const std::vector<std::string> &opts, -@@ -193,8 +197,13 @@ namespace { +@@ -200,9 +204,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. @@ -34,7 +34,8 @@ ic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv' can not be used when +#else const std::vector<const char *> copts = map(std::mem_fn(&std::string::c_str), opts); +- +#endif - - const target &target = dev.ir_target(); + const target &target = ir_target; const std::string &device_clc_version = dev.device_clc_version(); + diff --git a/graphics/MesaLib/patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp b/graphics/MesaLib/patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp deleted file mode 100644 index 299100b9e2e..00000000000 --- a/graphics/MesaLib/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 2019/08/21 13:35:28 nia 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/graphics/MesaLib/patches/patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c b/graphics/MesaLib/patches/patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c new file mode 100644 index 00000000000..81f9751a9c2 --- /dev/null +++ b/graphics/MesaLib/patches/patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c @@ -0,0 +1,16 @@ +$NetBSD: patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c,v 1.5 2020/03/08 10:35:03 tnn Exp $ + +conditionalise Linuxism + +--- src/gallium/winsys/svga/drm/vmw_screen_ioctl.c.orig 2020-03-05 21:34:31.000000000 +0000 ++++ src/gallium/winsys/svga/drm/vmw_screen_ioctl.c +@@ -694,7 +694,9 @@ vmw_ioctl_region_map(struct vmw_region * + return NULL; + } + ++#ifdef MADV_HUGEPAGE + (void) madvise(map, region->size, MADV_HUGEPAGE); ++#endif + region->data = map; + } + diff --git a/graphics/MesaLib/patches/patch-src_intel_perf_gen__perf.c b/graphics/MesaLib/patches/patch-src_intel_perf_gen__perf.c deleted file mode 100644 index ea64eb3f6ea..00000000000 --- a/graphics/MesaLib/patches/patch-src_intel_perf_gen__perf.c +++ /dev/null @@ -1,56 +0,0 @@ -$NetBSD: patch-src_intel_perf_gen__perf.c,v 1.1 2019/08/24 20:11:19 nia Exp $ - -SunOS does not have d_type in DIR structure. - ---- src/intel/perf/gen_perf.c.orig 2019-08-07 16:39:17.000000000 +0000 -+++ src/intel/perf/gen_perf.c -@@ -48,6 +48,9 @@ get_sysfs_dev_dir(struct gen_perf *perf, - DIR *drmdir; - struct dirent *drm_entry; - int len; -+#ifdef __sun -+ struct stat s; -+#endif - - perf->sysfs_dev_dir[0] = '\0'; - -@@ -79,8 +82,14 @@ get_sysfs_dev_dir(struct gen_perf *perf, - } - - while ((drm_entry = readdir(drmdir))) { -+#ifdef __sun -+ stat(drm_entry->d_name, &s); -+ if ((s.st_mode == S_IFDIR || -+ s.st_mode == S_IFLNK) && -+#else - if ((drm_entry->d_type == DT_DIR || - drm_entry->d_type == DT_LNK) && -+#endif - strncmp(drm_entry->d_name, "card", 4) == 0) - { - len = snprintf(perf->sysfs_dev_dir, -@@ -162,6 +171,9 @@ enumerate_sysfs_metrics(struct gen_perf - struct dirent *metric_entry; - char buf[256]; - int len; -+#ifdef __sun -+ struct stat s; -+#endif - - len = snprintf(buf, sizeof(buf), "%s/metrics", perf->sysfs_dev_dir); - if (len < 0 || len >= sizeof(buf)) { -@@ -178,8 +190,14 @@ enumerate_sysfs_metrics(struct gen_perf - while ((metric_entry = readdir(metricsdir))) { - struct hash_entry *entry; - -+#ifdef __sun -+ stat(metric_entry->d_name, &s); -+ if ((s.st_mode != S_IFDIR && -+ s.st_mode != S_IFLNK) || -+#else - if ((metric_entry->d_type != DT_DIR && - metric_entry->d_type != DT_LNK) || -+#endif - metric_entry->d_name[0] == '.') - continue; - diff --git a/graphics/MesaLib/patches/patch-src_loader_loader.c b/graphics/MesaLib/patches/patch-src_loader_loader.c deleted file mode 100644 index 9979826381a..00000000000 --- a/graphics/MesaLib/patches/patch-src_loader_loader.c +++ /dev/null @@ -1,14 +0,0 @@ -$NetBSD: patch-src_loader_loader.c,v 1.5 2019/08/29 14:12:57 nia Exp $ - -Include limits.h for PATH_MAX. - ---- src/loader/loader.c.orig 2019-08-23 10:27:36.000000000 +0000 -+++ src/loader/loader.c -@@ -36,6 +36,7 @@ - #include <string.h> - #include <unistd.h> - #include <stdlib.h> -+#include <limits.h> - #include <sys/param.h> - #ifdef MAJOR_IN_MKDEV - #include <sys/mkdev.h> diff --git a/graphics/MesaLib/patches/patch-src_mapi_entry__x86__tls.h b/graphics/MesaLib/patches/patch-src_mapi_entry__x86__tls.h index cc130d15f59..8bd714d3c58 100644 --- a/graphics/MesaLib/patches/patch-src_mapi_entry__x86__tls.h +++ b/graphics/MesaLib/patches/patch-src_mapi_entry__x86__tls.h @@ -1,44 +1,51 @@ -$NetBSD: patch-src_mapi_entry__x86__tls.h,v 1.5 2020/02/22 09:25:22 tnn Exp $ +$NetBSD: patch-src_mapi_entry__x86__tls.h,v 1.6 2020/03/08 10:35:03 tnn Exp $ NetBSD only supports zero-initialized initial-exec tls variables in conjuction with dlopen(3) at the moment. ---- src/mapi/entry_x86_tls.h.orig 2019-12-04 22:10:14.000000000 +0000 +--- src/mapi/entry_x86_tls.h.orig 2020-03-05 21:34:32.000000000 +0000 +++ src/mapi/entry_x86_tls.h -@@ -43,6 +43,20 @@ __asm__("x86_current_tls:\n\t" +@@ -45,6 +45,25 @@ __asm__("x86_current_tls:\n\t" "movl " ENTRY_CURRENT_TABLE "@GOTNTPOFF(%eax), %eax\n\t" "ret"); +#if defined(__NetBSD__) +__asm__("x86_current_table_helper:\n\t" -+ "movl %gs:(%eax), %eax\n\t" \ -+ "testl %eax, %eax\n\t" \ -+ "je 1f\n\t" \ -+ "ret\n\t" \ -+ "1:\n\t" \ -+ "call 2f\n\t" \ -+ "2:\n\t" \ -+ "popl %eax\n\t" \ -+ "addl $_GLOBAL_OFFSET_TABLE_+[.-2b], %eax\n\t" \ ++ "call 1f\n\t" ++ "1:\n\t" ++ "popl %eax\n\t" ++ "addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax\n\t" ++ "movl " ENTRY_CURRENT_TABLE "@GOTNTPOFF(%eax), %eax\n\t" ++ "movl %gs:(%eax), %eax\n\t" ++ "testl %eax, %eax\n\t" ++ "je 2f\n\t" ++ "ret\n\t" ++ "2:\n\t" ++ "call 3f\n\t" ++ "3:\n\t" ++ "popl %eax\n\t" ++ "addl $_GLOBAL_OFFSET_TABLE_+[.-3b], %eax\n\t" + "jmp *" ENTRY_CURRENT_TABLE_GET "@GOT(%eax)"); +#endif + #ifndef GLX_X86_READONLY_TEXT __asm__(".section wtext, \"awx\", @progbits"); #endif /* GLX_X86_READONLY_TEXT */ -@@ -56,10 +70,17 @@ __asm__(".balign 16\n" +@@ -58,6 +77,11 @@ __asm__(".balign 16\n" ".balign 16\n" \ func ":" +#if defined(__NetBSD__) -+#define STUB_ASM_CODE(slot) \ -+ "call x86_current_tls\n\t" \ -+ "call x86_current_table_helper\n\t" \ ++#define STUB_ASM_CODE(slot) \ ++ "call x86_current_table_helper\n\t" \ + "jmp *(4 * " slot ")(%eax)" +#else - #define STUB_ASM_CODE(slot) \ - "call x86_current_tls\n\t" \ - "movl %gs:(%eax), %eax\n\t" \ + #define STUB_ASM_CODE(slot) \ + "call 1f\n" \ + "1:\n\t" \ +@@ -66,6 +90,7 @@ __asm__(".balign 16\n" + "movl " ENTRY_CURRENT_TABLE "@GOTNTPOFF(%eax), %eax\n\t" \ + "movl %gs:(%eax), %eax\n\t" \ "jmp *(4 * " slot ")(%eax)" +#endif diff --git a/graphics/MesaLib/patches/patch-src_util_u__queue.c b/graphics/MesaLib/patches/patch-src_util_u__queue.c index f5b7c0b57fe..68d8f2f09e0 100644 --- a/graphics/MesaLib/patches/patch-src_util_u__queue.c +++ b/graphics/MesaLib/patches/patch-src_util_u__queue.c @@ -1,13 +1,13 @@ -$NetBSD: patch-src_util_u__queue.c,v 1.1 2019/08/21 13:35:28 nia Exp $ +$NetBSD: patch-src_util_u__queue.c,v 1.2 2020/03/08 10:35:03 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 ---- src/util/u_queue.c.orig 2018-12-11 21:13:57.000000000 +0000 +--- src/util/u_queue.c.orig 2020-03-05 21:34:32.000000000 +0000 +++ src/util/u_queue.c -@@ -46,11 +46,22 @@ static once_flag atexit_once_flag = ONCE +@@ -51,11 +51,22 @@ static once_flag atexit_once_flag = ONCE static struct list_head queue_list; static mtx_t exit_mutex = _MTX_INITIALIZER_NP; @@ -30,10 +30,10 @@ https://bugs.freedesktop.org/show_bug.cgi?id=91869 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 +@@ -68,7 +79,11 @@ static void global_init(void) { - LIST_INITHEAD(&queue_list); + list_inithead(&queue_list); +#if defined(HAVE_NOATEXIT) + global_init_called = 1; +#else @@ -42,7 +42,7 @@ https://bugs.freedesktop.org/show_bug.cgi?id=91869 } static void -@@ -244,12 +259,25 @@ util_queue_thread_func(void *input) +@@ -249,12 +264,25 @@ util_queue_thread_func(void *input) /* Don't inherit the thread affinity from the parent thread. * Set the full mask. */ diff --git a/graphics/MesaLib/patches/patch-src_util_u__thread.h b/graphics/MesaLib/patches/patch-src_util_u__thread.h index 295883afb5a..64db83fb096 100644 --- a/graphics/MesaLib/patches/patch-src_util_u__thread.h +++ b/graphics/MesaLib/patches/patch-src_util_u__thread.h @@ -1,4 +1,4 @@ -$NetBSD: patch-src_util_u__thread.h,v 1.3 2019/10/29 09:21:54 nia Exp $ +$NetBSD: patch-src_util_u__thread.h,v 1.4 2020/03/08 10:35:03 tnn Exp $ Oracle Solaris has pthread_setname_np. illumos does not. @@ -6,9 +6,9 @@ Don't hard error when there's no pthread_setname_np. handle NetBSD-style pthread_setaffinity_np(3) ---- src/util/u_thread.h.orig 2019-10-24 16:13:04.000000000 +0000 +--- src/util/u_thread.h.orig 2020-03-05 21:34:32.000000000 +0000 +++ src/util/u_thread.h -@@ -69,7 +69,7 @@ static inline thrd_t u_thread_create(int +@@ -73,7 +73,7 @@ static inline thrd_t u_thread_create(int static inline void u_thread_setname( const char *name ) { #if defined(HAVE_PTHREAD) @@ -17,15 +17,7 @@ handle NetBSD-style pthread_setaffinity_np(3) pthread_setname_np(pthread_self(), name); #elif DETECT_OS_FREEBSD || DETECT_OS_OPENBSD pthread_set_name_np(pthread_self(), name); -@@ -78,7 +78,6 @@ static inline void u_thread_setname( con - #elif DETECT_OS_APPLE - pthread_setname_np(name); - #else --#error Not sure how to call pthread_setname_np - #endif - #endif - (void)name; -@@ -98,6 +97,17 @@ static inline void +@@ -104,6 +104,17 @@ static inline void util_pin_thread_to_L3(thrd_t thread, unsigned L3_index, unsigned cores_per_L3) { #if defined(HAVE_PTHREAD_SETAFFINITY) @@ -43,7 +35,7 @@ handle NetBSD-style pthread_setaffinity_np(3) cpu_set_t cpuset; CPU_ZERO(&cpuset); -@@ -105,6 +115,7 @@ util_pin_thread_to_L3(thrd_t thread, uns +@@ -111,6 +122,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 @@ -51,7 +43,7 @@ handle NetBSD-style pthread_setaffinity_np(3) } /** -@@ -118,6 +129,35 @@ static inline int +@@ -124,6 +136,35 @@ static inline int util_get_L3_for_pinned_thread(thrd_t thread, unsigned cores_per_L3) { #if defined(HAVE_PTHREAD_SETAFFINITY) @@ -87,7 +79,7 @@ handle NetBSD-style pthread_setaffinity_np(3) cpu_set_t cpuset; if (pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset) == 0) { -@@ -138,6 +178,7 @@ util_get_L3_for_pinned_thread(thrd_t thr +@@ -144,6 +185,7 @@ util_get_L3_for_pinned_thread(thrd_t thr return L3_index; } #endif @@ -95,3 +87,12 @@ handle NetBSD-style pthread_setaffinity_np(3) return -1; } +@@ -155,7 +197,7 @@ util_get_L3_for_pinned_thread(thrd_t thr + static inline int64_t + u_thread_get_time_nano(thrd_t thread) + { +-#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__) ++#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__) && !defined(__sun) + struct timespec ts; + clockid_t cid; + |