[packages/libvdpau-driver-gallium] - last version of vdpau gallium driver (from Mesa 25.2.8)

qboosh qboosh at pld-linux.org
Sat May 30 11:06:45 CEST 2026


commit 616759c530aff0324ee4ee8c2639fdbe47b91a28
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat May 30 11:06:47 2026 +0200

    - last version of vdpau gallium driver (from Mesa 25.2.8)

 libvdpau-driver-gallium.spec | 246 +++++++++++++++++++++++++++++++++++++++++++
 mesa-llvm-update.patch       |  78 ++++++++++++++
 panfrost-shareable-res.patch |  11 ++
 3 files changed, 335 insertions(+)
---
diff --git a/libvdpau-driver-gallium.spec b/libvdpau-driver-gallium.spec
new file mode 100644
index 0000000..eb5e520
--- /dev/null
+++ b/libvdpau-driver-gallium.spec
@@ -0,0 +1,246 @@
+# TODO:
+# - bcond for perfetto peformance analysis? (BR: perfetto)
+#
+# Conditional build:
+%bcond_without	gallium_i915	# gallium i915 driver
+%bcond_without	gallium_nouveau	# gallium nouveau driver
+%bcond_without	gallium_radeon	# gallium radeon drivers
+%bcond_without	gallium_zink	# gallium zink driver (based on vulkan)
+%bcond_with	sse2		# SSE2 instructions
+%bcond_with	hud_extra	# HUD block/NIC I/O HUD stats support
+%bcond_with	lm_sensors	# HUD lm_sensors support
+%bcond_with	tests		# tests
+
+%define		syn_crate_ver		2.0.87
+%define		unicode_ident_crate_ver	1.0.12
+%define		quote_crate_ver		1.0.35
+%define		proc_macro2_crate_ver	1.0.86
+%define		paste_crate_ver		1.0.14
+%define		rustc_hash_crate_ver	2.1.1
+
+# other packages
+%define		libdrm_ver		2.4.121
+%define		zlib_ver		1.2.8
+%define		llvm_ver		18.0.0
+%define		gcc_ver 		6:8
+
+%ifarch %{x86_with_sse2}
+%define		with_sse2	1
+%endif
+
+%ifarch %{ix86} %{x8664} x32 aarch64
+%define		with_clc	1
+%endif
+
+Summary:	Mesa Gallium driver for the vdpau API
+Summary(pl.UTF-8):	Sterownik Mesa Gallium dla API vdpau
+Name:		libvdpau-driver-gallium
+# 25.2.x is the last Mesa series with vdpau driver
+Version:	25.2.8
+Release:	1
+License:	MIT
+Group:		X11/Libraries
+Source0:	https://archive.mesa3d.org/mesa-%{version}.tar.xz
+# Source0-md5:	c555052c29e6fdfe3cfb68c05707ca09
+Source1:	https://crates.io/api/v1/crates/syn/%{syn_crate_ver}/download?/syn-%{syn_crate_ver}.tar.gz
+# Source1-md5:	112875c142d1023400b0262ea1996de0
+Source2:	https://crates.io/api/v1/crates/unicode-ident/%{unicode_ident_crate_ver}/download?/unicode-ident-%{unicode_ident_crate_ver}.tar.gz
+# Source2-md5:	ca65153603a1a7240bbd9d2ce19f2d67
+Source3:	https://crates.io/api/v1/crates/quote/%{quote_crate_ver}/download?/quote-%{quote_crate_ver}.tar.gz
+# Source3-md5:	0358b31bf59c7915bb03f9e66f2d1ea3
+Source4:	https://crates.io/api/v1/crates/proc-macro2/%{proc_macro2_crate_ver}/download?/proc-macro2-%{proc_macro2_crate_ver}.tar.gz
+# Source4-md5:	480a3b8e8201739e157bb648f9243962
+Source5:	https://crates.io/api/v1/crates/paste/%{paste_crate_ver}/download?/paste-%{paste_crate_ver}.tar.gz
+# Source5-md5:	1781b204ec7b6b1ef9232d429e6a973a
+Source6:	https://crates.io/api/v1/crates/rustc-hash/%{rustc_hash_crate_ver}/download?/rustc-hash-%{rustc_hash_crate_ver}.tar.gz
+# Source6-md5:	9f5da5d4deefacf77ae9ca3cbe5c7c6a
+Patch0:		panfrost-shareable-res.patch
+Patch2:		mesa-llvm-update.patch
+URL:		https://www.mesa3d.org/
+%{?with_gallium_zink:BuildRequires:	Vulkan-Loader-devel}
+BuildRequires:	bison >= 2.4.1
+%if %{with clc}
+BuildRequires:	clang-devel >= %{llvm_ver}
+%endif
+BuildRequires:	elfutils-devel
+BuildRequires:	expat-devel >= 1.95
+BuildRequires:	flex >= 2.5.35
+BuildRequires:	gcc >= %{gcc_ver}
+BuildRequires:	glslang >= 11.3.0
+%ifnarch %{arch_with_atomics64}
+BuildRequires:	libatomic-devel
+%endif
+BuildRequires:	libdrm-devel >= %{libdrm_ver}
+BuildRequires:	libstdc++-devel >= %{gcc_ver}
+BuildRequires:	libunwind-devel
+BuildRequires:	libvdpau-devel >= 1.5
+BuildRequires:	libxcb-devel >= 1.17
+BuildRequires:	llvm-devel >= %{llvm_ver}
+%if %{with clc}
+BuildRequires:	llvm-libclc
+%endif
+%{?with_lm_sensors:BuildRequires:	lm_sensors-devel}
+BuildRequires:	meson >= 1.7.0
+BuildRequires:	ninja >= 1.5
+BuildRequires:	pkgconfig
+BuildRequires:	pkgconfig(xcb-dri3) >= 1.17
+BuildRequires:	pkgconfig(xcb-present) >= 1.17
+BuildRequires:	pkgconfig(xcb-randr) >= 1.12
+BuildRequires:	python3 >= 1:3.8
+BuildRequires:	python3-Mako >= 0.8.0
+BuildRequires:	python3-PyYAML
+%ifarch %{arm} aarch64
+BuildRequires:	python3-pycparser >= 2.20
+%endif
+BuildRequires:	rpmbuild(macros) >= 2.050
+BuildRequires:	sed >= 4.0
+%if %{with clc}
+BuildRequires:	spirv-tools-devel >= 2024.3
+%endif
+BuildRequires:	tar >= 1:1.22
+BuildRequires:	udev-devel
+BuildRequires:	xcb-util-keysyms-devel
+BuildRequires:	xorg-lib-libX11-devel
+BuildRequires:	xorg-lib-libXfixes-devel >= 2.0
+BuildRequires:	xorg-lib-libXrandr-devel >= 1.3
+BuildRequires:	xorg-lib-libxshmfence-devel >= 1.1
+BuildRequires:	xz
+BuildRequires:	zlib-devel >= %{zlib_ver}
+BuildRequires:	zstd-devel
+Requires:	libvdpau%{?_isa} >= 1.5
+%if %{with gallium_nouveau}
+Provides:	libvdpau-driver-mesa-nouveau = %{version}
+%endif
+%if %{with gallium_radeon}
+Provides:	libvdpau-driver-mesa-r600 = %{version}
+Provides:	libvdpau-driver-mesa-radeonsi = %{version}
+%endif
+Provides:	libvdpau-driver-mesa-virtio = %{version}
+Obsoletes:	libvdpau-driver-mesa-nouveau < 24.2.0
+Obsoletes:	libvdpau-driver-mesa-r600 < 24.2.0
+Obsoletes:	libvdpau-driver-mesa-radeonsi < 24.2.0
+Obsoletes:	libvdpau-driver-mesa-virtio < 24.2.0
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Mesa Gallium driver for the vdpau API.
+
+%description -l pl.UTF-8
+Sterownik Mesa Gallium dla API vdpau.
+
+%prep
+%setup -q -n mesa-%{version}
+%patch -P2 -p1
+%ifarch %{arm} aarch64
+%patch -P0 -p1
+%endif
+
+install -d subprojects/packagecache
+cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} subprojects/packagecache
+
+%build
+gallium_drivers="virgl llvmpipe softpipe %{?with_gallium_zink:zink} \
+%ifarch %{ix86} %{x8664} x32
+svga iris %{?with_gallium_i915:i915} crocus \
+%endif
+%if %{with gallium_radeon}
+r300 r600 radeonsi \
+%endif
+%if %{with gallium_nouveau}
+nouveau
+%endif
+%ifarch %{arm} aarch64
+%ifarch aarch64
+asahi
+%endif
+etnaviv \
+freedreno \
+lima \
+panfrost \
+%{?with_gallium_nouveau:tegra} \
+v3d \
+vc4 \
+%endif
+"
+
+gallium_drivers=$(echo $gallium_drivers | xargs | tr ' ' ',')
+
+export RUSTFLAGS="%{rpmrustflags} --target=%rust_target"
+%meson \
+	--force-fallback-for=syn,unicode-ident,quote,proc-macro2,rustc-hash \
+	-Dallow-kcmp=enabled \
+	-Dandroid-libbacktrace=disabled \
+	-Ddri-drivers-path=%{_libdir}/xorg/modules/dri \
+	-Degl=disabled \
+	-Dexpat=enabled \
+	-Dgallium-d3d12-video=disabled \
+	-Dgallium-d3d12-graphics=disabled \
+	-Dgallium-drivers=${gallium_drivers} \
+	%{?with_hud_extra:-Dgallium-extra-hud=true} \
+	-Dgallium-va=disabled \
+	-Dgallium-vdpau=enabled \
+	-Dgbm=disabled \
+	-Dgles1=disabled \
+	-Dgles2=disabled \
+	-Dglvnd=disabled \
+	-Dintel-rt=disabled \
+	-Dlibunwind=enabled \
+	-Dllvm=enabled \
+	-Dlmsensors=%{__enabled_disabled lm_sensors} \
+	-Dmicrosoft-clc=disabled \
+	-Dopengl=false \
+	-Dplatforms=x11 \
+	-Dshader-cache=enabled \
+	-Dshared-llvm=enabled \
+	-Dsse2=%{__true_false sse2} \
+	-Dva-libs-path=%{_libdir}/libva/dri \
+	-Dvalgrind=disabled \
+	-Dvideo-codecs=all \
+	-Dvulkan-drivers= \
+	-Dxlib-lease=enabled \
+	-Dxmlconfig=enabled \
+	-Dzstd=enabled \
+%ifarch %{arm} aarch64
+	-Dfreedreno-kmds=msm,virtio \
+	-Dimagination-srv=true
+%endif
+
+%meson_build
+
+%if %{with tests}
+%meson_test
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%meson_install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+# ldconfig is not used in vdpau tree, so package all symlinks
+%files -n libvdpau-driver-gallium
+%defattr(644,root,root,755)
+%{_libdir}/vdpau/libvdpau_gallium.so.1.0.0
+# symlinks to libgdpau_gallium
+%if %{with gallium_nouveau}
+%{_libdir}/vdpau/libvdpau_nouveau.so.1.0.0
+%{_libdir}/vdpau/libvdpau_nouveau.so.1.0
+%{_libdir}/vdpau/libvdpau_nouveau.so.1
+%{_libdir}/vdpau/libvdpau_nouveau.so
+%endif
+%if %{with gallium_radeon}
+%{_libdir}/vdpau/libvdpau_r600.so.1.0.0
+%{_libdir}/vdpau/libvdpau_r600.so.1.0
+%{_libdir}/vdpau/libvdpau_r600.so.1
+%{_libdir}/vdpau/libvdpau_r600.so
+%{_libdir}/vdpau/libvdpau_radeonsi.so.1.0.0
+%{_libdir}/vdpau/libvdpau_radeonsi.so.1.0
+%{_libdir}/vdpau/libvdpau_radeonsi.so.1
+%{_libdir}/vdpau/libvdpau_radeonsi.so
+%endif
+%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1.0.0
+%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1.0
+%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1
+%{_libdir}/vdpau/libvdpau_virtio_gpu.so
diff --git a/mesa-llvm-update.patch b/mesa-llvm-update.patch
new file mode 100644
index 0000000..7bbaf36
--- /dev/null
+++ b/mesa-llvm-update.patch
@@ -0,0 +1,78 @@
+--- mesa-25.2.8/src/compiler/clc/clc_helpers.cpp.orig	2026-05-26 19:34:09.808767807 +0200
++++ mesa-25.2.8/src/compiler/clc/clc_helpers.cpp	2026-05-26 19:37:39.850963244 +0200
+@@ -24,12 +24,9 @@
+ // OTHER DEALINGS IN THE SOFTWARE.
+ 
+ #include <cstdlib>
+-#include <filesystem>
+ #include <sstream>
+ #include <mutex>
+ 
+-#include "util/ralloc.h"
+-#include "util/set.h"
+ #include <llvm/ADT/ArrayRef.h>
+ #include <llvm/IR/DiagnosticPrinter.h>
+ #include <llvm/IR/DiagnosticInfo.h>
+@@ -68,7 +65,17 @@
+ #include <llvm/Support/VirtualFileSystem.h>
+ #endif
+ 
++#if LLVM_VERSION_MAJOR >= 22
++#include <clang/Options/OptionUtils.h>
++#endif
++
++/* We have to include our own headers after LLVM/clang as they seem to use
++ * `UNUSED` within enum definitions:
++ * https://github.com/llvm/llvm-project/blob/ea443eeb2ab8ed49ffb783c2025fed6629a36f10/clang/include/clang/Basic/OffloadArch.h#L19
++ */
+ #include "util/macros.h"
++#include "util/ralloc.h"
++#include "util/set.h"
+ #include "glsl_types.h"
+ 
+ #include "spirv.h"
+@@ -84,8 +91,6 @@
+ 
+ #include "clc_helpers.h"
+ 
+-namespace fs = std::filesystem;
+-
+ /* Use the highest version of SPIRV supported by SPIRV-Tools. */
+ constexpr spv_target_env spirv_target = SPV_ENV_UNIVERSAL_1_6;
+ 
+@@ -917,27 +926,29 @@ clc_compile_to_llvm_module(LLVMContext &
+    // GetResourcePath is a way to retrieve the actual libclang resource dir based on a given binary
+    // or library.
+    auto tmp_res_path =
+-#if LLVM_VERSION_MAJOR >= 20
++#if LLVM_VERSION_MAJOR >= 22
++      clang::GetResourcesPath(std::string(clang_path));
++#elif LLVM_VERSION_MAJOR >= 20
+       Driver::GetResourcesPath(std::string(clang_path));
+ #else
+       Driver::GetResourcesPath(std::string(clang_path), CLANG_RESOURCE_DIR);
+ #endif
+-   auto clang_res_path = fs::path(tmp_res_path) / "include";
++   auto clang_res_path = tmp_res_path + "/include";
+ 
+    free(clang_path);
+ 
+    c->getHeaderSearchOpts().UseBuiltinIncludes = true;
+    c->getHeaderSearchOpts().UseStandardSystemIncludes = true;
+-   c->getHeaderSearchOpts().ResourceDir = clang_res_path.string();
++   c->getHeaderSearchOpts().ResourceDir = clang_res_path;
+ 
+    // Add opencl-c generic search path
+-   c->getHeaderSearchOpts().AddPath(clang_res_path.string(),
++   c->getHeaderSearchOpts().AddPath(clang_res_path,
+                                     clang::frontend::Angled,
+                                     false, false);
+ 
+    auto clang_install_res_path =
+-      fs::path(LLVM_LIB_DIR) / "clang" / std::to_string(LLVM_VERSION_MAJOR) / "include";
+-   c->getHeaderSearchOpts().AddPath(clang_install_res_path.string(),
++      std::string(LLVM_LIB_DIR) + "/clang/" + std::to_string(LLVM_VERSION_MAJOR) + "/include";
++   c->getHeaderSearchOpts().AddPath(clang_install_res_path,
+                                     clang::frontend::Angled,
+                                     false, false);
+ #endif
diff --git a/panfrost-shareable-res.patch b/panfrost-shareable-res.patch
new file mode 100644
index 0000000..959f348
--- /dev/null
+++ b/panfrost-shareable-res.patch
@@ -0,0 +1,11 @@
+--- mesa-25.1.9/src/gallium/drivers/panfrost/pan_resource.c.orig	2025-08-27 18:58:02.000000000 +0200
++++ mesa-25.1.9/src/gallium/drivers/panfrost/pan_resource.c	2025-11-22 22:34:49.604439615 +0100
+@@ -875,7 +875,7 @@
+       uint32_t flags = PAN_BO_DELAY_MMAP;
+ 
+       /* If the resource is never exported, we can make the BO private. */
+-      if (template->bind & PIPE_BIND_SHARED)
++      //if (template->bind & PIPE_BIND_SHARED)
+          flags |= PAN_BO_SHAREABLE;
+ 
+       so->bo =
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libvdpau-driver-gallium.git/commitdiff/616759c530aff0324ee4ee8c2639fdbe47b91a28



More information about the pld-cvs-commit mailing list