Skip to content

Commit 9834980

Browse files
committed
mesa: update to version 25.2.4
Mesa 25.2 brings a bunch of new features, especially the Panfrost Vulkan driver saw many improvements. See https://docs.mesa3d.org/relnotes.html for details about what has happened since Mesa 25.1.6. Note that OSMesa as well as the old OpenCL 1.1 support has been dropped. The new Rusticl OpenCL implementation cannot be supported yet as OpenWrt's meson integration still lacks support for Rust at this point. Signed-off-by: Daniel Golle <[email protected]>
1 parent 936604e commit 9834980

6 files changed

+360
-272
lines changed

libs/mesa/Makefile

Lines changed: 21 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
include $(TOPDIR)/rules.mk
22

33
PKG_NAME:=mesa
4-
PKG_VERSION:=25.1.6
4+
PKG_VERSION:=25.2.4
55
PKG_RELEASE:=1
66

77
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
88
PKG_SOURCE_URL:=https://archive.mesa3d.org/
9-
PKG_HASH:=9f2b69eb39d2d8717d30a9868fdda3e0c0d3708ba32778bbac8ddb044538ce84
9+
PKG_HASH:=a370b4c549cbfbe646b319e34d73edb50ed883978f5e95133f282f0eae39ab52
1010

1111
PKG_MAINTAINER:=Daniel Golle <[email protected]>
1212
PKG_LICENSE:=BSD-3-Clause
1313

1414
PKG_INSTALL:=1
1515

16-
PKG_BUILD_DEPENDS:=glslang/host python3/host libva MESA_USE_LLVM:llvm MESA_USE_LLVM:mesa/host
16+
PKG_BUILD_DEPENDS:=glslang/host python3/host libva vulkan-headers \
17+
MESA_USE_LLVM:llvm MESA_USE_LLVM:mesa/host
1718

1819
HOST_BUILD_DEPENDS:=python3/host spirv-tools/host llvm
1920

@@ -30,10 +31,6 @@ PKG_CONFIG_DEPENDS:= \
3031
CONFIG_PACKAGE_libmesa-zink \
3132
CONFIG_PACKAGE_libmesa-softpipe \
3233
CONFIG_PACKAGE_libmesa-llvmpipe \
33-
CONFIG_PACKAGE_libopencl-amd \
34-
CONFIG_PACKAGE_libopencl-nouveau \
35-
CONFIG_PACKAGE_libosmesa-softpipe \
36-
CONFIG_PACKAGE_libosmesa-llvmpipe \
3734
CONFIG_PACKAGE_libvulkan-broadcom \
3835
CONFIG_PACKAGE_libvulkan-imagination \
3936
CONFIG_PACKAGE_libvulkan-intel \
@@ -318,36 +315,6 @@ fastest software rasterizer for Mesa.
318315
endef
319316

320317

321-
define Package/libopencl/Default
322-
$(call Package/mesa/Default)
323-
TITLE+= OpenCL
324-
PROVIDES:=libopencl
325-
DEPENDS+=+MESA_USE_LLVM:libclang-cpp +libdrm +libelf +libexpat +libstdcpp \
326-
+libzstd +zlib @MESA_USE_LLVM
327-
endef
328-
329-
330-
define Package/libopencl-amd
331-
$(call Package/libopencl/Default)
332-
TITLE+= (AMD)
333-
VARIANT:=amd
334-
endef
335-
336-
define Package/libopencl-amd/description
337-
Mesa Clover OpenCL 1.1 library for AMD GPUs.
338-
endef
339-
340-
341-
define Package/libopencl-nouveau
342-
$(call Package/libopencl/Default)
343-
TITLE+= (nVidia)
344-
VARIANT:=nouveau
345-
endef
346-
347-
define Package/libopencl-nouveau/description
348-
Mesa Clover OpenCL 1.1 library for nVidia GPUs.
349-
endef
350-
351318
define Package/libvulkan-broadcom
352319
$(call Package/mesa/Default)
353320
DEPENDS+=+libdrm +libexpat +libstdcpp +libudev +libwayland +libzstd +zlib \
@@ -517,10 +484,8 @@ MESON_HOST_ARGS += \
517484
-Dprecomp-compiler=enabled \
518485
-Dshared-llvm=disabled \
519486
-Ddraw-use-llvm=false \
520-
-Dintel-clc=enabled \
521487
-Dintel-elk=true \
522488
-Dstatic-libclc=all \
523-
-Dinstall-intel-clc=true \
524489
-Dinstall-mesa-clc=true \
525490
-Dinstall-precomp-compiler=true
526491

@@ -538,11 +503,10 @@ MESON_ARGS += \
538503
-Dvalgrind=disabled \
539504
-Dtools= \
540505
-Dllvm=$(if $(CONFIG_MESA_USE_LLVM),en,dis)abled \
541-
-Dgallium-opencl=$(if $(CONFIG_MESA_USE_LLVM),standalone,disabled) \
542506
-Ddraw-use-llvm=$(if $(CONFIG_MESA_USE_LLVM),true,false) \
543-
-Dintel-clc=system \
544507
-Dmesa-clc=$(if $(CONFIG_MESA_USE_LLVM),system,auto) \
545-
-Dprecomp-compiler=system
508+
-Dprecomp-compiler=system \
509+
-Dlegacy-wayland=bind-wayland-display
546510

547511
ifeq ($(BUILD_VARIANT),amd)
548512
MESON_ARGS += \
@@ -592,14 +556,12 @@ endif
592556

593557
ifeq ($(BUILD_VARIANT),llvmpipe)
594558
MESON_ARGS += \
595-
-Dgallium-drivers=llvmpipe \
596-
-Dosmesa=$(if $(CONFIG_PACKAGE_libosmesa-llvmpipe),true,false)
559+
-Dgallium-drivers=llvmpipe
597560
endif
598561

599562
ifeq ($(BUILD_VARIANT),softpipe)
600563
MESON_ARGS += \
601-
-Dgallium-drivers=softpipe \
602-
-Dosmesa=$(if $(CONFIG_PACKAGE_libosmesa-softpipe),true,false)
564+
-Dgallium-drivers=softpipe
603565
endif
604566

605567
ifeq ($(BUILD_VARIANT),vulkan)
@@ -642,8 +604,9 @@ define Host/Configure
642604
$(call Host/Configure/Meson)
643605
endef
644606

645-
define Build/Configure
646-
$(call Py3Build/InstallBuildDepends)
607+
608+
ifneq ($(CONFIG_MESA_USE_LLVM),)
609+
define Build/Configure/LLVMMesa
647610
$(INSTALL_DIR) $(PKG_BUILD_DIR)/subprojects/llvm
648611
$(LN) $(STAGING_DIR)/usr/bin $(PKG_BUILD_DIR)/subprojects/llvm
649612
$(LN) $(STAGING_DIR)/usr/include $(PKG_BUILD_DIR)/subprojects/llvm
@@ -659,6 +622,16 @@ define Build/Configure
659622
echo -n "$$$${next_comma}'$$$${lib}'" ; \
660623
next_comma=', ' ; \
661624
done ) ; $(SED) "s%@LLVM_LIBS@%$$$${LLVM_LIBS}%" $(PKG_BUILD_DIR)/subprojects/llvm/meson.build
625+
endef
626+
else
627+
define Build/Configure/LLVMMesa
628+
endef
629+
endif
630+
631+
632+
define Build/Configure
633+
$(call Build/Configure/LLVMMesa)
634+
$(call Py3Build/InstallBuildDepends)
662635
$(call Build/Configure/Meson)
663636
endef
664637

@@ -686,11 +659,6 @@ define Package/libmesa/install
686659
$(CP) $(PKG_INSTALL_DIR)/usr/share/drirc.d/* $(1)/usr/share/drirc.d
687660
endef
688661

689-
define Package/libopencl/install
690-
$(INSTALL_DIR) $(1)/usr/lib
691-
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libOpenCL.so* $(1)/usr/lib
692-
endef
693-
694662
define Package/libvulkan-radeon/install
695663
$(INSTALL_DIR) $(1)/usr/lib
696664
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libvulkan_radeon.so $(1)/usr/lib
@@ -761,9 +729,6 @@ Package/libmesa-zink/install = $(Package/libmesa/install)
761729
Package/libmesa-softpipe/install = $(Package/libmesa/install)
762730
Package/libmesa-llvmpipe/install = $(Package/libmesa/install)
763731

764-
Package/libopencl-amd/install = $(Package/libopencl/install)
765-
Package/libopencl-nouveau/install = $(Package/libopencl/install)
766-
767732
$(eval $(call BuildPackage,mesa3d))
768733
$(eval $(call BuildPackage,libmesa-amd))
769734
$(eval $(call BuildPackage,libmesa-intel))
@@ -777,8 +742,6 @@ $(eval $(call BuildPackage,libmesa-virgl))
777742
$(eval $(call BuildPackage,libmesa-zink))
778743
$(eval $(call BuildPackage,libmesa-softpipe))
779744
$(eval $(call BuildPackage,libmesa-llvmpipe))
780-
$(eval $(call BuildPackage,libopencl-amd))
781-
$(eval $(call BuildPackage,libopencl-nouveau))
782745
$(eval $(call BuildPackage,libvulkan-broadcom))
783746
$(eval $(call BuildPackage,libvulkan-imagination))
784747
$(eval $(call BuildPackage,libvulkan-intel))
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
From cd129dbf8af2d16b1243f2ce287ff69c6a5dc557 Mon Sep 17 00:00:00 2001
2+
From: no92 <[email protected]>
3+
Date: Wed, 27 Aug 2025 16:02:31 +0200
4+
Subject: [PATCH] gallivm: support LLVM 21
5+
6+
LLVM PR#146819 changed the signature of `setObjectLinkingLayerCreator`,
7+
dropping the Triple argument. The PR was first included in the LLVM 21
8+
series, and the new signature is gated behind a version check for that.
9+
10+
`LLVMOrcThreadSafeContextGetContext` was removed in LLVM commit b18e5b6,
11+
and the ORC examples in the LLVM tree seem to just create a context
12+
instead, which we replicate here.
13+
14+
With this commit, mesa successfully builds the llvmpipe gallium driver
15+
on riscv64 with LLVM 21.1.0.
16+
17+
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13785
18+
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13852
19+
20+
Reviewed-by: David Heidelberg <[email protected]>
21+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37027>
22+
---
23+
src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp | 7 ++++++-
24+
1 file changed, 6 insertions(+), 1 deletion(-)
25+
26+
--- a/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp
27+
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp
28+
@@ -340,7 +340,12 @@ LPJit::LPJit() :jit_dylib_count(0) {
29+
.setJITTargetMachineBuilder(std::move(JTMB))
30+
#ifdef USE_JITLINK
31+
.setObjectLinkingLayerCreator(
32+
+#if LLVM_VERSION_MAJOR >= 21
33+
+ /* LLVM 21 removed the Triple argument */
34+
+ [&](ExecutionSession &ES) {
35+
+#else
36+
[&](ExecutionSession &ES, const llvm::Triple &TT) {
37+
+#endif
38+
return std::make_unique<ObjectLinkingLayer>(
39+
ES, ExitOnErr(llvm::jitlink::InProcessMemoryManager::Create()));
40+
})
41+
@@ -552,7 +557,7 @@ init_gallivm_state(struct gallivm_state
42+
gallivm->cache = cache;
43+
44+
gallivm->_ts_context = context->ref;
45+
- gallivm->context = LLVMOrcThreadSafeContextGetContext(context->ref);
46+
+ gallivm->context = LLVMContextCreate();
47+
48+
gallivm->module_name = LPJit::get_unique_name(name);
49+
gallivm->module = LLVMModuleCreateWithNameInContext(gallivm->module_name,
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
From 6334f0f57472410f9363f5b5d6bc6c68601f14d7 Mon Sep 17 00:00:00 2001
2+
From: Daniel Golle <[email protected]>
3+
Date: Mon, 13 Oct 2025 01:19:44 +0100
4+
Subject: [PATCH 1/2] meson: allow using LLVM as embedded project
5+
6+
---
7+
meson.build | 33 +++++++++++++++++++++------------
8+
src/compiler/clc/meson.build | 4 ++--
9+
2 files changed, 23 insertions(+), 14 deletions(-)
10+
11+
--- a/meson.build
12+
+++ b/meson.build
13+
@@ -1748,17 +1748,29 @@ _shared_llvm = get_option('shared-llvm')
14+
.disable_auto_if(host_machine.system() == 'windows') \
15+
.allowed()
16+
17+
-dep_llvm = dependency(
18+
- 'llvm',
19+
- method : host_machine.system() == 'windows' ? 'auto' : 'config-tool',
20+
- version : _llvm_version,
21+
- modules : llvm_modules,
22+
- optional_modules : llvm_optional_modules,
23+
- required : with_llvm,
24+
- static : not _shared_llvm,
25+
- fallback : ['llvm', 'dep_llvm'],
26+
- include_type : 'system',
27+
-)
28+
+_llvm_subproject_dir = meson.project_source_root() / 'subprojects' / 'llvm'
29+
+_has_llvm_subproject = import('fs').is_dir(_llvm_subproject_dir)
30+
+if _has_llvm_subproject
31+
+ llvm_proj = subproject('llvm', required : false)
32+
+else
33+
+ llvm_proj = disabler()
34+
+endif
35+
+
36+
+if _has_llvm_subproject and llvm_proj.found()
37+
+ dep_llvm = llvm_proj.get_variable('dep_llvm')
38+
+else
39+
+ dep_llvm = dependency(
40+
+ 'llvm',
41+
+ method : host_machine.system() == 'windows' ? 'auto' : 'config-tool',
42+
+ version : _llvm_version,
43+
+ modules : llvm_modules,
44+
+ optional_modules : llvm_optional_modules,
45+
+ required : with_llvm,
46+
+ static : not _shared_llvm,
47+
+ fallback : ['llvm', 'dep_llvm'],
48+
+ include_type : 'system',
49+
+ )
50+
+endif
51+
if dep_llvm.found()
52+
pre_args += '-DMESA_LLVM_VERSION_STRING="@0@"'.format(dep_llvm.version())
53+
pre_args += '-DLLVM_IS_SHARED=@0@'.format(_shared_llvm.to_int())
54+
@@ -1842,7 +1854,11 @@ endif
55+
56+
dep_clang = null_dep
57+
if with_clc
58+
- llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
59+
+ if dep_llvm.type_name() == 'internal'
60+
+ llvm_libdir = subproject('llvm').get_variable('libdir')
61+
+ else
62+
+ llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
63+
+ endif
64+
65+
dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false)
66+
67+
--- a/src/compiler/clc/meson.build
68+
+++ b/src/compiler/clc/meson.build
69+
@@ -25,14 +25,14 @@ if not _shared_llvm or \
70+
71+
opencl_c_base_h = custom_target(
72+
'opencl-c-base.h',
73+
- input : [files_xxd, join_paths(clang_resource_dir, 'opencl-c-base.h')],
74+
+ input : [files_xxd, 'opencl-c-base.h'],
75+
output : 'opencl-c-base.h.h',
76+
command : [prog_python, '@INPUT@', '@OUTPUT@', '-n', 'opencl_c_base_source'],
77+
)
78+
79+
opencl_c_h = custom_target(
80+
'opencl-c.h',
81+
- input : [files_xxd, join_paths(clang_resource_dir, 'opencl-c.h')],
82+
+ input : [files_xxd, 'opencl-c.h'],
83+
output : 'opencl-c.h.h',
84+
command : [prog_python, '@INPUT@', '@OUTPUT@', '-n', 'opencl_c_source'],
85+
)

0 commit comments

Comments
 (0)