From b6ac32e9e8642853741bd8fc74a7f0d7ba7ad638 Mon Sep 17 00:00:00 2001 From: José Expósito Date: Apr 11 2025 10:25:11 +0000 Subject: [PATCH 1/8] Bump libdrm required version to 2.4.122 mesa requires libdrm >= 2.4.121 but, since upstream CI is using 2.4.122, match it as it is more tested. --- diff --git a/mesa.spec b/mesa.spec index f584b7a..d149339 100644 --- a/mesa.spec +++ b/mesa.spec @@ -142,7 +142,7 @@ BuildRequires: kernel-headers # We only check for the minimum version of pkgconfig(libdrm) needed so that the # SRPMs for each arch still have the same build dependencies. See: # https://bugzilla.redhat.com/show_bug.cgi?id=1859515 -BuildRequires: pkgconfig(libdrm) >= 2.4.121 +BuildRequires: pkgconfig(libdrm) >= 2.4.122 %if 0%{?with_libunwind} BuildRequires: pkgconfig(libunwind) %endif From 95ceea93972027d785e0954fb975f06ae6b236ab Mon Sep 17 00:00:00 2001 From: Nianqing Yao Date: Apr 11 2025 10:46:22 +0000 Subject: [PATCH 2/8] Add Virtio vulkan driver --- diff --git a/mesa.spec b/mesa.spec index d149339..b32c16e 100644 --- a/mesa.spec +++ b/mesa.spec @@ -108,7 +108,7 @@ %bcond_with valgrind %endif -%global vulkan_drivers swrast%{?base_vulkan}%{?asahi_platform_vulkan}%{?intel_platform_vulkan}%{?extra_platform_vulkan}%{?with_nvk:,nouveau} +%global vulkan_drivers swrast,virtio%{?base_vulkan}%{?asahi_platform_vulkan}%{?intel_platform_vulkan}%{?extra_platform_vulkan}%{?with_nvk:,nouveau} %global asahi_mesa_ver 20250221 %global git_tag asahi-%{asahi_mesa_ver} @@ -848,6 +848,8 @@ install -Dpm0644 -t %{buildroot}%{_datadir}/fex-emu/overlays/ mesa-%{_arch}.erof %files vulkan-drivers %{_libdir}/libvulkan_lvp.so %{_datadir}/vulkan/icd.d/lvp_icd.*.json +%{_libdir}/libvulkan_virtio.so +%{_datadir}/vulkan/icd.d/virtio_icd.*.json %{_libdir}/libVkLayer_MESA_device_select.so %{_datadir}/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json %if 0%{?with_vulkan_hw} From 28859ca5bdbc6abfb277419c01f80fde5a108261 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Apr 11 2025 10:46:22 +0000 Subject: [PATCH 3/8] Avoid devel-to-runtime dependencies in flatpak SDKs We're moving towards a system for flatpaks where the mesa implementation will be provided as an extension that is automatically loaded into the flatpak runtimes and SDKs (where libgbm, libglvnd, libva, libvulkan, etc. remain therein to load the implemenations). This is already done for the runtimes, but for the SDKs, the mesa -devel packages need to not pull in the runtimes. With libglvnd providing the external APIs, none of the mesa-*-devel packages provide an external link interface, just a header interface and pkg-config data. Since these -devel packages already require libglvnd-devel, which requires libglvnd-egl and libglvnd-glx, which (normally) pull in mesa-libEGL and mesa-libGL respectively, all that is needed to lock in a matching version. This way, when building for flatpaks which intentionally do not do so (as above), they are not pulled into the SDK either. --- diff --git a/mesa.spec b/mesa.spec index b32c16e..860c825 100644 --- a/mesa.spec +++ b/mesa.spec @@ -249,7 +249,7 @@ Requires: %{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{re %package libGL-devel Summary: Mesa libGL development package -Requires: %{name}-libGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: (%{name}-libGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} if %{name}-libGL%{?_isa}) Requires: libglvnd-devel%{?_isa} >= 1:1.3.2 Provides: libGL-devel Provides: libGL-devel%{?_isa} @@ -269,7 +269,7 @@ Requires: %{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{re %package libEGL-devel Summary: Mesa libEGL development package -Requires: %{name}-libEGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: (%{name}-libEGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} if %{name}-libEGL%{?_isa}) Requires: libglvnd-devel%{?_isa} >= 1:1.3.2 Requires: %{name}-khr-devel%{?_isa} Provides: libEGL-devel From dce5b1b4a383946eb14ec1513e74969ae43835ee Mon Sep 17 00:00:00 2001 From: František Zatloukal Date: Apr 11 2025 10:46:22 +0000 Subject: [PATCH 4/8] libOpenCL: Require ocl-icd or OpenCL-ICD-Loader (RHBZ#2332429) Since introducing OpenCL-ICD-Loader as a new package, an alternative to ocl-icd, Fedora composes under some circumstances do pick the OpenCL-ICD-Loader instead of ocl-icd due to something requiring the .so file, and not the ocl-icd specifically. This change allows the mesa-libOpenCL to work with both ocl icd implementations, and workarounds FTI issue that occurs if OpenCL-ICD-Loader is present, and not ocl-icd. --- diff --git a/mesa.spec b/mesa.spec index 860c825..001ba72 100644 --- a/mesa.spec +++ b/mesa.spec @@ -367,7 +367,7 @@ Provides: libxatracker-devel%{?_isa} %if 0%{?with_opencl} %package libOpenCL Summary: Mesa OpenCL runtime library -Requires: ocl-icd%{?_isa} +Requires: (ocl-icd%{?_isa} or OpenCL-ICD-Loader%{?_isa}) Requires: libclc%{?_isa} Requires: %{name}-libgbm%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} Requires: opencl-filesystem From 59943bc11d2262f0779a8d57f9ec887fc6f918ac Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Apr 11 2025 10:46:22 +0000 Subject: [PATCH 5/8] Drop rusticl special handling after F39 EOL --- diff --git a/mesa.spec b/mesa.spec index 001ba72..d3b5be8 100644 --- a/mesa.spec +++ b/mesa.spec @@ -12,9 +12,6 @@ %global asahi_platform_vulkan %{?with_vulkan_hw:,asahi}%{!?with_vulkan_hw:%{nil}} %global with_opencl 1 -%if (0%{?fedora} && 0%{?fedora} >= 40) -%global with_rusticl 1 -%endif %dnl keep kmsro to package all unconditionally created dri driver symlinks %global with_kmsro 1 @@ -47,9 +44,6 @@ %global with_nvk %{with_vulkan_hw} %endif %global with_opencl 1 -%if (0%{?fedora} && 0%{?fedora} >= 40) -%global with_rusticl 1 -%endif %endif %global with_base_vulkan 1 %global base_vulkan %{?with_vulkan_hw:,amd}%{!?with_vulkan_hw:%{nil}} @@ -192,13 +186,13 @@ BuildRequires: flatbuffers-devel BuildRequires: flatbuffers-compiler BuildRequires: xtensor-devel %endif -%if 0%{?with_opencl} || 0%{?with_rusticl} || 0%{?with_asahi} || 0%{?with_nvk} || 0%{?with_intel_clc} +%if 0%{?with_opencl} || 0%{?with_asahi} || 0%{?with_nvk} || 0%{?with_intel_clc} BuildRequires: clang-devel BuildRequires: pkgconfig(libclc) BuildRequires: pkgconfig(SPIRV-Tools) BuildRequires: pkgconfig(LLVMSPIRVLib) %endif -%if 0%{?with_rusticl} || 0%{?with_nvk} +%if 0%{?with_opencl} || 0%{?with_nvk} BuildRequires: bindgen BuildRequires: rust-packaging %endif @@ -472,7 +466,7 @@ export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/" -Dgallium-nine=%{?with_nine:true}%{!?with_nine:false} \ -Dteflon=%{?with_teflon:true}%{!?with_teflon:false} \ -Dgallium-opencl=%{?with_opencl:icd}%{!?with_opencl:disabled} \ -%if 0%{?with_rusticl} +%if 0%{?with_opencl} -Dgallium-rusticl=true \ %endif -Dvulkan-drivers=%{?vulkan_drivers} \ @@ -557,7 +551,6 @@ ln -s libGLX_mesa.so.0 "fexov/%{_libdir}/libGLX_system.so.0" %dnl OpenCL ---------------------------- %if 0%{?with_opencl} -%if 0%{?with_rusticl} install -Dpm0755 -s -t "fexov/%{_libdir}/" \ %{buildroot}%{_libdir}/libRusticlOpenCL.so.1.0.0 ln -s libRusticlOpenCL.so.1.0.0 fexov/%{_libdir}/libRusticlOpenCL.so.1 @@ -565,7 +558,6 @@ install -Dpm0644 -t "fexov/%{_sysconfdir}/OpenCL/ovl_vendors/" \ %{buildroot}%{_sysconfdir}/OpenCL/vendors/rusticl.icd ln -s ovl_vendors "fexov/%{_sysconfdir}/OpenCL/vendors" %endif -%endif %dnl vulkan ---------------------------- %if "%{?asahi_platform_vulkan}" != "" @@ -590,9 +582,6 @@ install -Dpm0644 -t "fexov/%{_datadir}/glvnd/ovl_egl_vendor.d/" \ %{buildroot}%{_datadir}/glvnd/egl_vendor.d/50_mesa.json ln -s ovl_egl_vendor.d "fexov/%{_datadir}/glvnd/egl_vendor.d" -%if 0%{?with_rusticl} -%endif - # Hack to work around libcapsule bug: # https://github.com/ValveSoftware/steam-runtime/issues/704 # @@ -676,20 +665,14 @@ install -Dpm0644 -t %{buildroot}%{_datadir}/fex-emu/overlays/ mesa-%{_arch}.erof %if 0%{?with_opencl} %files libOpenCL %{_libdir}/libMesaOpenCL.so.* -%if 0%{?with_rusticl} %{_libdir}/libRusticlOpenCL.so.* -%endif %{_sysconfdir}/OpenCL/vendors/mesa.icd -%if 0%{?with_rusticl} %{_sysconfdir}/OpenCL/vendors/rusticl.icd -%endif %files libOpenCL-devel %{_libdir}/libMesaOpenCL.so -%if 0%{?with_rusticl} %{_libdir}/libRusticlOpenCL.so %endif -%endif %if 0%{?with_nine} %files libd3d From 6230e00b24070bffb889cc4cbc4eadda57190d17 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Apr 11 2025 10:46:22 +0000 Subject: [PATCH 6/8] move patchelf build dependency to fex-emu-overlay sub-package --- diff --git a/mesa.spec b/mesa.spec index d3b5be8..c647b51 100644 --- a/mesa.spec +++ b/mesa.spec @@ -220,7 +220,6 @@ BuildRequires: glslang %if 0%{?with_vulkan_hw} BuildRequires: pkgconfig(vulkan) %endif -BuildRequires: patchelf %description %{summary}. @@ -414,6 +413,7 @@ The drivers with support for the Vulkan API. Summary: Mesa driver overlay for FEX-emu BuildArch: noarch BuildRequires: erofs-utils +BuildRequires: patchelf Requires: fex-emu Supplements: fex-emu-rootfs-fedora Provides: fex-emu-overlay(%{_arch})(mesa) = %{version}-%{release} From 12e9d4449b91919872b79e2811e806ca20fee4dc Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Apr 11 2025 10:46:22 +0000 Subject: [PATCH 7/8] Reorder dri_gbm.so entry in dri-drivers' %files Fixes diversion from upstream Fedora mesa.spec. --- diff --git a/mesa.spec b/mesa.spec index c647b51..bb333de 100644 --- a/mesa.spec +++ b/mesa.spec @@ -686,9 +686,9 @@ install -Dpm0644 -t %{buildroot}%{_datadir}/fex-emu/overlays/ mesa-%{_arch}.erof %endif %files dri-drivers -%{_libdir}/gbm/dri_gbm.so %{_datadir}/drirc.d/00-mesa-defaults.conf %{_libdir}/libgallium-*.so +%{_libdir}/gbm/dri_gbm.so %{_libdir}/dri/kms_swrast_dri.so %{_libdir}/dri/libdril_dri.so %{_libdir}/dri/swrast_dri.so From c9793476884e1fe163aa5de0e5316ae10b8af5ef Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Apr 11 2025 10:46:22 +0000 Subject: [PATCH 8/8] Bump release --- diff --git a/mesa.spec b/mesa.spec index bb333de..e0cd0d2 100644 --- a/mesa.spec +++ b/mesa.spec @@ -113,7 +113,7 @@ Name: mesa Summary: Mesa graphics libraries Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)} -Release: %autorelease +Release: %autorelease -b 2 License: MIT AND BSD-3-Clause AND SGI-B-2.0 URL: http://www.mesa3d.org