feat: Update for Mesa 25.3 (#7660) (#7702)

* feat: Update for Mesa 25.3
feat: Enable AMD Virtio support



* Update anda/lib/mesa/mesa.spec




---------



(cherry picked from commit 5013df18ee)

Signed-off-by: Kyle Gospodnetich <me@kylegospodneti.ch>
Signed-off-by: GildedRoach <GildedRoach@users.noreply.github.com>
Co-authored-by: Kyle Gospodnetich <me@kylegospodneti.ch>
This commit is contained in:
Gilver
2025-11-25 20:26:29 -06:00
committed by GitHub
parent 5da637c38e
commit 6fbdcb4c81
3 changed files with 246 additions and 2380 deletions
File diff suppressed because it is too large Load Diff
+27
View File
@@ -0,0 +1,27 @@
From 087ef6401515d7260eafbffe423f39afc2af985c Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Date: Tue, 18 Nov 2025 11:36:43 +0100
Subject: [PATCH] dril: don't build a rocket_dri.so
As Teflon doesn't dynamically load drivers (yet?).
---
src/gallium/targets/dril/meson.build | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/gallium/targets/dril/meson.build b/src/gallium/targets/dril/meson.build
index 140022f077da9..62a816f44a625 100644
--- a/src/gallium/targets/dril/meson.build
+++ b/src/gallium/targets/dril/meson.build
@@ -124,8 +124,7 @@ foreach d : [[with_gallium_kmsro, [
[with_gallium_lima, 'lima_dri.so'],
[with_gallium_d3d12, 'd3d12_dri.so'],
[with_gallium_zink, 'zink_dri.so'],
- [with_gallium_asahi, 'asahi_dri.so'],
- [with_gallium_rocket, 'rocket_dri.so']]
+ [with_gallium_asahi, 'asahi_dri.so']]
if d[0]
dril_drivers += d[1]
endif
--
GitLab
+139 -74
View File
@@ -4,23 +4,22 @@
%ifnarch s390x
%global with_hardware 1
%global with_kmsro 1
%global with_nvk 1
%global with_radeonsi 1
%global with_spirv_tools 1
%global with_vmware 1
%global with_vulkan_hw 1
%global with_vdpau 1
%global with_va 1
%if !0%{?rhel}
%global with_r300 1
%global with_r600 1
%if 0%{?with_vulkan_hw}
%global with_nvk %{with_vulkan_hw}
%endif
%global with_opencl 1
%endif
%global base_vulkan %{?with_vulkan_hw:,amd}%{!?with_vulkan_hw:%{nil}}
%endif
%ifnarch %{ix86}
%ifarch aarch64 x86_64
%if !0%{?rhel}
%global with_teflon 1
%endif
@@ -51,12 +50,11 @@
%global with_v3d 1
%endif
%global with_freedreno 1
%global with_kmsro 1
%global with_panfrost 1
%if 0%{?with_asahi}
%global asahi_platform_vulkan %{?with_vulkan_hw:,asahi}%{!?with_vulkan_hw:%{nil}}
%endif
%global extra_platform_vulkan %{?with_vulkan_hw:,broadcom,freedreno,panfrost,imagination-experimental}%{!?with_vulkan_hw:%{nil}}
%global extra_platform_vulkan %{?with_vulkan_hw:,broadcom,freedreno,panfrost,imagination}%{!?with_vulkan_hw:%{nil}}
%endif
%if !0%{?rhel}
@@ -73,14 +71,22 @@
%global vulkan_drivers swrast%{?base_vulkan}%{?intel_platform_vulkan}%{?asahi_platform_vulkan}%{?extra_platform_vulkan}%{?with_nvk:,nouveau}%{?with_virtio:,virtio}%{?with_d3d12:,microsoft-experimental}
%if 0%{?with_nvk} && 0%{?rhel}
%global vendor_nvk_crates 1
%endif
# We've gotten a report that enabling LTO for mesa breaks some games. See
# https://bugzilla.redhat.com/show_bug.cgi?id=1862771 for details.
# Disable LTO for now
%global _lto_cflags %nil
Name: %{srcname}
Summary: Mesa graphics libraries
# Make the dep solver always prefer our Mesa over the distro's
# This should not break anything by default as the Mesa stream is ***EXPLICITLY***
# disabled by default, and has to be enabled manually. See `terra/release/terra-mesa.repo` for details.
%global ver 25.3.0
Epoch: 1
Version: 25.2.4
Release: 2%?dist
Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)}
Release: %autorelease
Packager: Kyle Gospodnetich <me@kylegospodneti.ch>
License: MIT AND BSD-3-Clause AND SGI-B-2.0
URL: http://www.mesa3d.org
@@ -90,11 +96,28 @@ Source0: https://archive.mesa3d.org/%{srcname}-%{version}.tar.xz
# Fedora opts to ignore the optional part of clause 2 and treat that code as 2 clause BSD.
Source1: Mesa-MLAA-License-Clarification-Email.txt
Patch10: gnome-shell-glthread-disable.patch
# In CentOS/RHEL, Rust crates required to build NVK are vendored.
# The minimum target versions are obtained from the .wrap files
# https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/subprojects
# but we generally want the latest compatible versions
%global rust_paste_ver 1.0.15
%global rust_proc_macro2_ver 1.0.101
%global rust_quote_ver 1.0.40
%global rust_syn_ver 2.0.106
%global rust_unicode_ident_ver 1.0.18
%global rustc_hash_ver 2.1.1
Source10: https://crates.io/api/v1/crates/paste/%{rust_paste_ver}/download#/paste-%{rust_paste_ver}.tar.gz
Source11: https://crates.io/api/v1/crates/proc-macro2/%{rust_proc_macro2_ver}/download#/proc-macro2-%{rust_proc_macro2_ver}.tar.gz
Source12: https://crates.io/api/v1/crates/quote/%{rust_quote_ver}/download#/quote-%{rust_quote_ver}.tar.gz
Source13: https://crates.io/api/v1/crates/syn/%{rust_syn_ver}/download#/syn-%{rust_syn_ver}.tar.gz
Source14: https://crates.io/api/v1/crates/unicode-ident/%{rust_unicode_ident_ver}/download#/unicode-ident-%{rust_unicode_ident_ver}.tar.gz
Source15: https://crates.io/api/v1/crates/rustc-hash/%{rustc_hash_ver}/download#/rustc-hash-%{rustc_hash_ver}.tar.gz
# Teflon: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38532
Patch12: mesa-38532.patch
# https://github.com/bazzite-org/mesa
Patch20: bazzite.patch
Patch21: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37498.diff
BuildRequires: meson >= 1.3.0
BuildRequires: gcc
@@ -102,6 +125,7 @@ BuildRequires: gcc-c++
BuildRequires: gettext
%if 0%{?with_hardware}
BuildRequires: kernel-headers
BuildRequires: systemd-devel
%endif
# 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:
@@ -113,12 +137,12 @@ BuildRequires: pkgconfig(libunwind)
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(zlib) >= 1.2.3
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(libselinux)
BuildRequires: pkgconfig(wayland-scanner)
BuildRequires: pkgconfig(wayland-protocols) >= 1.34
BuildRequires: pkgconfig(wayland-client) >= 1.11
BuildRequires: pkgconfig(wayland-server) >= 1.11
BuildRequires: pkgconfig(wayland-egl-backend) >= 3
BuildRequires: pkgconfig(libdisplay-info)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xdamage) >= 1.1
@@ -142,9 +166,6 @@ BuildRequires: flex
%if 0%{?with_lmsensors}
BuildRequires: lm_sensors-devel
%endif
%if 0%{?with_vdpau}
BuildRequires: pkgconfig(vdpau) >= 1.1
%endif
%if 0%{?with_va}
BuildRequires: pkgconfig(libva) >= 0.38.0
%endif
@@ -164,23 +185,20 @@ BuildRequires: pkgconfig(LLVMSPIRVLib)
%endif
%if 0%{?with_opencl} || 0%{?with_nvk}
BuildRequires: bindgen
BuildRequires: rust-packaging
%if 0%{?rhel}
BuildRequires: rust-toolset
%else
BuildRequires: cargo-rpm-macros
%endif
%endif
%if 0%{?with_nvk}
BuildRequires: cbindgen
BuildRequires: (crate(paste) >= 1.0.14 with crate(paste) < 2)
BuildRequires: (crate(proc-macro2) >= 1.0.56 with crate(proc-macro2) < 2)
BuildRequires: (crate(quote) >= 1.0.25 with crate(quote) < 2)
BuildRequires: (crate(syn/clone-impls) >= 2.0.15 with crate(syn/clone-impls) < 3)
BuildRequires: (crate(unicode-ident) >= 1.0.6 with crate(unicode-ident) < 2)
BuildRequires: (crate(rustc-hash) >= 2.1.1 with crate(rustc-hash) < 3)
%endif
%if %{with valgrind}
BuildRequires: pkgconfig(valgrind)
%endif
BuildRequires: python3-devel
BuildRequires: python3-mako
BuildRequires: python3-ply
BuildRequires: python3-pycparser
BuildRequires: python3-pyyaml
BuildRequires: vulkan-headers
@@ -189,7 +207,7 @@ BuildRequires: glslang
BuildRequires: pkgconfig(vulkan)
%endif
%if 0%{?with_d3d12}
BuildRequires: pkgconfig(DirectX-Headers) >= 1.614.1
BuildRequires: pkgconfig(DirectX-Headers) >= 1.618.1
%endif
%description
@@ -199,6 +217,9 @@ BuildRequires: pkgconfig(DirectX-Headers) >= 1.614.1
Summary: Mesa driver filesystem
Provides: mesa-dri-filesystem = %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: mesa-omx-drivers < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: mesa-libd3d < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: mesa-libd3d-devel < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: mesa-vdpau-drivers < %{?epoch:%{epoch}:}%{version}-%{release}
%description filesystem
%{summary}.
@@ -266,15 +287,6 @@ Obsoletes: %{name}-vaapi-drivers < %{?epoch:%{epoch}:}22.2.0-5
%{summary}.
%endif
%if 0%{?with_vdpau}
%package vdpau-drivers
Summary: Mesa-based VDPAU drivers
Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description vdpau-drivers
%{summary}.
%endif
%package libgbm
Summary: Mesa gbm runtime library
Provides: libgbm
@@ -348,45 +360,102 @@ The drivers with support for the Vulkan API.
%autosetup -n %{srcname}-%{version} -p1
cp %{SOURCE1} docs/
# Extract Rust crates meson cache directory
%if 0%{?vendor_nvk_crates}
mkdir subprojects/packagecache/
tar -xvf %{SOURCE10} -C subprojects/packagecache/
tar -xvf %{SOURCE11} -C subprojects/packagecache/
tar -xvf %{SOURCE12} -C subprojects/packagecache/
tar -xvf %{SOURCE13} -C subprojects/packagecache/
tar -xvf %{SOURCE14} -C subprojects/packagecache/
tar -xvf %{SOURCE15} -C subprojects/packagecache/
for d in subprojects/packagecache/*-*; do
echo '{"files":{}}' > $d/.cargo-checksum.json
done
%endif
%if 0%{?with_nvk}
cat > Cargo.toml <<_EOF
[package]
name = "mesa"
version = "%{ver}"
edition = "2021"
[lib]
path = "src/nouveau/nil/lib.rs"
# only direct dependencies need to be listed here
[dependencies]
paste = "$(grep ^directory subprojects/paste*.wrap | sed 's|.*-||')"
syn = { version = "$(grep ^directory subprojects/syn*.wrap | sed 's|.*-||')", features = ["clone-impls"] }
rustc-hash = "$(grep ^directory subprojects/rustc-hash*.wrap | sed 's|.*-||')"
_EOF
%if 0%{?vendor_nvk_crates}
%cargo_prep -v subprojects/packagecache
%else
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%endif
%endif
%build
# ensure standard Rust compiler flags are set
export RUSTFLAGS="%build_rustflags"
%if 0%{?with_nvk}
export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/"
# So... Meson can't actually find them without tweaks
%define inst_crate_nameversion() %(basename %{cargo_registry}/%{1}-*)
%define rewrite_wrap_file() sed -e "/source.*/d" -e "s/%{1}-.*/%{inst_crate_nameversion %{1}}/" -i subprojects/%{1}.wrap
%rewrite_wrap_file proc-macro2
%rewrite_wrap_file quote
%rewrite_wrap_file syn
%rewrite_wrap_file unicode-ident
%rewrite_wrap_file paste
%if !0%{?vendor_nvk_crates}
export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/"
%endif
# We've gotten a report that enabling LTO for mesa breaks some games. See
# https://bugzilla.redhat.com/show_bug.cgi?id=1862771 for details.
# Disable LTO for now
%define _lto_cflags %{nil}
# This function rewrites a mesa .wrap file:
# - Removes the lines that start with "source"
# - Replaces the "directory =" with the MESON_PACKAGE_CACHE_DIR
#
# Example: An upstream .wrap file like this (proc-macro2-1-rs.wrap):
#
# [wrap-file]
# directory = proc-macro2-1.0.86
# source_url = https://crates.io/api/v1/crates/proc-macro2/1.0.86/download
# source_filename = proc-macro2-1.0.86.tar.gz
# source_hash = 5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77
# patch_directory = proc-macro2-1-rs
#
# Will be transformed to:
#
# [wrap-file]
# directory = meson-package-cache-dir
# patch_directory = proc-macro2-1-rs
rewrite_wrap_file() {
sed -e "/source.*/d" -e "s/^directory = ${1}-.*/directory = $(basename ${MESON_PACKAGE_CACHE_DIR:-subprojects/packagecache}/${1}-*)/" -i subprojects/${1}*.wrap
}
rewrite_wrap_file proc-macro2
rewrite_wrap_file quote
rewrite_wrap_file syn
rewrite_wrap_file unicode-ident
rewrite_wrap_file paste
rewrite_wrap_file rustc-hash
%endif
%meson \
-Dplatforms=x11,wayland \
-Dgallium-mediafoundation=disabled \
%if 0%{?with_hardware}
-Dgallium-drivers=llvmpipe,virgl,nouveau%{?with_r300:,r300}%{?with_crocus:,crocus}%{?with_i915:,i915}%{?with_iris:,iris}%{?with_vmware:,svga}%{?with_radeonsi:,radeonsi}%{?with_r600:,r600}%{?with_asahi:,asahi}%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_v3d:,v3d}%{?with_lima:,lima}%{?with_panfrost:,panfrost}%{?with_vulkan_hw:,zink}%{?with_d3d12:,d3d12} \
-Dgallium-drivers=llvmpipe,virgl,nouveau%{?with_r300:,r300}%{?with_crocus:,crocus}%{?with_i915:,i915}%{?with_iris:,iris}%{?with_vmware:,svga}%{?with_radeonsi:,radeonsi}%{?with_r600:,r600}%{?with_asahi:,asahi}%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_v3d:,v3d}%{?with_lima:,lima}%{?with_panfrost:,panfrost}%{?with_vulkan_hw:,zink}%{?with_d3d12:,d3d12}%{?with_teflon:,ethosu,rocket} \
%else
-Dgallium-drivers=llvmpipe,virgl \
%endif
-Dgallium-vdpau=%{?with_vdpau:enabled}%{!?with_vdpau:disabled} \
-Dgallium-va=%{?with_va:enabled}%{!?with_va:disabled} \
-Dgallium-mediafoundation=disabled \
-Dteflon=%{?with_teflon:true}%{!?with_teflon:false} \
%if 0%{?with_opencl}
-Dgallium-rusticl=true \
%endif
-Dvulkan-drivers=%{?vulkan_drivers} \
-Dvulkan-layers=device-select,anti-lag \
-Dshared-glapi=enabled \
-Dgles1=enabled \
-Dgles2=enabled \
-Dopengl=true \
@@ -396,12 +465,12 @@ export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/"
-Dglvnd=enabled \
-Dvideo-codecs=all \
-Dintel-rt=%{?with_intel_vk_rt:enabled}%{!?with_intel_vk_rt:disabled} \
-Damdgpu-virtio=true \
-Dmicrosoft-clc=disabled \
-Dllvm=enabled \
-Dshared-llvm=enabled \
-Dvalgrind=%{?with_valgrind:enabled}%{!?with_valgrind:disabled} \
-Dbuild-tests=false \
-Dselinux=true \
%if !0%{?with_libunwind}
-Dlibunwind=disabled \
%endif
@@ -412,14 +481,21 @@ export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/"
%ifarch %{ix86}
-Dglx-read-only-text=true \
%endif
-Dspirv-tools=%{?with_spirv_tools:enabled}%{!?with_spirv_tools:disabled} \
%{nil}
%meson_build
%if 0%{?with_nvk}
%cargo_license_summary
%{cargo_license} > LICENSE.dependencies
%if 0%{?vendor_nvk_crates}
%cargo_vendor_manifest
%endif
%endif
%install
%meson_install
# libvdpau opens the versioned name, don't bother including the unversioned
rm -vf %{buildroot}%{_libdir}/vdpau/*.so
# likewise glvnd
rm -vf %{buildroot}%{_libdir}/libGLX_mesa.so
rm -vf %{buildroot}%{_libdir}/libEGL_mesa.so
@@ -514,7 +590,7 @@ popd
%{_libdir}/dri/i915_dri.so
%endif
%endif
%ifarch aarch64 x86_64 %{ix86}
%ifnarch s390x
%if 0%{?with_asahi}
%{_libdir}/dri/apple_dri.so
%{_libdir}/dri/asahi_dri.so
@@ -608,22 +684,6 @@ popd
%{_libdir}/dri/virtio_gpu_drv_video.so
%endif
%if 0%{?with_vdpau}
%files vdpau-drivers
%dir %{_libdir}/vdpau
%{_libdir}/vdpau/libvdpau_nouveau.so.1*
%if 0%{?with_r600}
%{_libdir}/vdpau/libvdpau_r600.so.1*
%endif
%if 0%{?with_radeonsi}
%{_libdir}/vdpau/libvdpau_radeonsi.so.1*
%endif
%if 0%{?with_d3d12}
%{_libdir}/vdpau/libvdpau_d3d12.so.1*
%endif
%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1*
%endif
%if 0%{?with_d3d12}
%files dxil-devel
%{_bindir}/spirv2dxil
@@ -632,6 +692,12 @@ popd
%endif
%files vulkan-drivers
%if 0%{?with_nvk}
%license LICENSE.dependencies
%if 0%{?vendor_nvk_crates}
%license cargo-vendor.txt
%endif
%endif
%{_libdir}/libvulkan_lvp.so
%{_datadir}/vulkan/icd.d/lvp_icd.*.json
%{_libdir}/libVkLayer_MESA_device_select.so
@@ -671,7 +737,6 @@ popd
%{_datadir}/vulkan/icd.d/freedreno_icd.*.json
%{_libdir}/libvulkan_panfrost.so
%{_datadir}/vulkan/icd.d/panfrost_icd.*.json
%{_libdir}/libpowervr_rogue.so
%{_libdir}/libvulkan_powervr_mesa.so
%{_datadir}/vulkan/icd.d/powervr_mesa_icd.*.json
%endif