summaryrefslogtreecommitdiff
path: root/graphics/MesaLib/patches/patch-src_util_u__thread.h
diff options
context:
space:
mode:
authortnn <tnn@pkgsrc.org>2022-03-13 15:50:05 +0000
committertnn <tnn@pkgsrc.org>2022-03-13 15:50:05 +0000
commitda02083ce6ce77ed90db4be4c628118150f99df1 (patch)
tree26a51edd4d6ea1ecea2b146c2fecc918c857abaa /graphics/MesaLib/patches/patch-src_util_u__thread.h
parent847972a2f07c296459ee3768c7773a68b498e5f9 (diff)
downloadpkgsrc-da02083ce6ce77ed90db4be4c628118150f99df1.tar.gz
MesaLib: update to 21.3.7
Of particular note is this change in Mesa 21.2: "32-bit x86 builds now default disable x87 math and use sse2." This might need to be revisited in pkgsrc. Bugfixes omitted from ChangeLog. New features in Mesa 21.3: VK_EXT_color_write_enable on lavapipe GL_ARB_texture_filter_anisotropic in llvmpipe Anisotropic texture filtering in lavapipe VK_EXT_shader_atomic_float2 on Intel and RADV. VK_EXT_vertex_input_dynamic_state on RADV. VK_KHR_timeline_semaphore on lavapipe VK_EXT_external_memory_host on lavapipe GL_AMD_pinned_memory on llvmpipe GL 4.5 compatibility on llvmpipe VK_EXT_primitive_topology_list_restart on RADV and lavapipe. ES 3.2 on zink VK_KHR_depth_stencil_resolve on lavapipe VK_KHR_shader_integer_dot_product on RADV. OpenGL FP16 support on llvmpipe VK_KHR_shader_float16_int8 on lavapipe VK_KHR_shader_subgroup_extended_types on lavapipe VK_KHR_spirv_1_4 on lavapipe Experimental raytracing support on RADV VK_KHR_synchronization2 on Intel NGG shader based culling is now enabled by default on GFX10.3 on RADV. VK_KHR_maintenance4 on RADV VK_KHR_format_feature_flags2 on RADV. EGL_EXT_present_opaque on wayland New features in Mesa 21.2: zink supports GL_ARB_texture_filter_minmax, GL_ARB_shader_clock VK_EXT_provoking_vertex on RADV. VK_EXT_extended_dynamic_state2 on RADV. VK_EXT_global_priority_query on RADV. VK_EXT_physical_device_drm on RADV. VK_KHR_shader_subgroup_uniform_control_flow on Intel and RADV. VK_EXT_color_write_enable on RADV. 32-bit x86 builds now default disable x87 math and use sse2. GL ES 3.1 on GT21x hardware. VK_EXT_acquire_drm_display on RADV and ANV. VK_EXT_vertex_input_dynamic_state on lavapipe wideLines on lavapipe VK_EXT_line_rasterization on lavapipe VK_EXT_multi_draw on ANV, lavapipe, and RADV VK_KHR_separate_depth_stencil_layouts on lavapipe VK_EXT_separate_stencil_usage on lavapipe VK_EXT_extended_dynamic_state2 on lavapipe NGG shader based primitive culling is now supported by RADV. Panfrost supports OpenGL ES 3.1 New Asahi driver for the Apple M1 GL_ARB_sample_locations on zink GL_ARB_sparse_buffer on zink GL_ARB_shader_group_vote on zink DRM format modifiers on zink freedreno+turnip: Initial support for a6xx gen4 (a660, a635) New features in Mesa 21.1: VK_KHR_workgroup_memory_explicit_layout on Intel, RADV DRM format modifiers for AMD. VK_KHR_zero_initialize_workgroup_memory on Intel, RADV Zink exposes GL 4.6 and ES 3.1 GL_EXT_depth_bounds_test on softpipe, zink GL_EXT_texture_filter_minmax on nvc0 (gm200+) GL_ARB_texture_filter_minmax on nvc0 (gm200+) GL_ARB_post_depth_coverage on zink VK_KHR_copy_commands2 on lavapipe lavapipe exposes Vulkan 1.1 VRS attachment on RADV New features in Mesa 21.0: GL_EXT_demote_to_helper_invocation on radeonsi GL_NV_compute_shader_derivatives on radeonsi EGL_MESA_platform_xcb Removed GL_NV_point_sprite for classic swrast. driconf: remove glx_disable_oml_sync_control, glx_disable_sgi_video_sync, and glx_disable_ext_buffer_age Removed support for loading DRI drivers older than Mesa 8.0, including all DRI1 support Add support for VK_VALVE_mutable_descriptor_type on RADV Removed classic OSMesa in favor of the newly improved gallium OSMesa VK_KHR_fragment_shading_rate on RADV (RDNA2 only) Freedreno a6xx exposes GL 3.3 Classic swrast dri driver removed in favor of gallium swrast (llvmpipe or softpipe) Panfrost g31/g52/g72 exposes ES 3.0 Panfrost t760+ exposes GL 3.1 (including on Bifrost) Sparse memory support on RADV Rapid packed math (16bit-vectorization) on RADV New features in Mesa 20.3: GL 4.5 on llvmpipe GL_INTEL_blackhole_render on radeonsi GL_NV_copy_depth_to_color for NIR GL_NV_half_float GL_NV_shader_atomic_int64 on radeonsi EGL_KHR_swap_buffers_with_damage on X11 (DRI3) VK_PRESENT_MODE_FIFO_RELAXED on X11 GLX_EXT_swap_control for DRI2 and DRI3 GLX_EXT_swap_control_tear for DRI3 VK_KHR_copy_commands2 on RADV VK_KHR_shader_terminate_invocation on RADV NGG GS support in ACO VK_KHR_shader_terminate_invocation on ANV driconf: add glx_extension_override driconf: add indirect_gl_extension_override VK_AMD_mixed_attachment_samples on RADV (GFX6-GFX7). GL_MESA_pack_invert on r100 and vieux GL_ANGLE_pack_reverse_row_order VK_EXT_shader_image_atomic_int64 on RADV New features in mesa 20.2: GL_ARB_compute_variable_group_size on Iris. GL_ARB_gpu_shader5 on llvmpipe GL_ARB_post_depth_coverage on llvmpipe GLES 3.2 on llvmpipe GL_EXT_shader_group_vote on GLES3. GL_EXT_texture_shadow_lod on llvmpipe VK_AMD_texture_gather_bias_lod on RADV. VK_AMD_gpu_shader_half_float on RADV/ACO. VK_AMD_gpu_shader_int16 on RADV/ACO. VK_EXT_extended_dynamic_state on ANV and RADV. VK_EXT_image_robustness on RADV. VK_EXT_private_data on ANV and RADV. VK_EXT_custom_border_color on ANV and RADV. VK_EXT_pipeline_creation_cache_control on ANV and RADV. VK_EXT_shader_demote_to_helper_invocation on RADV/LLVM. VK_EXT_subgroup_size_control on RADV/ACO. VK_GOOGLE_user_type on ANV and RADV. VK_KHR_shader_subgroup_extended_types on RADV/ACO. GL_ARB_gl_spirv on nvc0/nir. GL_ARB_spirv_extensions on nvc0/nir. RADV now uses ACO per default as backend RADV_DEBUG=llvm option to enable LLVM backend for RADV VK_EXT_image_robustness for ANV VK_EXT_shader_atomic_float on ANV VK_EXT_4444_formats on ANV and RADV. VK_KHR_memory_model on RADV. GL 4.5 on llvmpipe EGL_KHR_swap_buffers_with_damage on X11 (DRI3) New features in mesa 20.1: GL_ARB_compute_variable_group_size on i965. GL_EXT_depth_bounds_test on Iris. GL_EXT_texture_shadow_lod on radeonsi, nvc0. GL_NV_alpha_to_coverage_dither_control on radeonsi GL_NV_copy_image on all gallium drivers. GL_NV_pixel_buffer_object on all gallium drivers, i915, i965, swrast. GL_NV_viewport_array2 on nvc0 (GM200+). GL_NV_viewport_swizzle on nvc0 (GM200+). VK_AMD_memory_overallocation_behavior on RADV. VK_KHR_shader_non_semantic_info on Intel, RADV. GL_EXT_draw_instanced on gles2 VK_KHR_8bit_storage for ACO on GFX8+ VK_KHR_16bit_storage for ACO on GFX8+ (storageInputOutput16 is still unsupported) shaderInt16 for ACO on GFX9+ VK_KHR_shader_float16_int8 for ACO on GFX8+ (shaderFloat16 is still unsupported) VK_EXT_robustness2 on Intel, RADV. Add Rocket Lake (RKL) support on anvil and iris.
Diffstat (limited to 'graphics/MesaLib/patches/patch-src_util_u__thread.h')
-rw-r--r--graphics/MesaLib/patches/patch-src_util_u__thread.h108
1 files changed, 41 insertions, 67 deletions
diff --git a/graphics/MesaLib/patches/patch-src_util_u__thread.h b/graphics/MesaLib/patches/patch-src_util_u__thread.h
index 64db83fb096..d4e6882b489 100644
--- a/graphics/MesaLib/patches/patch-src_util_u__thread.h
+++ b/graphics/MesaLib/patches/patch-src_util_u__thread.h
@@ -1,95 +1,69 @@
-$NetBSD: patch-src_util_u__thread.h,v 1.4 2020/03/08 10:35:03 tnn Exp $
+$NetBSD: patch-src_util_u__thread.h,v 1.5 2022/03/13 15:50:05 tnn Exp $
Oracle Solaris has pthread_setname_np. illumos does not.
+(actually, newer Illumos does have it, but never mind.)
Don't hard error when there's no pthread_setname_np.
handle NetBSD-style pthread_setaffinity_np(3)
---- src/util/u_thread.h.orig 2020-03-05 21:34:32.000000000 +0000
+--- src/util/u_thread.h.orig 2021-08-04 18:49:29.374474500 +0000
+++ src/util/u_thread.h
-@@ -73,7 +73,7 @@ static inline thrd_t u_thread_create(int
+@@ -129,7 +129,7 @@ static inline thrd_t u_thread_create(int
static inline void u_thread_setname( const char *name )
{
#if defined(HAVE_PTHREAD)
-#if DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS
+#if DETECT_OS_LINUX || DETECT_OS_CYGWIN
- pthread_setname_np(pthread_self(), name);
- #elif DETECT_OS_FREEBSD || DETECT_OS_OPENBSD
- pthread_set_name_np(pthread_self(), name);
-@@ -104,6 +104,17 @@ static inline void
- util_pin_thread_to_L3(thrd_t thread, unsigned L3_index, unsigned cores_per_L3)
+ int ret = pthread_setname_np(pthread_self(), name);
+ if (ret == ERANGE) {
+ char buf[16];
+@@ -169,8 +169,32 @@ util_set_thread_affinity(thrd_t thread,
+ unsigned num_mask_bits)
{
#if defined(HAVE_PTHREAD_SETAFFINITY)
-+#if defined(__NetBSD__)
-+ cpuset_t *cpuset;
+- cpu_set_t cpuset;
++# if defined(__NetBSD__)
++ cpu_set_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;
++ if (old_mask) {
++ if (pthread_getaffinity_np(thread, cpuset_size(cpuset), cpuset) != 0)
++ return false;
- CPU_ZERO(&cpuset);
-@@ -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
-+#endif
- }
-
- /**
-@@ -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)
-+#if defined(__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 */
-+ }
-+ }
-+ }
++ memset(old_mask, 0, num_mask_bits / 8);
++ for (unsigned i = 0; i < num_mask_bits && i < CPU_SETSIZE; i++) {
++ if (cpuset_isset(i, cpuset))
++ old_mask[i / 32] |= 1u << (i % 32);
+ }
-+ cpuset_destroy(cpuset);
-+ return L3_index;
+ }
++
++ cpuset_zero(cpuset);
++ for (unsigned i = 0; i < num_mask_bits && i < CPU_SETSIZE; i++) {
++ if (mask[i / 32] & (1u << (i % 32)))
++ cpuset_set(i, cpuset);
++ }
++ int err = pthread_setaffinity_np(thread, cpuset_size(cpuset), cpuset);
+ cpuset_destroy(cpuset);
-+#else
- cpu_set_t cpuset;
-
- if (pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset) == 0) {
-@@ -144,6 +185,7 @@ util_get_L3_for_pinned_thread(thrd_t thr
- return L3_index;
++ return err == 0;
++# else
++ cpu_set_t cpuset;
+ if (old_mask) {
+ if (pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset) != 0)
+ return false;
+@@ -188,7 +212,7 @@ util_set_thread_affinity(thrd_t thread,
+ CPU_SET(i, &cpuset);
}
- #endif
-+#endif
- return -1;
- }
+ return pthread_setaffinity_np(thread, sizeof(cpuset), &cpuset) == 0;
+-
++# endif
+ #elif defined(_WIN32) && !defined(__CYGWIN__)
+ DWORD_PTR m = mask[0];
-@@ -155,7 +197,7 @@ util_get_L3_for_pinned_thread(thrd_t thr
+@@ -242,7 +266,7 @@ util_set_current_thread_affinity(const u
static inline int64_t
- u_thread_get_time_nano(thrd_t thread)
+ util_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)