mesa: update to 25.1.5

Support for off-screen rendering ("libOSMesa") has been dropped upstream.

In order to still be able to cross-compile the panfrost driver also on
non-Linux buildhosts, or Linux hosts without libdrm, a patch has been
applied.

This patch has also been submitted upstream via
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36170

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle
2025-07-13 02:45:48 +01:00
parent fac36b6e21
commit 47c626a74f
3 changed files with 111 additions and 64 deletions

View File

@@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=mesa PKG_NAME:=mesa
PKG_VERSION:=25.0.5 PKG_VERSION:=25.1.5
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://archive.mesa3d.org/ PKG_SOURCE_URL:=https://archive.mesa3d.org/
PKG_HASH:=c0d245dea0aa4b49f74b3d474b16542e4a8799791cd33d676c69f650ad4378d0 PKG_HASH:=3c4f6b10ff6ee950d0ec6ea733cc6e6d34c569454e3d39a9b276de9115a3b363
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org> PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=BSD-3-Clause PKG_LICENSE:=BSD-3-Clause
@@ -149,7 +149,7 @@ endef
define Package/libmesa-tegra define Package/libmesa-tegra
$(call Package/libmesa/Default) $(call Package/libmesa/Default)
DEPENDS+=+libdrm-tegra @(aarch64||arm) DEPENDS+=+libdrm-tegra @(aarch64||arm) @MESA_USE_LLVM
TITLE+= (NVIDIA Tegra) TITLE+= (NVIDIA Tegra)
VARIANT:=tegra VARIANT:=tegra
endef endef
@@ -239,7 +239,7 @@ define Package/libmesa-panfrost
$(call Package/libmesa/Default) $(call Package/libmesa/Default)
TITLE+= (ARM Mali Midgard and later) TITLE+= (ARM Mali Midgard and later)
VARIANT:=panfrost VARIANT:=panfrost
DEPENDS+=@(aarch64||arm) DEPENDS+=@(aarch64||arm) @MESA_USE_LLVM
endef endef
define Package/libmesa-panfrost/description define Package/libmesa-panfrost/description
@@ -348,46 +348,6 @@ define Package/libopencl-nouveau/description
Mesa Clover OpenCL 1.1 library for nVidia GPUs. Mesa Clover OpenCL 1.1 library for nVidia GPUs.
endef endef
define Package/libosmesa/Default
$(call Package/mesa/Default)
DEPENDS+=+libdrm +libstdcpp +zlib +libwayland +libzstd +wayland-protocols
TITLE+= off-screen rendering library
endef
define Package/libosmesa/description/Default
Mesa's off-screen interface is used for rendering into user-allocated
memory without any sort of window system or operating system
dependencies. That is, the GL_FRONT colorbuffer is actually a buffer in
main memory, rather than a window on your display.
endef
define Package/libosmesa-softpipe
$(call Package/libosmesa/Default)
TITLE+= (Softpipe)
VARIANT:=softpipe
DEFAULT_VARIANT:=1
endef
define Package/libosmesa-softpipe/description
$(call Package/libosmesa/description/Default)
Softpipe - this is the reference Gallium software driver.
endef
define Package/libosmesa-llvmpipe
$(call Package/libosmesa/Default)
TITLE+= (LLVMpipe)
DEPENDS+=@MESA_USE_LLVM
VARIANT:=llvmpipe
endef
define Package/libosmesa-llvmpipe/description
$(call Package/libosmesa/description/Default)
LLVMpipe - this is the high-performance Gallium LLVM driver.
endef
define Package/libvulkan-broadcom define Package/libvulkan-broadcom
$(call Package/mesa/Default) $(call Package/mesa/Default)
DEPENDS+=+libdrm +libexpat +libstdcpp +libudev +libwayland +libzstd +zlib \ DEPENDS+=+libdrm +libexpat +libstdcpp +libudev +libwayland +libzstd +zlib \
@@ -483,7 +443,7 @@ endef
define Package/libvulkan-panfrost define Package/libvulkan-panfrost
$(call Package/mesa/Default) $(call Package/mesa/Default)
DEPENDS+=+libdrm +libexpat +libstdcpp +libudev +libwayland +libzstd +zlib \ DEPENDS+=+libdrm +libexpat +libstdcpp +libudev +libwayland +libzstd +zlib \
@(arm||aarch64) @(arm||aarch64) @MESA_USE_LLVM
TITLE+= ARM Mali Midgard/Bifrost/Valhall Vulkan driver TITLE+= ARM Mali Midgard/Bifrost/Valhall Vulkan driver
VARIANT:=vulkan VARIANT:=vulkan
endef endef
@@ -551,8 +511,6 @@ MESON_HOST_ARGS += \
-Dvalgrind=disabled \ -Dvalgrind=disabled \
-Dgallium-drivers= \ -Dgallium-drivers= \
-Dvulkan-drivers= \ -Dvulkan-drivers= \
-Dosmesa=false \
-Dgallium-xa=disabled \
-Dtools=nir \ -Dtools=nir \
-Dllvm=enabled \ -Dllvm=enabled \
-Dmesa-clc=enabled \ -Dmesa-clc=enabled \
@@ -560,6 +518,7 @@ MESON_HOST_ARGS += \
-Dshared-llvm=disabled \ -Dshared-llvm=disabled \
-Ddraw-use-llvm=false \ -Ddraw-use-llvm=false \
-Dintel-clc=enabled \ -Dintel-clc=enabled \
-Dintel-elk=true \
-Dstatic-libclc=all \ -Dstatic-libclc=all \
-Dinstall-intel-clc=true \ -Dinstall-intel-clc=true \
-Dinstall-mesa-clc=true \ -Dinstall-mesa-clc=true \
@@ -732,11 +691,6 @@ define Package/libopencl/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libOpenCL.so* $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libOpenCL.so* $(1)/usr/lib
endef endef
define Package/libosmesa/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libOSMesa.so* $(1)/usr/lib
endef
define Package/libvulkan-radeon/install define Package/libvulkan-radeon/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libvulkan_radeon.so $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libvulkan_radeon.so $(1)/usr/lib
@@ -810,9 +764,6 @@ Package/libmesa-llvmpipe/install = $(Package/libmesa/install)
Package/libopencl-amd/install = $(Package/libopencl/install) Package/libopencl-amd/install = $(Package/libopencl/install)
Package/libopencl-nouveau/install = $(Package/libopencl/install) Package/libopencl-nouveau/install = $(Package/libopencl/install)
Package/libosmesa-softpipe/install = $(Package/libosmesa/install)
Package/libosmesa-llvmpipe/install = $(Package/libosmesa/install)
$(eval $(call BuildPackage,mesa3d)) $(eval $(call BuildPackage,mesa3d))
$(eval $(call BuildPackage,libmesa-amd)) $(eval $(call BuildPackage,libmesa-amd))
$(eval $(call BuildPackage,libmesa-intel)) $(eval $(call BuildPackage,libmesa-intel))
@@ -828,8 +779,6 @@ $(eval $(call BuildPackage,libmesa-softpipe))
$(eval $(call BuildPackage,libmesa-llvmpipe)) $(eval $(call BuildPackage,libmesa-llvmpipe))
$(eval $(call BuildPackage,libopencl-amd)) $(eval $(call BuildPackage,libopencl-amd))
$(eval $(call BuildPackage,libopencl-nouveau)) $(eval $(call BuildPackage,libopencl-nouveau))
$(eval $(call BuildPackage,libosmesa-softpipe))
$(eval $(call BuildPackage,libosmesa-llvmpipe))
$(eval $(call BuildPackage,libvulkan-broadcom)) $(eval $(call BuildPackage,libvulkan-broadcom))
$(eval $(call BuildPackage,libvulkan-imagination)) $(eval $(call BuildPackage,libvulkan-imagination))
$(eval $(call BuildPackage,libvulkan-intel)) $(eval $(call BuildPackage,libvulkan-intel))

View File

@@ -1,6 +1,6 @@
--- a/meson.build --- a/meson.build
+++ b/meson.build +++ b/meson.build
@@ -1782,21 +1782,26 @@ _llvm = get_option('llvm') @@ -1771,21 +1771,26 @@ _llvm = get_option('llvm')
dep_llvm = null_dep dep_llvm = null_dep
with_llvm = false with_llvm = false
if _llvm.allowed() if _llvm.allowed()
@@ -42,7 +42,7 @@
endif endif
if with_llvm if with_llvm
pre_args += '-DMESA_LLVM_VERSION_STRING="@0@"'.format(dep_llvm.version()) pre_args += '-DMESA_LLVM_VERSION_STRING="@0@"'.format(dep_llvm.version())
@@ -1895,7 +1900,11 @@ endif @@ -1884,7 +1889,11 @@ endif
dep_clang = null_dep dep_clang = null_dep
if with_clc or with_gallium_clover if with_clc or with_gallium_clover
@@ -57,7 +57,7 @@
--- a/src/compiler/clc/meson.build --- a/src/compiler/clc/meson.build
+++ b/src/compiler/clc/meson.build +++ b/src/compiler/clc/meson.build
@@ -24,14 +24,14 @@ if not _shared_llvm @@ -25,14 +25,14 @@ if not _shared_llvm or \
opencl_c_base_h = custom_target( opencl_c_base_h = custom_target(
'opencl-c-base.h', 'opencl-c-base.h',
@@ -76,7 +76,7 @@
) )
--- a/src/gallium/frontends/clover/meson.build --- a/src/gallium/frontends/clover/meson.build
+++ b/src/gallium/frontends/clover/meson.build +++ b/src/gallium/frontends/clover/meson.build
@@ -26,6 +26,12 @@ if with_opencl_icd @@ -25,6 +25,12 @@ if with_opencl_icd
clover_cpp_args += '-DHAVE_CLOVER_ICD' clover_cpp_args += '-DHAVE_CLOVER_ICD'
endif endif
@@ -89,13 +89,13 @@
libclllvm = static_library( libclllvm = static_library(
'clllvm', 'clllvm',
files( files(
@@ -44,7 +50,7 @@ libclllvm = static_library( @@ -43,7 +49,7 @@ libclllvm = static_library(
clover_cpp_args, clover_cpp_args,
clover_opencl_cpp_args, clover_opencl_cpp_args,
'-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths( '-DFALLBACK_CLANG_RESOURCE_DIR="@0@"'.format(join_paths(
- dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang', - dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang',
+ llvm_libdir, 'clang', + llvm_libdir, 'clang',
dep_llvm.version(), 'include', dep_llvm.version()
)), )),
], ],
--- a/src/gallium/targets/opencl/meson.build --- a/src/gallium/targets/opencl/meson.build

View File

@@ -0,0 +1,98 @@
--- a/src/meson.build
+++ b/src/meson.build
@@ -87,7 +87,7 @@ endif
if with_imagination_vk
subdir('imagination')
endif
-if with_gallium_panfrost or with_gallium_lima or with_panfrost_vk or with_tools.contains('panfrost')
+if with_drivers_clc or with_gallium_panfrost or with_gallium_lima or with_panfrost_vk or with_tools.contains('panfrost')
subdir('panfrost')
endif
if with_microsoft_clc or with_gallium_d3d12 or with_spirv_to_dxil or with_microsoft_vk
--- a/src/panfrost/lib/meson.build
+++ b/src/panfrost/lib/meson.build
@@ -3,7 +3,9 @@
# SPDX-License-Identifier: MIT
subdir('genxml')
-subdir('kmod')
+if with_gallium_panfrost or with_panfrost_vk
+ subdir('kmod')
+endif
pixel_format_versions = ['5', '6', '7', '9', '10', '12', '13']
libpanfrost_pixel_format = []
@@ -22,16 +24,14 @@ foreach ver : pixel_format_versions
endforeach
libpanfrost_per_arch = []
+libpanfrost_per_arch_files = [ 'pan_blend.c', 'pan_shader.c', 'pan_texture.c' ]
+if with_gallium_panfrost or with_panfrost_vk
+ libpanfrost_per_arch_files += 'pan_desc.c'
+endif
foreach ver : ['4', '5', '6', '7', '9', '10', '12', '13']
libpanfrost_per_arch += static_library(
- 'pan-arch-v' + ver,
- [
- 'pan_blend.c',
- 'pan_desc.c',
- 'pan_shader.c',
- 'pan_texture.c',
- ],
+ 'pan-arch-v' + ver, libpanfrost_per_arch_files,
include_directories : [inc_include, inc_src],
c_args : ['-DPAN_ARCH=' + ver],
gnu_symbol_visibility : 'hidden',
@@ -63,10 +63,18 @@ libpanfrost_lib_files = files(
'pan_tiler.c',
'pan_layout.c',
'pan_scratch.c',
- 'pan_props.c',
'pan_util.c',
)
+if with_gallium_panfrost or with_panfrost_vk
+ libpanfrost_lib_files += files('pan_props.c')
+endif
+
+libpanfrost_link_with = [libpanfrost_pixel_format, libpanfrost_per_arch]
+if with_gallium_panfrost or with_panfrost_vk
+ libpanfrost_link_with += libpankmod_lib
+endif
+
libpanfrost_lib = static_library(
'panfrost_lib',
[libpanfrost_lib_files, pan_packers],
@@ -75,13 +83,18 @@ libpanfrost_lib = static_library(
gnu_symbol_visibility : 'hidden',
dependencies: [dep_libdrm, idep_nir, idep_mesautil],
build_by_default : false,
- link_with: [libpanfrost_pixel_format, libpanfrost_per_arch, libpankmod_lib],
+ link_with: libpanfrost_link_with,
)
+libpanfrost_dependencies = [deps_for_libpanfrost, idep_nir]
+if with_gallium_panfrost or with_panfrost_vk
+ libpanfrost_dependencies = libpankmod_dep
+endif
+
libpanfrost_dep = declare_dependency(
link_with: [libpanfrost_lib, libpanfrost_decode, libpanfrost_midgard, libpanfrost_bifrost, libpanfrost_pixel_format, libpanfrost_per_arch],
include_directories: [inc_include, inc_src, inc_panfrost],
- dependencies: [deps_for_libpanfrost, libpankmod_dep, idep_nir],
+ dependencies: libpanfrost_dependencies,
)
if with_tests
--- a/src/panfrost/meson.build
+++ b/src/panfrost/meson.build
@@ -15,7 +15,7 @@ subdir('util')
subdir('midgard')
subdir('compiler')
-if with_gallium_panfrost or with_panfrost_vk or with_tools.contains('panfrost')
+if with_drivers_clc or with_gallium_panfrost or with_panfrost_vk or with_tools.contains('panfrost')
subdir('lib')
subdir('clc')
endif