pkgsrc-Changes archive

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

CVS commit: pkgsrc/graphics/MesaLib



Module Name:    pkgsrc
Committed By:   tnn
Date:           Sun Mar 13 15:50:05 UTC 2022

Modified Files:
        pkgsrc/graphics/MesaLib: Makefile PLIST distinfo options.mk
        pkgsrc/graphics/MesaLib/patches:
            patch-src_egl_drivers_dri2_platform__x11.c
            patch-src_glx_glxclient.h patch-src_glx_glxcurrent.c
            patch-src_glx_glxext.c patch-src_mapi_entry__x86-64__tls.h
            patch-src_mapi_entry__x86__tls.h patch-src_mapi_u__current.c
            patch-src_mesa_main_extensions.c patch-src_util_u__queue.c
            patch-src_util_u__thread.h
Removed Files:
        pkgsrc/graphics/MesaLib/patches: patch-src_amd_common_ac__debug.c
            patch-src_gallium_drivers_radeonsi_si__state__shaders.c
            patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
            patch-src_gallium_state__trackers_clover_util_range.hpp
            patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c
            patch-src_glx_dri__glx.c patch-src_intel_genxml_gen__sort__tags.py
            patch-src_mapi_glapi_gen_glX__XML.py
            patch-src_mapi_glapi_gen_gl__XML.py patch-src_mapi_u__current.h
            patch-src_mesa_main_macros.h patch-src_mesa_main_marshal.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 pkgsrc/graphics/MesaLib/Makefile
cvs rdiff -u -r1.46 -r1.47 pkgsrc/graphics/MesaLib/PLIST
cvs rdiff -u -r1.162 -r1.163 pkgsrc/graphics/MesaLib/distinfo
cvs rdiff -u -r1.82 -r1.83 pkgsrc/graphics/MesaLib/options.mk
cvs rdiff -u -r1.1 -r0 \
    pkgsrc/graphics/MesaLib/patches/patch-src_amd_common_ac__debug.c \
    pkgsrc/graphics/MesaLib/patches/patch-src_gallium_state__trackers_clover_util_range.hpp \
    pkgsrc/graphics/MesaLib/patches/patch-src_glx_dri__glx.c \
    pkgsrc/graphics/MesaLib/patches/patch-src_intel_genxml_gen__sort__tags.py \
    pkgsrc/graphics/MesaLib/patches/patch-src_mapi_glapi_gen_glX__XML.py \
    pkgsrc/graphics/MesaLib/patches/patch-src_mapi_glapi_gen_gl__XML.py \
    pkgsrc/graphics/MesaLib/patches/patch-src_mesa_main_marshal.h
cvs rdiff -u -r1.3 -r1.4 \
    pkgsrc/graphics/MesaLib/patches/patch-src_egl_drivers_dri2_platform__x11.c \
    pkgsrc/graphics/MesaLib/patches/patch-src_mapi_u__current.c
cvs rdiff -u -r1.2 -r0 \
    pkgsrc/graphics/MesaLib/patches/patch-src_gallium_drivers_radeonsi_si__state__shaders.c \
    pkgsrc/graphics/MesaLib/patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp \
    pkgsrc/graphics/MesaLib/patches/patch-src_mesa_main_macros.h
cvs rdiff -u -r1.5 -r0 \
    pkgsrc/graphics/MesaLib/patches/patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c
cvs rdiff -u -r1.2 -r1.3 \
    pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxclient.h \
    pkgsrc/graphics/MesaLib/patches/patch-src_mesa_main_extensions.c \
    pkgsrc/graphics/MesaLib/patches/patch-src_util_u__queue.c
cvs rdiff -u -r1.4 -r1.5 \
    pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxcurrent.c \
    pkgsrc/graphics/MesaLib/patches/patch-src_util_u__thread.h
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxext.c
cvs rdiff -u -r1.5 -r1.6 \
    pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86-64__tls.h
cvs rdiff -u -r1.6 -r1.7 \
    pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86__tls.h
cvs rdiff -u -r1.3 -r0 \
    pkgsrc/graphics/MesaLib/patches/patch-src_mapi_u__current.h

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

Modified files:

Index: pkgsrc/graphics/MesaLib/Makefile
diff -u pkgsrc/graphics/MesaLib/Makefile:1.198 pkgsrc/graphics/MesaLib/Makefile:1.199
--- pkgsrc/graphics/MesaLib/Makefile:1.198      Wed Dec  8 16:04:48 2021
+++ pkgsrc/graphics/MesaLib/Makefile    Sun Mar 13 15:50:05 2022
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.198 2021/12/08 16:04:48 adam Exp $
+# $NetBSD: Makefile,v 1.199 2022/03/13 15:50:05 tnn Exp $
 
-DISTNAME=      mesa-20.0.6
+DISTNAME=      mesa-21.3.7
 PKGNAME=       ${DISTNAME:S/mesa/MesaLib/}
-PKGREVISION=   2
 CATEGORIES=    graphics
 MASTER_SITES=  https://mesa.freedesktop.org/archive/
 EXTRACT_SUFX=  .tar.xz
@@ -35,51 +34,43 @@ MESA_PLATFORMS=             #
 .include "options.mk"
 
 PLIST_SUBST+=  GLVER="1.2.0"
+PLIST_SUBST+=  MACHINE_ARCH=${MACHINE_ARCH}
 
 # classic DRI drivers
-PLIST_VARS+=           i915 i965 r100 r200 nouveau_dri
+PLIST_VARS+=           i830 i915 i965 r100 r200 nouveau_dri
 
 # Gallium drivers
-PLIST_VARS+=           r300 svga nouveau vc4 lima panfrost
+PLIST_VARS+=           r300 svga nouveau iris
 
 # other features
-PLIST_VARS+=           kms vaapi
+PLIST_VARS+=           arm kms vaapi
 
 .if ${MESALIB_SUPPORTS_DRI} == "yes"
 BUILDLINK_API_DEPENDS.libdrm+= libdrm>=2.4.100
 .include "../../x11/libdrm/buildlink3.mk"
-MESA_PLATFORMS+=       drm surfaceless
+.  if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+.    include "../../sysutils/libpciaccess/buildlink3.mk"
+.  endif
 MESON_ARGS+=           -Degl=true
 MESON_ARGS+=           -Dgbm=true
-MESON_ARGS+=           -Dgallium-xa=true
+MESON_ARGS+=           -Dgallium-xa=enabled
 .  if ${X11_TYPE} == "native" && !exists(${X11BASE}/include/xcb/dri3.h)
 MESON_ARGS+=           -Ddri3=false
 .  endif
 PLIST.kms=             yes
 .  if !empty(MACHINE_ARCH:M*arm*) || \
       ${MACHINE_CPU} == "aarch64"
-# ARM Mali Utgard
-GALLIUM_DRIVERS+=      lima
-PLIST.lima=            yes
-# ARM Mali Midgard, Bifrost
-GALLIUM_DRIVERS+=      panfrost
-PLIST.panfrost=                yes
-# Vivante GCxxx
-#GALLIUM_DRIVERS+=     etnaviv
-#PLIST.etnaviv=                yes
-# Qualcomm Snapdragon
-#GALLIUM_DRIVERS+=     freedreno
-#PLIST.freedreno=      yes
-# Broadcom VideoCore 4
-GALLIUM_DRIVERS+=      vc4
-PLIST.vc4=             yes
+GALLIUM_DRIVERS+=      freedreno vc4 etnaviv tegra panfrost lima
+PLIST.arm=             yes
 .  endif
 .  if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
-GALLIUM_DRIVERS+=      svga
+GALLIUM_DRIVERS+=      svga iris
 DRI_DRIVERS+=          i915 i965
 PLIST.svga=            yes
+PLIST.i830=            yes
 PLIST.i915=            yes
 PLIST.i965=            yes
+PLIST.iris=            yes
 .  endif
 # FreeBSD lacks nouveau support (there are official binaries from Nvidia)
 .  if ${OPSYS} != "FreeBSD"
@@ -107,14 +98,14 @@ PLIST.r300=                yes
 .  if ${VAAPI_AVAILABLE} == "yes" && \
       !(empty(GALLIUM_DRIVERS:Mr600) && empty(GALLIUM_DRIVERS:Mradeonsi) && \
         empty(GALLIUM_DRIVERS:Mnouveau))
-MESON_ARGS+=           -Dgallium-va=true
+MESON_ARGS+=           -Dgallium-va=enabled
 PLIST.vaapi=           yes
+BUILDLINK_API_DEPENDS.libva+=  libva>=2.13.0
 .    include "../../multimedia/libva/buildlink3.mk"
 .  else
-MESON_ARGS+=           -Dgallium-va=false
+MESON_ARGS+=           -Dgallium-va=disabled
 .  endif
 .else
-MESA_PLATFORMS+=       surfaceless
 MESON_ARGS+=           -Degl=false
 MESON_ARGS+=           -Dgbm=false
 .endif # ${MESALIB_SUPPORTS_DRI} == "yes"
@@ -132,7 +123,7 @@ CXXFLAGS+=  -march=i586
 
 MESON_ARGS+=   -Dgles1=true
 MESON_ARGS+=   -Dgles2=true
-MESON_ARGS+=   -Dosmesa=gallium
+MESON_ARGS+=   -Dosmesa=true
 MESON_ARGS+=   -Dshared-glapi=true
 MESON_ARGS+=   -Dgallium-xvmc=false
 

Index: pkgsrc/graphics/MesaLib/PLIST
diff -u pkgsrc/graphics/MesaLib/PLIST:1.46 pkgsrc/graphics/MesaLib/PLIST:1.47
--- pkgsrc/graphics/MesaLib/PLIST:1.46  Sat Nov 30 11:02:39 2019
+++ pkgsrc/graphics/MesaLib/PLIST       Sun Mar 13 15:50:05 2022
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.46 2019/11/30 11:02:39 nia Exp $
+@comment $NetBSD: PLIST,v 1.47 2022/03/13 15:50:05 tnn Exp $
 ${PLIST.kms}include/EGL/egl.h
 ${PLIST.kms}include/EGL/eglext.h
 ${PLIST.kms}include/EGL/eglextchromium.h
@@ -28,14 +28,35 @@ ${PLIST.kms}include/gbm.h
 ${PLIST.kms}include/xa_composite.h
 ${PLIST.kms}include/xa_context.h
 ${PLIST.kms}include/xa_tracker.h
+${PLIST.arm}lib/dri/armada-drm_dri.so
+${PLIST.arm}lib/dri/etnaviv_dri.so
+${PLIST.arm}lib/dri/exynos_dri.so
+${PLIST.arm}lib/dri/hx8357d_dri.so
+${PLIST.i830}lib/dri/i830_dri.so
 ${PLIST.i915}lib/dri/i915_dri.so
 ${PLIST.i965}lib/dri/i965_dri.so
+${PLIST.arm}lib/dri/ili9225_dri.so
+${PLIST.arm}lib/dri/ili9341_dri.so
+${PLIST.arm}lib/dri/imx-dcss_dri.so
+${PLIST.arm}lib/dri/imx-drm_dri.so
+${PLIST.arm}lib/dri/ingenic-drm_dri.so
+${PLIST.iris}lib/dri/iris_dri.so
+${PLIST.arm}lib/dri/kgsl_dri.so
+${PLIST.arm}lib/dri/kirin_dri.so
 ${PLIST.kms}lib/dri/kms_swrast_dri.so
-${PLIST.lima}lib/dri/lima_dri.so
+${PLIST.arm}lib/dri/lima_dri.so
+${PLIST.arm}lib/dri/mali-dp_dri.so
+${PLIST.arm}lib/dri/mcde_dri.so
+${PLIST.arm}lib/dri/mediatek_dri.so
+${PLIST.arm}lib/dri/meson_dri.so
+${PLIST.arm}lib/dri/mi0283qt_dri.so
+${PLIST.arm}lib/dri/msm_dri.so
+${PLIST.arm}lib/dri/mxsfb-drm_dri.so
 ${PLIST.nouveau}lib/dri/nouveau_dri.so
 ${PLIST.nouveau}${PLIST.vaapi}lib/dri/nouveau_drv_video.so
 ${PLIST.nouveau_dri}lib/dri/nouveau_vieux_dri.so
-${PLIST.panfrost}lib/dri/panfrost_dri.so
+${PLIST.arm}lib/dri/panfrost_dri.so
+${PLIST.arm}lib/dri/pl111_dri.so
 ${PLIST.r200}lib/dri/r200_dri.so
 ${PLIST.r300}lib/dri/r300_dri.so
 ${PLIST.r600}lib/dri/r600_dri.so
@@ -43,8 +64,15 @@ ${PLIST.r600}${PLIST.vaapi}lib/dri/r600_
 ${PLIST.r100}lib/dri/radeon_dri.so
 ${PLIST.radeonsi}lib/dri/radeonsi_dri.so
 ${PLIST.r600}${PLIST.vaapi}lib/dri/radeonsi_drv_video.so
+${PLIST.arm}lib/dri/repaper_dri.so
+${PLIST.arm}lib/dri/rockchip_dri.so
+${PLIST.arm}lib/dri/st7586_dri.so
+${PLIST.arm}lib/dri/st7735r_dri.so
+${PLIST.arm}lib/dri/stm_dri.so
+${PLIST.arm}lib/dri/sun4i-drm_dri.so
 lib/dri/swrast_dri.so
-${PLIST.vc4}lib/dri/vc4_dri.so
+${PLIST.arm}lib/dri/tegra_dri.so
+${PLIST.arm}lib/dri/vc4_dri.so
 ${PLIST.svga}lib/dri/vmwgfx_dri.so
 ${PLIST.kms}lib/libEGL.so
 ${PLIST.kms}lib/libEGL.so.1
@@ -67,6 +95,11 @@ ${PLIST.kms}lib/libgbm.so.1.0.0
 lib/libglapi.so
 lib/libglapi.so.0
 lib/libglapi.so.0.0.0
+${PLIST.vulkan}${PLIST.arm}lib/libvulkan_broadcom.so
+${PLIST.vulkan}${PLIST.arm}lib/libvulkan_freedreno.so
+${PLIST.vulkan_intel}lib/libvulkan_intel.so
+${PLIST.vulkan}lib/libvulkan_lvp.so
+${PLIST.vulkan}lib/libvulkan_radeon.so
 ${PLIST.kms}lib/libxatracker.so
 ${PLIST.kms}lib/libxatracker.so.2
 ${PLIST.kms}lib/libxatracker.so.2.5.0
@@ -95,3 +128,8 @@ ${PLIST.radeonsi}${PLIST.vdpau}lib/vdpau
 ${PLIST.radeonsi}${PLIST.vdpau}lib/vdpau/libvdpau_radeonsi.so.1.0
 ${PLIST.radeonsi}${PLIST.vdpau}lib/vdpau/libvdpau_radeonsi.so.1.0.0
 share/examples/mesa/00-mesa-defaults.conf
+${PLIST.vulkan}${PLIST.arm}share/vulkan/icd.d/broadcom_icd.${MACHINE_ARCH}.json
+${PLIST.vulkan}${PLIST.arm}share/vulkan/icd.d/freedreno_icd.${MACHINE_ARCH}.json
+${PLIST.vulkan_intel}share/vulkan/icd.d/intel_icd.${MACHINE_ARCH}.json
+${PLIST.vulkan}share/vulkan/icd.d/lvp_icd.${MACHINE_ARCH}.json
+${PLIST.vulkan}share/vulkan/icd.d/radeon_icd.${MACHINE_ARCH}.json

Index: pkgsrc/graphics/MesaLib/distinfo
diff -u pkgsrc/graphics/MesaLib/distinfo:1.162 pkgsrc/graphics/MesaLib/distinfo:1.163
--- pkgsrc/graphics/MesaLib/distinfo:1.162      Thu Dec 23 20:29:09 2021
+++ pkgsrc/graphics/MesaLib/distinfo    Sun Mar 13 15:50:05 2022
@@ -1,44 +1,44 @@
-$NetBSD: distinfo,v 1.162 2021/12/23 20:29:09 nia Exp $
+$NetBSD: distinfo,v 1.163 2022/03/13 15:50:05 tnn Exp $
 
-BLAKE2s (mesa-20.0.6.tar.xz) = 84bdac00a14b37b598d9077448f0013439ee76db1a2f9cbc60b1b8b12838c61c
-SHA512 (mesa-20.0.6.tar.xz) = a93dc3ed57ed7469b7c60cdbdcf4f29c5da4ec3986171c7b534e009e136ca21fec16207ffab38a6747437a9b1060e2e6c4b74c4e5cdc168b9aba0fc1940b5e90
-Size (mesa-20.0.6.tar.xz) = 12275708 bytes
-SHA1 (patch-src_amd_common_ac__debug.c) = 8233367c3b5bc344442ea8d19488fdd1e3791ae9
+BLAKE2s (mesa-21.3.7.tar.xz) = 5f14af06f483f145dcf442b66e408fc02980a7f69df343ac96686a6f01228719
+SHA512 (mesa-21.3.7.tar.xz) = 0991543e9435457fa4d077517408b3f197be32ed61a6c7ca34ddb3906eed208791f1a57227f74115f99df18e612efab1d2c6809b7cf426d273633b53d4aefc88
+Size (mesa-21.3.7.tar.xz) = 16569592 bytes
 SHA1 (patch-src_compiler_builtin__type__macros.h) = e4868011711fb89a293580a12eb603b8e7162336
+SHA1 (patch-src_drm-shim_drm__shim.c) = 6884d31dc3e9d47aac1785589ab289a601e64545
 SHA1 (patch-src_egl_drivers_dri2_platform__drm.c) = 9230fbae2c04246ebca8437ecad694bbae857fbe
-SHA1 (patch-src_egl_drivers_dri2_platform__x11.c) = 49e48c31eacb79d1da357fe70eaffd2926b5280e
+SHA1 (patch-src_egl_drivers_dri2_platform__x11.c) = ccf7c3ba7bdac39f9924102868f30afd7f4f05a2
 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_freedreno_freedreno__screen.c) = 2d31c6d5b5271ad108f73234de34618f583e3e43
+SHA1 (patch-src_gallium_drivers_freedreno_freedreno__util.h) = 51f082b91b3015b99ed28a016eda2f0f1eaef675
 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_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_gallium_frontends_clover_util_range.hpp) = c1bd73721482642e62378c70cbe245c304c36d4f
+SHA1 (patch-src_gallium_frontends_osmesa_osmesa.c) = 36631301b02cf89f152925b62f538a3c0b6ab601
+SHA1 (patch-src_glx_dri__common.c) = 7fa80f8da89ba90649db170e45c8e842cf69c1eb
 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_glx_glxclient.h) = 7b59d5632e35aa945ad77cd5d1d2fc2e7711e82b
+SHA1 (patch-src_glx_glxcurrent.c) = bc844ab6bfe32c0a322ff0fc2c1405b67b90b64a
+SHA1 (patch-src_glx_glxext.c) = 1eacf9062b5926ea6c756e769bf6eebc7671ccba
 SHA1 (patch-src_intel_compiler_brw__fs__bank__conflicts.cpp) = 6276d2c6846bb4dd08699921bec4e20202a17478
-SHA1 (patch-src_intel_genxml_gen__sort__tags.py) = e50d30fe74b09b100049e61660aa3606469a4047
 SHA1 (patch-src_intel_tools_aubinator__error__decode.c) = d8f636e3c3e76763a505a1dce23de0b198ad62fa
-SHA1 (patch-src_mapi_entry__x86-64__tls.h) = cbbb95b96414609a9cd05af75c9544f8e6938280
-SHA1 (patch-src_mapi_entry__x86__tls.h) = d85680aa658d159017e8bad1589f95f3830ac577
-SHA1 (patch-src_mapi_glapi_gen_glX__XML.py) = 5b71960652c8bd1038695a51366635d00761aeeb
-SHA1 (patch-src_mapi_glapi_gen_gl__XML.py) = 505ba3d98f8b0b05d652c05dd52997bf5323d0fb
-SHA1 (patch-src_mapi_u__current.c) = 4e3ec6e253af3737f77ecd43e56044ba2b81e699
-SHA1 (patch-src_mapi_u__current.h) = 9f4744681381a0959fda2926a436f296c89577f3
-SHA1 (patch-src_mesa_main_extensions.c) = 2f48bdb1176c2878bb33bcfab7556172b50a987e
-SHA1 (patch-src_mesa_main_macros.h) = c5dceaa8dc02a58e5b2273d82e3fe1cc12e327d3
-SHA1 (patch-src_mesa_main_marshal.h) = 4e4c08796a61aaa9f2463a9797e382e2e29860e9
+SHA1 (patch-src_mapi_entry__x86-64__tls.h) = f3e93565a2247b47495489f2dbecdc354d4a21a0
+SHA1 (patch-src_mapi_entry__x86__tls.h) = 1ca12843b7214831c25c5cdd7860dad94312c118
+SHA1 (patch-src_mapi_u__current.c) = f10d7d56d773a30ec4f24ffc41ae68104e173a47
+SHA1 (patch-src_mesa_main_context.c) = ae26f984b30369554a0e24d03006533c75e56a9b
+SHA1 (patch-src_mesa_main_extensions.c) = 8a6094690864289393315bd0ccc4ebd1e0c59ca5
+SHA1 (patch-src_mesa_main_formats.c) = b0c31116767422efe732bc77136b03b2fddfba31
 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) = 7a9547bbda9d2fb9f0018ccf27b70b59e497aa2c
+SHA1 (patch-src_util_disk__cache__os.c) = 2b87c69d99e0ecf1991a6e7f3b96605887e0b2f2
+SHA1 (patch-src_util_libsync.h) = 6711d79d9011c3ba6a592ed1639c7be811aee8b4
 SHA1 (patch-src_util_strndup.h) = 73f49694ca48ad6b9a9d8346c5b84fddec2463bd
 SHA1 (patch-src_util_u__atomic.h) = 31d4514538ef5ee53012695eb5c66134aaec981e
-SHA1 (patch-src_util_u__queue.c) = fe9515e8fca597962b25a60ae8f2c4cd0c61c251
-SHA1 (patch-src_util_u__thread.h) = be9107c879e7f8506aeafd3bb7e6165b74f78c46
+SHA1 (patch-src_util_u__printf.h) = 3b19d079d3857612be3cb1b5c1edb5384cd4d6fd
+SHA1 (patch-src_util_u__process.c) = 9b785d660f3d55803315598a66370139fcd9168f
+SHA1 (patch-src_util_u__queue.c) = e8d6b00473a16b6a32dcacd5ae092326fb2adb84
+SHA1 (patch-src_util_u__thread.h) = 996a51b8570cb019b9ed5ce9f3653488ce26b2df

Index: pkgsrc/graphics/MesaLib/options.mk
diff -u pkgsrc/graphics/MesaLib/options.mk:1.82 pkgsrc/graphics/MesaLib/options.mk:1.83
--- pkgsrc/graphics/MesaLib/options.mk:1.82     Thu Jul 22 10:34:01 2021
+++ pkgsrc/graphics/MesaLib/options.mk  Sun Mar 13 15:50:05 2022
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.82 2021/07/22 10:34:01 tnn Exp $
+# $NetBSD: options.mk,v 1.83 2022/03/13 15:50:05 tnn Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.MesaLib
 
@@ -63,14 +63,13 @@ BUILDLINK_TRANSFORM+=       rm:-DUSE_ELF_TLS
 # LLVM support
 #
 .if !empty(PKG_OPTIONS:Mllvm)
-MESON_ARGS+=           -Dllvm=true
-BUILDLINK_API_DEPENDS.libLLVM+=        libLLVM>=7.0.1nb2
+MESON_ARGS+=           -Dllvm=enabled
 .  include "../../devel/libelf/buildlink3.mk"
 .  include "../../lang/libLLVM/buildlink3.mk"
 
 .  if ${OPSYS} != "Darwin" && ${OPSYS} != "Cygwin"
 # This is the latest libdrm requirement for amdgpu.
-BUILDLINK_API_DEPENDS.libdrm+= libdrm>=2.4.99
+BUILDLINK_API_DEPENDS.libdrm+= libdrm>=2.4.107
 
 PLIST.r600=            yes
 GALLIUM_DRIVERS+=      r600
@@ -78,16 +77,25 @@ PLIST.radeonsi=             yes
 GALLIUM_DRIVERS+=      radeonsi
 .  endif
 .else
-MESON_ARGS+=           -Dllvm=false
+MESON_ARGS+=           -Dllvm=disabled
 .endif
 
 #
 # Vulkan support - experimental
 #
+PLIST_VARS+=            vulkan vulkan_intel
 .if !empty(PKG_OPTIONS:Mvulkan)
-MESON_ARGS+=           -Dvulkan-drivers="auto"
-.else
-MESON_ARGS+=           -Dvulkan-drivers=""
+VULKAN_DRIVERS+=       amd
+VULKAN_DRIVERS+=       swrast
+PLIST.vulkan=          yes
+.  if ${MACHINE_ARCH} == "x86_64"
+VULKAN_DRIVERS+=       intel
+PLIST.vulkan_intel=    yes
+.  endif
+.  if ${MACHINE_ARCH} == "aarch64"
+VULKAN_DRIVERS+=       broadcom
+VULKAN_DRIVERS+=       freedreno
+.  endif
 .endif
 
 #

Index: pkgsrc/graphics/MesaLib/patches/patch-src_egl_drivers_dri2_platform__x11.c
diff -u pkgsrc/graphics/MesaLib/patches/patch-src_egl_drivers_dri2_platform__x11.c:1.3 pkgsrc/graphics/MesaLib/patches/patch-src_egl_drivers_dri2_platform__x11.c:1.4
--- pkgsrc/graphics/MesaLib/patches/patch-src_egl_drivers_dri2_platform__x11.c:1.3      Wed Aug 21 13:35:28 2019
+++ pkgsrc/graphics/MesaLib/patches/patch-src_egl_drivers_dri2_platform__x11.c  Sun Mar 13 15:50:05 2022
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_egl_drivers_dri2_platform__x11.c,v 1.3 2019/08/21 13:35:28 nia Exp $
+$NetBSD: patch-src_egl_drivers_dri2_platform__x11.c,v 1.4 2022/03/13 15:50:05 tnn Exp $
 
 Provide compat strndup for older Darwin.
 
@@ -15,9 +15,9 @@ 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.orig   2021-07-14 20:04:46.732922600 +0000
 +++ src/egl/drivers/dri2/platform_x11.c
-@@ -608,6 +608,23 @@ dri2_x11_local_authenticate(struct dri2_
+@@ -628,6 +628,23 @@ dri2_x11_local_authenticate(struct dri2_
     return EGL_TRUE;
  }
  
@@ -41,20 +41,23 @@ without DRI3 support.
  static EGLBoolean
  dri2_x11_connect(struct dri2_egl_display *dri2_dpy)
  {
-@@ -1466,8 +1483,15 @@ dri2_initialize_x11(_EGLDriver *drv, _EG
+@@ -1539,9 +1556,17 @@ dri2_initialize_x11(_EGLDisplay *disp)
+       return dri2_initialize_x11_swrast(disp);
  
-    if (!disp->Options.ForceSoftware) {
  #ifdef HAVE_DRI3
--      if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
+-   if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
+-      if (dri2_initialize_x11_dri3(disp))
++
 +#if ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)) || defined(__DragonFly__) || defined(__NetBSD__)
-+      if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false))
++   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");
++   if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false)) {
++      _eglLog(_EGL_INFO, "platform_x11.c: calling dri2_initialize_x11_dri3\n");
++      if (dri2_initialize_x11_dri3(disp)) {
++         _eglLog(_EGL_INFO, "platform_x11.c: initialized by dri2_initialize_x11_dri3\n");
+          return EGL_TRUE;
 +      }
++   }
  #endif
  
-       if (!initialized)
+    if (!env_var_as_boolean("LIBGL_DRI2_DISABLE", false))
Index: pkgsrc/graphics/MesaLib/patches/patch-src_mapi_u__current.c
diff -u pkgsrc/graphics/MesaLib/patches/patch-src_mapi_u__current.c:1.3 pkgsrc/graphics/MesaLib/patches/patch-src_mapi_u__current.c:1.4
--- pkgsrc/graphics/MesaLib/patches/patch-src_mapi_u__current.c:1.3     Fri Oct 18 09:57:07 2019
+++ pkgsrc/graphics/MesaLib/patches/patch-src_mapi_u__current.c Sun Mar 13 15:50:05 2022
@@ -1,23 +1,23 @@
-$NetBSD: patch-src_mapi_u__current.c,v 1.3 2019/10/18 09:57:07 nia Exp $
+$NetBSD: patch-src_mapi_u__current.c,v 1.4 2022/03/13 15:50:05 tnn Exp $
 
 NetBSD only supports zero-initialized initial-exec tls variables in conjuction
 with dlopen(3) at the moment.
 
---- src/mapi/u_current.c.orig  2019-10-09 16:52:00.000000000 +0000
+--- src/mapi/u_current.c.orig  2021-08-04 18:49:29.246474300 +0000
 +++ src/mapi/u_current.c
 @@ -101,7 +101,11 @@ extern void (*__glapi_noop_table[])(void
+ #if defined(USE_ELF_TLS)
  
- __thread struct _glapi_table *u_current_table
-     __attribute__((tls_model("initial-exec")))
+ __THREAD_INITIAL_EXEC struct _glapi_table *u_current_table
 +#if defined(__NetBSD__)
 +    = 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 *
+ __THREAD_INITIAL_EXEC void *u_current_context;
+ 
+@@ -251,7 +255,11 @@ struct _glapi_table *
  u_current_get_table_internal(void)
  {
  #if defined(USE_ELF_TLS)

Index: pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxclient.h
diff -u pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxclient.h:1.2 pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxclient.h:1.3
--- pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxclient.h:1.2       Wed Aug 21 13:35:28 2019
+++ pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxclient.h   Sun Mar 13 15:50:05 2022
@@ -1,13 +1,13 @@
-$NetBSD: patch-src_glx_glxclient.h,v 1.2 2019/08/21 13:35:28 nia Exp $
+$NetBSD: patch-src_glx_glxclient.h,v 1.3 2022/03/13 15:50:05 tnn 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.orig   2021-08-04 18:49:29.150474000 +0000
 +++ src/glx/glxclient.h
-@@ -661,7 +661,11 @@ extern void __glXSetCurrentContext(struc
- extern __thread void *__glX_tls_Context
-    __attribute__ ((tls_model("initial-exec")));
+@@ -648,7 +648,11 @@ extern void __glXSetCurrentContext(struc
+ 
+ extern __THREAD_INITIAL_EXEC void *__glX_tls_Context;
  
 +#if defined(__NetBSD__)
 +#  define __glXGetCurrentContext() (likely(__glX_tls_Context) ? __glX_tls_Context : (void*)&dummyContext)
Index: pkgsrc/graphics/MesaLib/patches/patch-src_mesa_main_extensions.c
diff -u pkgsrc/graphics/MesaLib/patches/patch-src_mesa_main_extensions.c:1.2 pkgsrc/graphics/MesaLib/patches/patch-src_mesa_main_extensions.c:1.3
--- pkgsrc/graphics/MesaLib/patches/patch-src_mesa_main_extensions.c:1.2        Wed Aug 21 13:35:28 2019
+++ pkgsrc/graphics/MesaLib/patches/patch-src_mesa_main_extensions.c    Sun Mar 13 15:50:05 2022
@@ -1,13 +1,13 @@
-$NetBSD: patch-src_mesa_main_extensions.c,v 1.2 2019/08/21 13:35:28 nia Exp $
+$NetBSD: patch-src_mesa_main_extensions.c,v 1.3 2022/03/13 15:50:05 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/mesa/main/extensions.c.orig    2018-02-09 02:17:59.000000000 +0000
+--- src/mesa/main/extensions.c.orig    2021-07-14 20:04:58.316035000 +0000
 +++ src/mesa/main/extensions.c
-@@ -203,7 +203,11 @@ set_extension(struct gl_extensions *ext,
+@@ -213,7 +213,11 @@ set_extension(struct gl_extensions *ext,
   * This string is allocated early during the first context creation by
   * _mesa_one_time_init_extension_overrides.
   */
@@ -18,11 +18,11 @@ https://bugs.freedesktop.org/show_bug.cg
 +#endif
  free_unknown_extensions_strings(void)
  {
-    free(unrecognized_extensions);
-@@ -293,7 +297,9 @@ _mesa_one_time_init_extension_overrides(
+    free(unrecognized_extensions.env);
+@@ -304,7 +308,9 @@ _mesa_one_time_init_extension_overrides(
        free(env);
     } else {
-       unrecognized_extensions = env;
+       unrecognized_extensions.env = env;
 +#if !defined(HAVE_NOATEXIT)
        atexit(free_unknown_extensions_strings);
 +#endif
Index: pkgsrc/graphics/MesaLib/patches/patch-src_util_u__queue.c
diff -u pkgsrc/graphics/MesaLib/patches/patch-src_util_u__queue.c:1.2 pkgsrc/graphics/MesaLib/patches/patch-src_util_u__queue.c:1.3
--- pkgsrc/graphics/MesaLib/patches/patch-src_util_u__queue.c:1.2       Sun Mar  8 10:35:03 2020
+++ pkgsrc/graphics/MesaLib/patches/patch-src_util_u__queue.c   Sun Mar 13 15:50:05 2022
@@ -1,13 +1,13 @@
-$NetBSD: patch-src_util_u__queue.c,v 1.2 2020/03/08 10:35:03 tnn Exp $
+$NetBSD: patch-src_util_u__queue.c,v 1.3 2022/03/13 15:50:05 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    2020-03-05 21:34:32.000000000 +0000
+--- src/util/u_queue.c.orig    2021-07-14 20:04:59.260044300 +0000
 +++ src/util/u_queue.c
-@@ -51,11 +51,22 @@ static once_flag atexit_once_flag = ONCE
+@@ -58,11 +58,22 @@ static once_flag atexit_once_flag = ONCE
  static struct list_head queue_list;
  static mtx_t exit_mutex = _MTX_INITIALIZER_NP;
  
@@ -30,7 +30,7 @@ https://bugs.freedesktop.org/show_bug.cg
     mtx_lock(&exit_mutex);
     /* Wait for all queues to assert idle. */
     LIST_FOR_EACH_ENTRY(iter, &queue_list, head) {
-@@ -68,7 +79,11 @@ static void
+@@ -75,7 +86,11 @@ static void
  global_init(void)
  {
     list_inithead(&queue_list);
@@ -42,29 +42,3 @@ https://bugs.freedesktop.org/show_bug.cg
  }
  
  static void
-@@ -249,12 +264,25 @@ util_queue_thread_func(void *input)
-       /* Don't inherit the thread affinity from the parent thread.
-        * Set the full mask.
-        */
-+#if defined(__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
- 

Index: pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxcurrent.c
diff -u pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxcurrent.c:1.4 pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxcurrent.c:1.5
--- pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxcurrent.c:1.4      Wed Feb 19 21:03:41 2020
+++ pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxcurrent.c  Sun Mar 13 15:50:05 2022
@@ -1,11 +1,11 @@
-$NetBSD: patch-src_glx_glxcurrent.c,v 1.4 2020/02/19 21:03:41 tnn Exp $
+$NetBSD: patch-src_glx_glxcurrent.c,v 1.5 2022/03/13 15:50:05 tnn 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  2019-12-04 22:10:12.000000000 +0000
+--- src/glx/glxcurrent.c.orig  2021-08-04 18:49:29.150474000 +0000
 +++ src/glx/glxcurrent.c
 @@ -40,6 +40,20 @@
  #include "glx_error.h"
@@ -28,14 +28,14 @@ with dlopen(3) at the moment.
  ** We setup some dummy structures here so that the API can be used
  ** even if no context is current.
  */
-@@ -77,7 +91,11 @@ _X_HIDDEN pthread_mutex_t __glXmutex = P
+@@ -76,7 +90,11 @@ _X_HIDDEN pthread_mutex_t __glXmutex = P
+  * \b never be \c NULL.  This is important!  Because of this
   * \c __glXGetCurrentContext can be implemented as trivial macro.
   */
- __thread void *__glX_tls_Context __attribute__ ((tls_model("initial-exec")))
 +#if defined(__NetBSD__)
-+   = NULL; /* non-zero initializers not supported with dlopen */
++__THREAD_INITIAL_EXEC void *__glX_tls_Context = NULL; /* non-zero initializers not supported with dlopen */
 +#else
-    = &dummyContext;
+ __THREAD_INITIAL_EXEC void *__glX_tls_Context = &dummyContext;
 +#endif
  
  _X_HIDDEN void
Index: pkgsrc/graphics/MesaLib/patches/patch-src_util_u__thread.h
diff -u pkgsrc/graphics/MesaLib/patches/patch-src_util_u__thread.h:1.4 pkgsrc/graphics/MesaLib/patches/patch-src_util_u__thread.h:1.5
--- pkgsrc/graphics/MesaLib/patches/patch-src_util_u__thread.h:1.4      Sun Mar  8 10:35:03 2020
+++ pkgsrc/graphics/MesaLib/patches/patch-src_util_u__thread.h  Sun Mar 13 15:50:05 2022
@@ -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)

Index: pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxext.c
diff -u pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxext.c:1.1 pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxext.c:1.2
--- pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxext.c:1.1  Wed Aug 21 13:35:28 2019
+++ pkgsrc/graphics/MesaLib/patches/patch-src_glx_glxext.c      Sun Mar 13 15:50:05 2022
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_glx_glxext.c,v 1.1 2019/08/21 13:35:28 nia Exp $
+$NetBSD: patch-src_glx_glxext.c,v 1.2 2022/03/13 15:50:05 tnn Exp $
 
 * Patch from FreeBSD ports graphics/mesa-dri 18.0.0
 
@@ -8,17 +8,9 @@ $NetBSD: patch-src_glx_glxext.c,v 1.1 20
 
 * 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.orig      2021-07-14 20:04:55.750010300 +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
+@@ -819,7 +819,11 @@ AllocAndFetchScreenConfigs(Display * dpy
  #if defined(GLX_USE_DRM)
  #if defined(HAVE_DRI3)
        if (priv->dri3Display)
@@ -30,7 +22,7 @@ $NetBSD: patch-src_glx_glxext.c,v 1.1 20
  #endif /* HAVE_DRI3 */
        if (psc == NULL && priv->dri2Display)
         psc = (*priv->dri2Display->createScreen) (i, priv);
-@@ -920,8 +925,13 @@ __glXInitialize(Display * dpy)
+@@ -925,8 +929,13 @@ __glXInitialize(Display * dpy)
  #if defined(GLX_USE_DRM)
     if (glx_direct && glx_accel) {
  #if defined(HAVE_DRI3)
@@ -43,5 +35,5 @@ $NetBSD: patch-src_glx_glxext.c,v 1.1 20
           dpyPriv->dri3Display = dri3_create_display(dpy);
 +      }
  #endif /* HAVE_DRI3 */
-       dpyPriv->dri2Display = dri2CreateDisplay(dpy);
-       dpyPriv->driDisplay = driCreateDisplay(dpy);
+       if (!env_var_as_boolean("LIBGL_DRI2_DISABLE", false))
+          dpyPriv->dri2Display = dri2CreateDisplay(dpy);

Index: pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86-64__tls.h
diff -u pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86-64__tls.h:1.5 pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86-64__tls.h:1.6
--- pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86-64__tls.h:1.5     Fri Feb 21 21:52:24 2020
+++ pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86-64__tls.h Sun Mar 13 15:50:05 2022
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_mapi_entry__x86-64__tls.h,v 1.5 2020/02/21 21:52:24 tnn Exp $
+$NetBSD: patch-src_mapi_entry__x86-64__tls.h,v 1.6 2022/03/13 15:50:05 tnn Exp $
 
 NetBSD only supports zero-initialized initial-exec tls variables in conjuction
 with dlopen(3) at the moment.
@@ -6,9 +6,9 @@ with dlopen(3) at the moment.
 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   2019-12-04 22:10:14.000000000 +0000
+--- src/mapi/entry_x86-64_tls.h.orig   2021-07-14 20:04:57.805030000 +0000
 +++ src/mapi/entry_x86-64_tls.h
-@@ -32,21 +32,33 @@
+@@ -38,22 +38,34 @@
  #endif
  
  __asm__(".text\n"
@@ -37,6 +37,7 @@ es1api and es2api are not going to be pa
 +   "jmp *(8 * " slot ")(%rax)"
 +#else
  #define STUB_ASM_CODE(slot)                              \
+    ENDBR                                                 \
     "movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t"  \
     "movq %fs:(%rax), %r11\n\t"                           \
     "jmp *(8 * " slot ")(%r11)"
@@ -44,7 +45,7 @@ es1api and es2api are not going to be pa
  
  #else
  
-@@ -77,7 +89,7 @@ x86_64_entry_start[] HIDDEN;
+@@ -85,7 +97,7 @@ x86_64_entry_start[] HIDDEN;
  mapi_func
  entry_get_public(int slot)
  {

Index: pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86__tls.h
diff -u pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86__tls.h:1.6 pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86__tls.h:1.7
--- pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86__tls.h:1.6        Sun Mar  8 10:35:03 2020
+++ pkgsrc/graphics/MesaLib/patches/patch-src_mapi_entry__x86__tls.h    Sun Mar 13 15:50:05 2022
@@ -1,11 +1,11 @@
-$NetBSD: patch-src_mapi_entry__x86__tls.h,v 1.6 2020/03/08 10:35:03 tnn Exp $
+$NetBSD: patch-src_mapi_entry__x86__tls.h,v 1.7 2022/03/13 15:50:05 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      2020-03-05 21:34:32.000000000 +0000
+--- src/mapi/entry_x86_tls.h.orig      2021-07-14 20:04:57.805030000 +0000
 +++ src/mapi/entry_x86_tls.h
-@@ -45,6 +45,25 @@ __asm__("x86_current_tls:\n\t"
+@@ -51,6 +51,25 @@ __asm__("x86_current_tls:\n\t"
        "movl " ENTRY_CURRENT_TABLE "@GOTNTPOFF(%eax), %eax\n\t"
        "ret");
  
@@ -31,7 +31,7 @@ with dlopen(3) at the moment.
  #ifndef GLX_X86_READONLY_TEXT
  __asm__(".section wtext, \"awx\", @progbits");
  #endif /* GLX_X86_READONLY_TEXT */
-@@ -58,6 +77,11 @@ __asm__(".balign 16\n"
+@@ -64,6 +83,11 @@ __asm__(".balign 16\n"
     ".balign 16\n"                \
     func ":"
  
@@ -41,9 +41,9 @@ with dlopen(3) at the moment.
 +   "jmp *(4 * " slot ")(%eax)"
 +#else
  #define STUB_ASM_CODE(slot)                                 \
+    ENDBR                                                    \
     "call 1f\n"                                              \
-    "1:\n\t"                                                 \
-@@ -66,6 +90,7 @@ __asm__(".balign 16\n"
+@@ -73,6 +97,7 @@ __asm__(".balign 16\n"
     "movl " ENTRY_CURRENT_TABLE "@GOTNTPOFF(%eax), %eax\n\t" \
     "movl %gs:(%eax), %eax\n\t"                              \
     "jmp *(4 * " slot ")(%eax)"



Home | Main Index | Thread Index | Old Index