diff --git a/graphics/mesa-dri/Makefile b/graphics/mesa-dri/Makefile index 0cb50722fb12..35969b09f5e5 100644 --- a/graphics/mesa-dri/Makefile +++ b/graphics/mesa-dri/Makefile @@ -1,156 +1,152 @@ PORTNAME= mesa-dri PORTVERSION= ${MESAVERSION} CATEGORIES= graphics COMMENT= OpenGL hardware acceleration drivers for DRI2+ WWW= https://www.mesa3d.org/ BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}ply>0:devel/py-ply@${PY_FLAVOR} LIB_DEPENDS+= libgallium-${MESAVERSION}.so:graphics/mesa-libs \ libgbm.so:graphics/mesa-libs USES+= llvm:lib,noexport OPTIONS_DEFINE= ZSTD OPTIONS_GROUP= GALLIUM PLATFORM VULKAN OPTIONS_DEFAULT= WAYLAND X11 ZSTD OPTIONS_SUB= yes ZSTD_DESC= Use ZSTD for shader cache ZSTD_LIB_DEPENDS= libzstd.so:archivers/zstd ZSTD_MESON_ENABLED= zstd OPTIONS_GROUP_PLATFORM= X11 WAYLAND X11_DESC= Enable X11 support for GBM/EGL WAYLAND_DESC= Enable Wayland support for GBM/EGL and Vulkan WAYLAND_BUILD_DEPENDS= wayland-protocols>=1.8:graphics/wayland-protocols WAYLAND_LIB_DEPENDS= libwayland-client.so:graphics/wayland OPTIONS_GROUP_GALLIUM= crocus i915 iris llvmpipe panfrost r300 r600 radeonsi svga zink GALLIUM_DESC= Unified OpenGL drivers crocus_DESC= Intel GPU Gen4 (Broadwater) to Gen7 (Haswell) i915_DESC= Intel GPU Gen3 (Grantsdale to Pineview) iris_DESC= Intel GPU Gen8 (Broadwell) and newer iris_BUILD_DEPENDS= libclc-${LLVM_PORT:T}>0:devel/libclc@${LLVM_PORT:T} \ spirv-tools>0:graphics/spirv-tools \ spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} iris_RUN_DEPENDS= spirv-tools>0:graphics/spirv-tools \ spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} iris_CONFIGURE_ENV= PKG_CONFIG_PATH="${LLVM_PREFIX}/libdata/pkgconfig" iris_IMPLIES= SPIRV llvmpipe_DESC= Software Rasterizer panfrost_DESC= ARM Midgard and Bifrost r300_DESC= AMD/ATI R300, R400 and R500 r600_DESC= AMD/ATI R600, R700, Evergreen, Northern Islands -r600_BUILD_DEPENDS= libva>=0:multimedia/libva \ - libvdpau>=0:multimedia/libvdpau -r600_MESON_ON= -Dgallium-va=enabled \ - -Dgallium-vdpau=enabled +r600_BUILD_DEPENDS= libva>=0:multimedia/libva +r600_MESON_ON= -Dgallium-va=enabled radeonsi_DESC= AMD/ATI Southern Islands and newer -radeonsi_BUILD_DEPENDS= libva>=0:multimedia/libva \ - libvdpau>=0:multimedia/libvdpau -radeonsi_MESON_ON= -Dgallium-va=enabled \ - -Dgallium-vdpau=enabled +radeonsi_BUILD_DEPENDS= libva>=0:multimedia/libva +radeonsi_MESON_ON= -Dgallium-va=enabled svga_DESC= VMWare Virtual GPU zink_DESC= OpenGL on top of Khronos’ Vulkan API OPTIONS_EXCLUDE+= ${ARCH:Marmv7:C/.+/crocus i915 iris panfrost r300 r600 radeonsi svga zink/} OPTIONS_EXCLUDE+= ${ARCH:Naarch64:C/.+/panfrost/} OPTIONS_EXCLUDE+= ${ARCH:Namd64:Ni386:Nx86_64:C/.+/crocus i915 iris svga/} MESON_ARGS+= -Dgallium-drivers=${GALLIUM_DRIVERS:ts,} . for _gd in ${OPTIONS_GROUP_GALLIUM} OPTIONS_DEFAULT+= ${_gd} ${_gd}_VARS+= GALLIUM_DRIVERS+=${_gd} . endfor OPTIONS_GROUP_VULKAN= anv radv swrast_vk VULKAN_DESC= Vulkan drivers anv_DESC= Intel GPU Gen9 and newer Vulkan support anv_BUILD_DEPENDS= glslangValidator:graphics/glslang \ libclc-${LLVM_PORT:T}>0:devel/libclc@${LLVM_PORT:T} \ spirv-tools>0:graphics/spirv-tools \ spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} anv_RUN_DEPENDS= spirv-tools>0:graphics/spirv-tools \ spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} anv_CONFIGURE_ENV= PKG_CONFIG_PATH="${LLVM_PREFIX}/libdata/pkgconfig" radv_DESC= AMD/ATI Southern Islands and newer Vulkan support radv_BUILD_DEPENDS= glslangValidator:graphics/glslang swrast_vk_DESC= Software Rasterizer Vulkan support OPTIONS_EXCLUDE+= ${ARCH:Marmv7:C/.+/anv radv/} OPTIONS_EXCLUDE+= ${ARCH:Namd64:Ni386:Nx86_64:C/.+/anv/} MESON_ARGS+= -Dvulkan-drivers=${VULKAN_DRIVERS:ts,} . for _vd in ${OPTIONS_GROUP_VULKAN} OPTIONS_DEFAULT+= ${_vd} ${_vd}_VARS+= VULKAN_DRIVERS+=${_vd:S/anv/intel/:S/radv/amd/:S/swrast_vk/swrast/} . endfor .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" LDFLAGS_i386= -Wl,-znotext .if ${PORT_OPTIONS:MX11} MESA_PLATFORMS+= x11 -USE_XORG+= xcb xorgproto xrandr x11 xdamage xext xfixes xshmfence xv +USE_XORG+= x11 xcb xdamage xext xfixes xorgproto xrandr xshmfence \ + xv xxf86vm .else MESON_ARGS+= -Dxlib-lease=disabled .endif .if ${PORT_OPTIONS:MWAYLAND} MESA_PLATFORMS+= wayland .endif MESON_ARGS+= -Dplatforms="${MESA_PLATFORMS:ts,:tl}" # Vulkan Video extensions (keep in sync with mesa-gallium-va) MESON_ARGS+= -Dvideo-codecs="vc1dec,h264dec,h264enc,h265dec,h265enc,av1dec,av1enc,vp9dec" # Disable some options MESON_ARGS+= -Dandroid-libbacktrace=disabled \ -Dgles1=enabled \ -Dgles2=enabled \ -Dglvnd=disabled \ -Dglx=disabled \ -Degl=enabled \ -Dlmsensors=disabled \ -Dmicrosoft-clc=disabled \ -Dvalgrind=disabled .if !${PORT_OPTIONS:Mr600} && !${PORT_OPTIONS:Mradeonsi} -MESON_ARGS+= -Dgallium-va=disabled \ - -Dgallium-vdpau=disabled +MESON_ARGS+= -Dgallium-va=disabled .endif .if ${ARCH} != amd64 MESON_ARGS+= -Dintel-rt=disabled # https://gitlab.freedesktop.org/mesa/mesa/-/issues/10629 .endif .for _gd in ${OPTIONS_GROUP_GALLIUM} . if defined(GALLIUM_DRIVERS) && ${GALLIUM_DRIVERS:M${_gd}} PLIST_SUB+= ${_gd}="" . else PLIST_SUB+= ${_gd}="@comment " . endif .endfor -PLIST_SUB += ARCH=${ARCH:S/amd/x86_/} +PLIST_SUB+= ARCH=${ARCH:S/amd/x86_/} .for _vd in ${OPTIONS_GROUP_VULKAN} . if defined(VULKAN_DRIVERS) && ${VULKAN_DRIVERS:M${_vd}} PLIST_SUB+= ${_vd}="" . else PLIST_SUB+= ${_vd}="@comment " . endif .endfor post-install: # Mesa 25: libgallium-${MESAVERSION}.so and the gbm/GL/dri.pc/drirc bits # all belong to graphics/mesa-libs. Strip them from this port's stage tree. ${RM} -r ${STAGEDIR}${PREFIX}/include ${RM} ${STAGEDIR}${PREFIX}/lib/libgallium-${MESAVERSION}.so ${RM} -r ${STAGEDIR}${PREFIX}/lib/gbm ${RM} -r ${STAGEDIR}${PREFIX}/libdata/pkgconfig ${INSTALL_DATA} ${FILESDIR}/01-freebsd.conf \ ${STAGEDIR}${PREFIX}/share/drirc.d .include diff --git a/graphics/mesa-dri/Makefile.common b/graphics/mesa-dri/Makefile.common index 685026539c40..8b0d8c018ade 100644 --- a/graphics/mesa-dri/Makefile.common +++ b/graphics/mesa-dri/Makefile.common @@ -1,73 +1,75 @@ # Makefile.common - shared code between MesaLib ports. # # !!! Here be dragons !!! (they seem to be everywhere these days) # # Remember to upgrade the following ports everytime you bump MESAVERSION: # # - graphics/mesa-dri # - graphics/mesa-libs -MESAVERSION= 25.2.8 +MESAVERSION= 26.0.6 MASTER_SITES= https://mesa.freedesktop.org/archive/ DISTFILES= mesa-${MESAVERSION}${EXTRACT_SUFX} MAINTAINER= x11@FreeBSD.org LICENSE= MIT LICENSE_FILE= ${WRKSRC}/docs/license.rst COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//} BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pyyaml>0:devel/py-pyyaml@${PY_FLAVOR} .if ${COMPONENT} != clover .if ${PORT_OPTIONS:MX11} USES+= xorg .endif .endif -LIB_DEPENDS+= libdrm.so:graphics/libdrm -LIB_DEPENDS+= libexpat.so:textproc/expat2 +LIB_DEPENDS+= libdrm.so:graphics/libdrm \ + libexpat.so:textproc/expat2 USES+= compiler:c++11-lib bison meson pathfix pkgconfig \ python:build shebangfix tar:xz # only have one port to check with portscout. .if ${PORTNAME} != mesa-dri PORTSCOUT= ignore:1 .endif MASTERDIR= ${.CURDIR:H:H}/graphics/mesa-dri PATCHDIR= ${MASTERDIR}/files WRKSRC= ${WRKDIR}/mesa-${MESAVERSION} DESCR= ${.CURDIR}/pkg-descr PLIST= ${.CURDIR}/pkg-plist PKGHELP= ${.CURDIR}/pkg-help PKGINSTALL= ${.CURDIR}/pkg-install PKGDEINSTALL= ${.CURDIR}/pkg-deinstall +LTO_UNSAFE= Upstream recommends against LTO https://gitlab.freedesktop.org/mesa/mesa/-/commit/cb571550cc63f6bb22e0212dc681d8a2cd90926c + .include BINARY_ALIAS+= python3=${PYTHON_VERSION} CONFIGURE_ENV+= LLVM_CONFIG=${LLVM_CONFIG} # mesa 25.x removed the -Dlibelf option; libelf is now auto-detected. # If the user has elfutils installed in LOCALBASE, propagate it as a # proper LIB_DEPENDS so the dependency is recorded. .if exists(${LOCALBASE}/include/libelf.h) LIB_DEPENDS+= libelf.so:devel/elfutils .endif # Some symbols in mesa's linker version scripts are not always defined, # depending on configuration options. Suppress errors with lld >= 17 due to # these undefined symbols. LDFLAGS+= -Wl,--undefined-version LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${LLVM_VERSION}/lib MESON_ARGS+= -Dllvm=enabled \ -Dlibunwind=disabled \ -Dgallium-mediafoundation=disabled diff --git a/graphics/mesa-dri/distinfo b/graphics/mesa-dri/distinfo index 39a69f4d89b2..d744da8c1a65 100644 --- a/graphics/mesa-dri/distinfo +++ b/graphics/mesa-dri/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1777655135 -SHA256 (mesa-25.2.8.tar.xz) = 097842f3e49d996868b38688db87b006f7d4541e93ce86d2f341d8b3e7be7c93 -SIZE (mesa-25.2.8.tar.xz) = 43813260 +TIMESTAMP = 1777621283 +SHA256 (mesa-26.0.6.tar.xz) = 1d3c3b8a8363b8cc354175bb4a684ad8b035211cc1d6fa17aeb9b9623c513f89 +SIZE (mesa-26.0.6.tar.xz) = 43944196 diff --git a/graphics/mesa-dri/files/patch-src_gallium_winsys_amdgpu_drm_amdgpu__bo.c b/graphics/mesa-dri/files/patch-src_gallium_winsys_amdgpu_drm_amdgpu__bo.c index 75994a00618e..75ef43aca99d 100644 --- a/graphics/mesa-dri/files/patch-src_gallium_winsys_amdgpu_drm_amdgpu__bo.c +++ b/graphics/mesa-dri/files/patch-src_gallium_winsys_amdgpu_drm_amdgpu__bo.c @@ -1,11 +1,11 @@ ---- src/gallium/winsys/amdgpu/drm/amdgpu_bo.c.orig 2024-02-16 16:21:40 UTC +--- src/gallium/winsys/amdgpu/drm/amdgpu_bo.c.orig 2026-04-15 14:20:41 UTC +++ src/gallium/winsys/amdgpu/drm/amdgpu_bo.c -@@ -709,7 +709,7 @@ struct pb_slab *amdgpu_bo_slab_alloc(void *priv, unsig +@@ -861,7 +861,7 @@ struct pb_slab *amdgpu_bo_slab_alloc(void *priv, unsig slab_bo->slab.group_index = group_index; slab_bo->slab.entry_size = entry_size; slab_bo->entries = os_malloc_aligned(slab_bo->slab.num_entries * sizeof(*slab_bo->entries), - CACHE_LINE_SIZE); + MESA_CACHE_LINE_SIZE); if (!slab_bo->entries) goto fail; diff --git a/graphics/mesa-dri/files/patch-src_intel_common_xe_intel__gem.c b/graphics/mesa-dri/files/patch-src_intel_common_xe_intel__gem.c index dbaa9564c9c5..d2f9a0fe5596 100644 --- a/graphics/mesa-dri/files/patch-src_intel_common_xe_intel__gem.c +++ b/graphics/mesa-dri/files/patch-src_intel_common_xe_intel__gem.c @@ -1,13 +1,12 @@ ---- src/intel/common/xe/intel_gem.c.orig 2024-05-22 09:48:39.000000000 -0700 -+++ src/intel/common/xe/intel_gem.c 2024-06-01 06:28:22.268439000 -0700 -@@ -69,8 +69,10 @@ +--- src/intel/common/xe/intel_gem.c.orig 2026-04-15 14:20:41 UTC ++++ src/intel/common/xe/intel_gem.c +@@ -72,7 +72,9 @@ xe_gem_read_correlate_cpu_gpu_timestamp(int fd, #endif case CLOCK_REALTIME: #ifdef CLOCK_BOOTTIME +#if !(defined(CLOCK_BOOTTIME) && CLOCK_BOOTTIME == CLOCK_MONOTONIC) case CLOCK_BOOTTIME: - #endif +#endif + #endif #ifdef CLOCK_TAI case CLOCK_TAI: - #endif diff --git a/graphics/mesa-dri/files/patch-src_util_u__memory.h b/graphics/mesa-dri/files/patch-src_util_u__memory.h index fcaec0a4a2d2..4eb7c96c0c23 100644 --- a/graphics/mesa-dri/files/patch-src_util_u__memory.h +++ b/graphics/mesa-dri/files/patch-src_util_u__memory.h @@ -1,27 +1,27 @@ ---- src/util/u_memory.h.orig 2023-11-29 19:30:57 UTC +--- src/util/u_memory.h.orig 2026-04-15 14:20:41 UTC +++ src/util/u_memory.h @@ -84,7 +84,7 @@ mem_dup(const void *src, size_t size) } /* TODO: this could be different on non-x86 architectures. */ -#define CACHE_LINE_SIZE 64 +#define MESA_CACHE_LINE_SIZE 64 /** * Declare a variable on its own cache line. @@ -101,12 +101,12 @@ mem_dup(const void *src, size_t size) * aligned, but we only want to align the field. */ #define EXCLUSIVE_CACHELINE(decl) \ - union { char __cl_space[CACHE_LINE_SIZE]; \ + union { char __cl_space[MESA_CACHE_LINE_SIZE]; \ decl; } /* Allocate a structure aligned to a cache line. (used to make atomic ops faster) */ -#define MALLOC_STRUCT_CL(T) (struct T *)align_malloc(sizeof(struct T), CACHE_LINE_SIZE) -#define CALLOC_STRUCT_CL(T) (struct T *)align_calloc(sizeof(struct T), CACHE_LINE_SIZE) +#define MALLOC_STRUCT_CL(T) (struct T *)align_malloc(sizeof(struct T), MESA_CACHE_LINE_SIZE) +#define CALLOC_STRUCT_CL(T) (struct T *)align_calloc(sizeof(struct T), MESA_CACHE_LINE_SIZE) #define FREE_CL(ptr) align_free(ptr) #ifdef __cplusplus diff --git a/graphics/mesa-dri/files/patch-src_vulkan_vram-report-limit-layer_vram__report__limit__layer.c b/graphics/mesa-dri/files/patch-src_vulkan_vram-report-limit-layer_vram__report__limit__layer.c new file mode 100644 index 000000000000..554601393c16 --- /dev/null +++ b/graphics/mesa-dri/files/patch-src_vulkan_vram-report-limit-layer_vram__report__limit__layer.c @@ -0,0 +1,11 @@ +--- src/vulkan/vram-report-limit-layer/vram_report_limit_layer.c.orig 2026-04-15 14:20:41 UTC ++++ src/vulkan/vram-report-limit-layer/vram_report_limit_layer.c +@@ -447,7 +447,7 @@ vram_report_limit_CreateInstance(const VkInstanceCreat + struct vram_report_limit_instance_data *instance_data = os_malloc_aligned( + sizeof(*instance_data) + sizeof(instance_data->active_pdevices_array[0]) * + active_pdevices_count, +- CACHE_LINE_SIZE); ++ MESA_CACHE_LINE_SIZE); + if (instance_data == NULL) { + result = VK_ERROR_OUT_OF_HOST_MEMORY; + goto err_free_is_pdevice_active_array; diff --git a/graphics/mesa-dri/files/patch-src_vulkan_wsi_wsi__common__wayland.c b/graphics/mesa-dri/files/patch-src_vulkan_wsi_wsi__common__wayland.c new file mode 100644 index 000000000000..caa289c7dac5 --- /dev/null +++ b/graphics/mesa-dri/files/patch-src_vulkan_wsi_wsi__common__wayland.c @@ -0,0 +1,21 @@ +../src/vulkan/wsi/wsi_common_wayland.c:1962:57: error: use of undeclared identifier 'CLOCK_MONOTONIC_RAW' + 1962 | if (clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_MONOTONIC_RAW) + | ^ +../src/vulkan/wsi/wsi_common_wayland.c:3601:12: error: use of undeclared identifier 'CLOCK_MONOTONIC_RAW' + 3601 | case CLOCK_MONOTONIC_RAW: + | ^ + +--- src/vulkan/wsi/wsi_common_wayland.c.orig 2026-04-15 14:20:41 UTC ++++ src/vulkan/wsi/wsi_common_wayland.c +@@ -68,6 +68,11 @@ + #include + #endif + ++/* The "RAW" clocks on Linux are called "FAST" on FreeBSD */ ++#if !defined(CLOCK_MONOTONIC_RAW) && defined(CLOCK_MONOTONIC_FAST) ++#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST ++#endif ++ + struct wsi_wayland; + + struct wsi_wl_format { diff --git a/graphics/mesa-dri/files/patch-userptr b/graphics/mesa-dri/files/patch-userptr new file mode 100644 index 000000000000..f5d0cc388fda --- /dev/null +++ b/graphics/mesa-dri/files/patch-userptr @@ -0,0 +1,100 @@ +Try unsynchronized userptr if regular one fails. +https://github.com/FreeBSDDesktop/kms-drm/issues/197 +https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13162 + +--- src/gallium/drivers/crocus/crocus_bufmgr.c.orig 2026-04-15 14:20:41 UTC ++++ src/gallium/drivers/crocus/crocus_bufmgr.c +@@ -487,8 +487,20 @@ crocus_bo_create_userptr(struct crocus_bufmgr *bufmgr, + .user_ptr = (uintptr_t)ptr, + .user_size = size, + }; +- if (intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_USERPTR, &arg)) ++ ++ int ret; ++retry: ++ ret = intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_USERPTR, &arg); ++ if (ret) { ++ if (errno == ENODEV && arg.flags == 0) { ++ arg.flags = I915_USERPTR_UNSYNCHRONIZED; ++ goto retry; ++ } ++ if (geteuid() != 0) { ++ fprintf(stderr, "%s", "ioctl(I915_GEM_USERPTR) failed. Try running as root but expect poor stability.\n"); ++ } + goto err_free; ++ } + bo->gem_handle = arg.handle; + + /* Check the buffer for validity before we try and use it in a batch */ +--- src/gallium/drivers/iris/i915/iris_kmd_backend.c.orig 2026-04-15 14:20:41 UTC ++++ src/gallium/drivers/iris/i915/iris_kmd_backend.c +@@ -443,8 +443,20 @@ i915_gem_create_userptr(struct iris_bufmgr *bufmgr, vo + .user_size = size, + .flags = devinfo->has_userptr_probe ? I915_USERPTR_PROBE : 0, + }; +- if (intel_ioctl(iris_bufmgr_get_fd(bufmgr), DRM_IOCTL_I915_GEM_USERPTR, &arg)) ++ ++ int ret; ++retry: ++ ret = intel_ioctl(iris_bufmgr_get_fd(bufmgr), DRM_IOCTL_I915_GEM_USERPTR, &arg); ++ if (ret) { ++ if (errno == ENODEV && arg.flags == 0) { ++ arg.flags = I915_USERPTR_UNSYNCHRONIZED; ++ goto retry; ++ } ++ if (geteuid() != 0) { ++ fprintf(stderr, "%s", "ioctl(I915_GEM_USERPTR) failed. Try running as root but expect poor stability.\n"); ++ } + return 0; ++ } + + if (!devinfo->has_userptr_probe) { + /* Check the buffer for validity before we try and use it in a batch */ +--- src/intel/vulkan_hasvk/anv_gem.c.orig 2026-04-15 14:20:41 UTC ++++ src/intel/vulkan_hasvk/anv_gem.c +@@ -150,9 +150,19 @@ anv_gem_userptr(struct anv_device *device, void *mem, + if (device->physical->info.has_userptr_probe) + userptr.flags |= I915_USERPTR_PROBE; + +- int ret = intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); +- if (ret == -1) ++ int ret; ++retry: ++ ret = intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); ++ if (ret == -1) { ++ if (errno == ENODEV && userptr.flags == 0) { ++ userptr.flags = I915_USERPTR_UNSYNCHRONIZED; ++ goto retry; ++ } ++ if (geteuid() != 0) { ++ fprintf(stderr, "%s", "ioctl(I915_GEM_USERPTR) failed. Try running as root but expect poor stability.\n"); ++ } + return 0; ++ } + + return userptr.handle; + } +--- src/intel/vulkan/i915/anv_kmd_backend.c.orig 2026-04-15 14:20:41 UTC ++++ src/intel/vulkan/i915/anv_kmd_backend.c +@@ -274,9 +274,19 @@ i915_gem_create_userptr(struct anv_device *device, voi + if (device->physical->info.has_userptr_probe) + userptr.flags |= I915_USERPTR_PROBE; + +- int ret = intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); +- if (ret == -1) ++ int ret; ++retry: ++ ret = intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); ++ if (ret == -1) { ++ if (errno == ENODEV && userptr.flags == 0) { ++ userptr.flags = I915_USERPTR_UNSYNCHRONIZED; ++ goto retry; ++ } ++ if (geteuid() != 0) { ++ fprintf(stderr, "%s", "ioctl(I915_GEM_USERPTR) failed. Try running as root but expect poor stability.\n"); ++ } + return 0; ++ } + + return userptr.handle; + } diff --git a/graphics/mesa-dri/pkg-plist b/graphics/mesa-dri/pkg-plist index b5c8b5667342..49db8c12716e 100644 --- a/graphics/mesa-dri/pkg-plist +++ b/graphics/mesa-dri/pkg-plist @@ -1,44 +1,77 @@ -lib/dri/libdril_dri.so +lib/dri/apple_dri.so +lib/dri/armada-drm_dri.so %%crocus%%lib/dri/crocus_dri.so +lib/dri/exynos_dri.so +lib/dri/gm12u320_dri.so +lib/dri/hdlcd_dri.so +lib/dri/hx8357d_dri.so %%i915%%lib/dri/i915_dri.so +lib/dri/ili9163_dri.so +lib/dri/ili9225_dri.so +lib/dri/ili9341_dri.so +lib/dri/ili9486_dri.so +lib/dri/imx-dcss_dri.so +lib/dri/imx-drm_dri.so +lib/dri/imx-lcdif_dri.so +lib/dri/ingenic-drm_dri.so %%iris%%lib/dri/iris_dri.so +lib/dri/kirin_dri.so +%%llvmpipe%%lib/dri/kms_swrast_dri.so +lib/dri/komeda_dri.so +lib/dri/libdril_dri.so +lib/dri/mali-dp_dri.so +lib/dri/mcde_dri.so +lib/dri/mediatek_dri.so +lib/dri/meson_dri.so +lib/dri/mi0283qt_dri.so +lib/dri/mxsfb-drm_dri.so +lib/dri/panel-mipi-dbi_dri.so %%panfrost%%lib/dri/panfrost_dri.so -%%panfrost%%lib/dri/rockchip_dri.so +lib/dri/pl111_dri.so %%r300%%lib/dri/r300_dri.so %%r600%%lib/dri/r600_dri.so %%r600%%lib/dri/r600_drv_video.so %%radeonsi%%lib/dri/radeonsi_dri.so %%radeonsi%%lib/dri/radeonsi_drv_video.so -%%svga%%lib/dri/vmwgfx_dri.so -%%llvmpipe%%lib/dri/kms_swrast_dri.so +lib/dri/rcar-du_dri.so +lib/dri/repaper_dri.so +%%panfrost%%lib/dri/rockchip_dri.so +lib/dri/rzg2l-du_dri.so +lib/dri/ssd130x_dri.so +lib/dri/st7586_dri.so +lib/dri/st7735r_dri.so +lib/dri/sti_dri.so +lib/dri/stm_dri.so +lib/dri/sun4i-drm_dri.so %%llvmpipe%%lib/dri/swrast_dri.so +lib/dri/udl_dri.so +lib/dri/vkms_dri.so +%%svga%%lib/dri/vmwgfx_dri.so %%zink%%lib/dri/zink_dri.so +lib/dri/zynqmp-dpsub_dri.so +@comment lib/gbm/dri_gbm.so @comment lib/libEGL.so @comment lib/libEGL.so.1 @comment lib/libEGL.so.1.0.0 -@comment lib/libgbm.so -@comment lib/libgbm.so.1 -@comment lib/libgbm.so.1.0.0 +@comment lib/libEGL_mesa.so +@comment lib/libEGL_mesa.so.0 +@comment lib/libEGL_mesa.so.0.0.0 @comment lib/libGLESv1_CM.so @comment lib/libGLESv1_CM.so.1 @comment lib/libGLESv1_CM.so.1.1.0 @comment lib/libGLESv2.so @comment lib/libGLESv2.so.2 @comment lib/libGLESv2.so.2.0.0 +@comment lib/libgallium-%%MESAVERSION%%.so +@comment lib/libgbm.so +@comment lib/libgbm.so.1 +@comment lib/libgbm.so.1.0.0 %%anv%%lib/libvulkan_intel.so -%%radv%%lib/libvulkan_radeon.so %%swrast_vk%%lib/libvulkan_lvp.so -%%r600%%lib/vdpau/libvdpau_r600.so -%%r600%%lib/vdpau/libvdpau_r600.so.1 -%%r600%%lib/vdpau/libvdpau_r600.so.1.0 -%%r600%%lib/vdpau/libvdpau_r600.so.1.0.0 -%%radeonsi%%lib/vdpau/libvdpau_radeonsi.so -%%radeonsi%%lib/vdpau/libvdpau_radeonsi.so.1 -%%radeonsi%%lib/vdpau/libvdpau_radeonsi.so.1.0 -%%radeonsi%%lib/vdpau/libvdpau_radeonsi.so.1.0.0 +%%radv%%lib/libvulkan_radeon.so share/drirc.d/00-mesa-defaults.conf %%radv%%share/drirc.d/00-radv-defaults.conf share/drirc.d/01-freebsd.conf %%anv%%share/vulkan/icd.d/intel_icd.%%ARCH%%.json -%%radv%%share/vulkan/icd.d/radeon_icd.%%ARCH%%.json %%swrast_vk%%share/vulkan/icd.d/lvp_icd.%%ARCH%%.json +%%radv%%share/vulkan/icd.d/radeon_icd.%%ARCH%%.json diff --git a/graphics/mesa-libs/Makefile b/graphics/mesa-libs/Makefile index d653b3b01348..1088b8295661 100644 --- a/graphics/mesa-libs/Makefile +++ b/graphics/mesa-libs/Makefile @@ -1,103 +1,103 @@ PORTNAME= mesa-libs PORTVERSION= ${MESAVERSION} CATEGORIES= graphics COMMENT= OpenGL libraries that support GLX and EGL clients WWW= https://www.mesa3d.org/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/docs/license.rst USES= llvm:noexport BUILD_DEPENDS= libglvnd>=0:graphics/libglvnd \ ${PYTHON_PKGNAMEPREFIX}ply>0:devel/py-ply@${PY_FLAVOR} \ libclc-${LLVM_PORT:T}>0:devel/libclc@${LLVM_PORT:T} \ spirv-tools>0:graphics/spirv-tools \ spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} +LIB_DEPENDS= libdisplay-info.so:sysutils/libdisplay-info RUN_DEPENDS= spirv-tools>0:graphics/spirv-tools \ spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} CONFIGURE_ENV+= PKG_CONFIG_PATH="${LLVM_PREFIX}/libdata/pkgconfig" OPTIONS_GROUP= PLATFORM OPTIONS_GROUP_PLATFORM= X11 WAYLAND X11_DESC= Enable X11 support for GBM/EGL WAYLAND_DESC= Enable Wayland support for GBM/EGL WAYLAND_BUILD_DEPENDS= wayland-protocols>=1.8:graphics/wayland-protocols WAYLAND_LIB_DEPENDS= libwayland-server.so:graphics/wayland OPTIONS_DEFINE= ZSTD OPTIONS_DEFAULT= WAYLAND X11 ZSTD OPTIONS_SUB= yes ZSTD_DESC= Use ZSTD for shader cache ZSTD_LIB_DEPENDS= libzstd.so:archivers/zstd ZSTD_MESON_ENABLED= zstd USE_LDCONFIG= yes .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" LDFLAGS_i386= -Wl,-znotext # mesa-libs is the home of libgallium-${MESAVERSION}.so (the unified gallium # runtime introduced in mesa 25's "megalib" refactor). It must be built with # a real gallium driver set so install_megadrivers actually ships the lib; # the per-driver lib/dri/*_dri.so shims that fall out of this build are # stripped in post-install (they belong to graphics/mesa-dri). GALLIUM_DRIVERS= crocus i915 iris llvmpipe panfrost r300 r600 radeonsi svga zink .if ${ARCH} != amd64 && ${ARCH} != i386 && ${ARCH} != x86_64 GALLIUM_DRIVERS:= ${GALLIUM_DRIVERS:Ncrocus:Ni915:Niris:Nsvga} .endif .if ${ARCH} == armv7 GALLIUM_DRIVERS= llvmpipe .endif MESON_ARGS+= -Dgallium-drivers=${GALLIUM_DRIVERS:ts,} MESON_ARGS+= -Dvulkan-drivers="" MESON_ARGS+= -Dandroid-libbacktrace=disabled \ - -Dgallium-vdpau=disabled \ -Dgallium-va=disabled \ -Dlmsensors=disabled \ -Dmicrosoft-clc=disabled \ -Dtools="" \ -Dvalgrind=disabled .if ${PORT_OPTIONS:MX11} MESA_PLATFORMS+= x11 USE_XORG+= xorgproto x11 xcb xdamage xext \ xfixes xshmfence xxf86vm xrandr PLIST_SUB+= GLX="" .else MESON_ARGS+= -Dglx=disabled -Dxlib-lease=disabled PLIST_SUB+= GLX="@comment " .endif .if ${PORT_OPTIONS:MWAYLAND} MESA_PLATFORMS+= wayland .endif MESON_ARGS+= -Dplatforms="${MESA_PLATFORMS:ts,:tl}" .if ${ARCH} != amd64 MESON_ARGS+= -Dintel-rt=disabled # https://gitlab.freedesktop.org/mesa/mesa/-/issues/10629 .endif .if ${ARCH} == "i386" # PR230239 Fix the build for i386 when WITH_LLD_IS_LD is set LDFLAGS+=-Wl,-z,notext .endif PLIST_SUB+= MESAVERSION=${MESAVERSION} post-install: # Fallback if GLX_EXT_libglvnd is missing or vendor library doesn't exist @${ECHO_CMD} "libGLX_indirect.so.0 libGLX_mesa.so.0" \ >${STAGEDIR}${PREFIX}/etc/libmap.d/mesa.conf # Strip the per-hardware DRI shims; they are owned by graphics/mesa-dri. ${RM} -rf ${STAGEDIR}${PREFIX}/lib/dri .include