Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libs/mesa/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=mesa
PKG_VERSION:=26.1.2
PKG_VERSION:=26.2.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://archive.mesa3d.org/
PKG_HASH:=bac2bca9121897a2b8162e79636b50ac998fca799c8e6cf914edd85962babdf0
PKG_HASH:=c47e81bddc4760360a41ac3c5acec38acb81f9d750ecef47e7f3adc7021a4442

PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=BSD-3-Clause
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Mon, 13 Oct 2025 01:32:22 +0100
Subject: panfrost: Enable cross-compilation of precompilers on non-Linux hosts
Date: Mon, 13 Oct 2025 02:42:15 +0100
Subject: [PATCH] panfrost: Enable cross-compilation of precompilers on
non-Linux hosts

This patch enables building Mesa's Panfrost precompilers on non-Linux
hosts (macOS, Windows, etc.) by introducing a stub kernel mode driver
Expand Down Expand Up @@ -29,15 +31,26 @@ Changes:
4. Extended panfrost build to support with_drivers_clc for CLC
precompiler requirements

Refreshed against Mesa 26.1.1: the per-arch source list now contains
pan_buffer.c, pan_fb.c and pan_fb_nir.c in addition to pan_blend.c
and pan_texture.c. All of those include pan_desc.h transitively but
do not call into kmod, so they can build against the stub header on
non-Linux hosts.
Refreshed against Mesa 26.2.1: upstream added a 'v14' pixel-format/
per-arch variant and a soong_compat_c_args entry to libpanfrost_lib's
c_args; both carried through unchanged into the stub/full-driver split.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
src/meson.build | 2 +-
src/panfrost/lib/kmod/pan_kmod_stub.h | 29 +++++++++++++
src/panfrost/lib/meson.build | 59 +++++++++++++++++++--------
src/panfrost/lib/pan_desc.h | 4 ++
src/panfrost/lib/pan_image.h | 4 ++
src/panfrost/meson.build | 2 +-
6 files changed, 82 insertions(+), 18 deletions(-)
create mode 100644 src/panfrost/lib/kmod/pan_kmod_stub.h

diff --git a/src/meson.build b/src/meson.build
index c36f44b..919eb36 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -92,7 +92,7 @@ endif
@@ -101,7 +101,7 @@ endif
if with_any_intel
subdir('intel')
endif
Expand All @@ -46,6 +59,9 @@ non-Linux hosts.
subdir('panfrost')
endif
if with_microsoft_clc or with_gallium_d3d12 or with_spirv_to_dxil or with_microsoft_vk
diff --git a/src/panfrost/lib/kmod/pan_kmod_stub.h b/src/panfrost/lib/kmod/pan_kmod_stub.h
new file mode 100644
index 0000000..44b9e07
--- /dev/null
+++ b/src/panfrost/lib/kmod/pan_kmod_stub.h
@@ -0,0 +1,29 @@
Expand Down Expand Up @@ -78,6 +94,8 @@ non-Linux hosts.
+#if defined(__cplusplus)
+} /* extern C */
+#endif
diff --git a/src/panfrost/lib/meson.build b/src/panfrost/lib/meson.build
index 55b6757..213d85d 100644
--- a/src/panfrost/lib/meson.build
+++ b/src/panfrost/lib/meson.build
@@ -2,7 +2,9 @@
Expand All @@ -89,7 +107,7 @@ non-Linux hosts.
+ subdir('kmod')
+endif

pixel_format_versions = ['5', '6', '7', '9', '10', '12', '13']
pixel_format_versions = ['5', '6', '7', '9', '10', '12', '13', '14']
libpanfrost_pixel_format = []
@@ -21,21 +23,28 @@ foreach ver : pixel_format_versions
endforeach
Expand All @@ -112,7 +130,7 @@ non-Linux hosts.
+ libpanfrost_per_arch_c_args += '-DPAN_KMOD_STUB'
+endif

foreach ver : ['4', '5', '6', '7', '9', '10', '12', '13']
foreach ver : ['4', '5', '6', '7', '9', '10', '12', '13', '14']
libpanfrost_per_arch += static_library(
- 'pan-arch-v' + ver,
- [
Expand Down Expand Up @@ -149,7 +167,7 @@ non-Linux hosts.
+ libpanfrost_link_with += libpankmod_lib
+endif
+
+libpanfrost_lib_c_args = [no_override_init_args]
+libpanfrost_lib_c_args = [no_override_init_args, soong_compat_c_args]
+if not (with_gallium_panfrost or with_panfrost_vk)
+ libpanfrost_lib_c_args += '-DPAN_KMOD_STUB'
+endif
Expand All @@ -158,7 +176,7 @@ non-Linux hosts.
'panfrost_lib',
[libpanfrost_lib_files, pan_packers],
include_directories : [inc_include, inc_src, inc_panfrost],
- c_args : [no_override_init_args],
- c_args : [no_override_init_args, soong_compat_c_args],
+ c_args : libpanfrost_lib_c_args,
gnu_symbol_visibility : 'hidden',
dependencies: [dep_libdrm, idep_nir, idep_mesautil, libpanfrost_model_dep],
Expand All @@ -173,13 +191,15 @@ non-Linux hosts.
+endif
+
libpanfrost_dep = declare_dependency(
link_with: [libpanfrost_lib, libpanfrost_decode, libpanfrost_compiler, libpanfrost_pixel_format, libpanfrost_per_arch],
link_with: [libpanfrost_lib, libpanfrost_decode, 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
diff --git a/src/panfrost/lib/pan_desc.h b/src/panfrost/lib/pan_desc.h
index 34bdabe..d556796 100644
--- a/src/panfrost/lib/pan_desc.h
+++ b/src/panfrost/lib/pan_desc.h
@@ -8,7 +8,11 @@
Expand All @@ -194,17 +214,8 @@ non-Linux hosts.
#include "pan_image.h"
#include "pan_pool.h"

--- a/src/panfrost/meson.build
+++ b/src/panfrost/meson.build
@@ -14,7 +14,7 @@ subdir('shared')
subdir('model')
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('genxml')
subdir('lib')
subdir('clc')
diff --git a/src/panfrost/lib/pan_image.h b/src/panfrost/lib/pan_image.h
index 642f4a6..3c0e098 100644
--- a/src/panfrost/lib/pan_image.h
+++ b/src/panfrost/lib/pan_image.h
@@ -18,7 +18,11 @@
Expand All @@ -219,3 +230,19 @@ non-Linux hosts.

#include "util/log.h"

diff --git a/src/panfrost/meson.build b/src/panfrost/meson.build
index cb928b1..68bf5d7 100644
--- a/src/panfrost/meson.build
+++ b/src/panfrost/meson.build
@@ -34,7 +34,7 @@ endif
subdir('shared')
subdir('model')

-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('genxml')
subdir('lib')
endif
--
2.55.0

20 changes: 20 additions & 0 deletions libs/mesa/patches/300-teflon-conditional-npu-drivers.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Sat, 9 May 2026 01:37:16 +0100
Subject: [PATCH] teflon: make linked NPU driver dependencies conditional

libteflon unconditionally linked driver_etnaviv, driver_rocket and
driver_ethosu, even when the corresponding gallium driver is disabled,
causing a link failure. Build the dependency list conditionally on
with_gallium_etnaviv/with_gallium_rocket/with_gallium_ethosu instead.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
src/gallium/targets/teflon/meson.build | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/gallium/targets/teflon/meson.build b/src/gallium/targets/teflon/meson.build
index fa8b9c4..a82c13f 100644
--- a/src/gallium/targets/teflon/meson.build
+++ b/src/gallium/targets/teflon/meson.build
@@ -1,3 +1,14 @@
Expand Down Expand Up @@ -30,3 +47,6 @@
install : true,
)

--
2.55.0

11 changes: 0 additions & 11 deletions libs/mesa/patches/400-gallivm-lp-bld-misc-auto-iter-llvm22.patch

This file was deleted.

17 changes: 14 additions & 3 deletions libs/mesa/patches/600-zink-allow-kms-only-display-fd.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Mon, 25 May 2026 22:00:00 +0100
Subject: zink: allow KMS-only display fd to fall through to default
Date: Tue, 26 May 2026 01:55:36 +0100
Subject: [PATCH] zink: allow KMS-only display fd to fall through to default
Vulkan device selection

When MESA_LOADER_DRIVER_OVERRIDE=zink is used with a GBM device created
Expand All @@ -16,9 +17,16 @@ whichever ICD vkEnumeratePhysicalDevices() reports first (PowerVR on
JH7110). Cross-device dma-buf import via VK_KHR_external_memory_fd
takes care of getting the rendered frame onto the display controller.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
src/gallium/drivers/zink/zink_screen.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index c11c6a2..2ef6527 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -3862,10 +3862,15 @@ zink_render_rdev(int fd, int64_t *dev_ma
@@ -3882,10 +3882,15 @@ zink_render_rdev(int fd, int64_t *dev_major, int64_t *dev_minor)
if (drmGetDevice2(fd, 0, &dev))
return -1;

Expand All @@ -37,3 +45,6 @@ takes care of getting the rendered frame onto the display controller.

if(stat(dev->nodes[DRM_NODE_RENDER], &stx)) {
ret = -1;
--
2.55.0

Loading