Skip to content

llvm-mesa, mesa: LLVM 22.1.5 / Mesa 26.0.6 + virtio + teflon (rocket, etnaviv)#114

Open
dangowrt wants to merge 2 commits into
openwrt:masterfrom
dangowrt:mesa-26.0.6
Open

llvm-mesa, mesa: LLVM 22.1.5 / Mesa 26.0.6 + virtio + teflon (rocket, etnaviv)#114
dangowrt wants to merge 2 commits into
openwrt:masterfrom
dangowrt:mesa-26.0.6

Conversation

@dangowrt
Copy link
Copy Markdown
Member

@dangowrt dangowrt commented May 9, 2026

Maintainer: @dangowrt

This PR bundles three related updates: the Mesa-internal LLVM
(feeds/video/libs/llvm/, often called llvm-mesa), Mesa itself,
and three new sub-packages exposed by the Mesa 26 update.

llvm-mesa: update to 22.1.5 / SPIRV-LLVM-Translator 22.1.2

  • LLVM: 21.1.3 → 22.1.5
  • SPIRV-LLVM-Translator: 21.1.1 → 22.1.2

The SPIRV-LLVM-Translator's major version tracks LLVM's major, so it
caps which LLVM major we can move to. Khronos has now shipped v22.1.2
(latest 22.x), allowing the major bump.

Two LLVM 22 build-system adjustments:

  1. LIBCLC_TARGETS_TO_BUILD got stricter target-name validation —
    amdgcn--amdhsa is rejected in favour of amdgcn-amd-amdhsa,
    and the 32-bit nvptx-- / nvptx--nvidiacl targets are gone.
  2. libclc bytecode now installs under
    usr/lib/clang/<major>/lib/libclc/ rather than the previous
    usr/share/clc/.

mesa: update to 26.0.6 (from 25.2.4)

  • Drop 001-gallivm-support-LLVM-21.patch (merged upstream in 26.0).
  • Refresh the remaining downstream patches.
  • Add +libdisplay-info to every libvulkan-* package's
    DEPENDS (broadcom, imagination, intel, intel-hasvk, lvp,
    panfrost, radeon, virtio) — Mesa 26 unconditionally pulls
    libdisplay-info into the WSI Vulkan path on Linux. Every ICD
    now NEEDED-links libdisplay-info.so.3; shlibs check rejects
    any package without the explicit dep. libvulkan-nouveau is
    @BROKEN (Rust) so it's untouched.
  • Rename the imagination-experimental vulkan-drivers value to
    plain imagination (renamed upstream in Mesa 26).

New packages — libvulkan-virtio, libteflon-rocket, libteflon-etnaviv

libvulkan-virtio — venus

The virtio-gpu Vulkan ICD, useful for VM / container guests that
forward Vulkan to the host GPU via virtio-gpu. Mirrors libvulkan-lvp's
install pattern; new VULKAN_DRIVERS+=virtio block in the Makefile.

libteflon-rocket / libteflon-etnaviv — TFLite NPU delegates

Mesa's teflon TFLite delegate links one or more NPU back-ends into
a libteflon.so that TensorFlow Lite loads as an external delegate.
The two variants here cover the NPU silicon on OpenWrt-supported
hardware:

Variant NPU silicon OpenWrt target / boards
libteflon-rocket Rockchip RKNPU on RK3566 / RK3568 / RK3588(s) rockchip/armv8
libteflon-etnaviv VeriSilicon VIP9000 (NXP i.MX 8M Plus, i.MX 95) imx/cortexa53

The Arm Ethos-U back-end is omitted (Cortex-M55 MCU territory, not
OpenWrt's runtime). Each variant is its own VARIANT= mesa build with
-Dgallium-drivers=<rocket|etnaviv> -Dteflon=true. Both install
/usr/lib/libteflon.so, so the two packages declare each other as
CONFLICTS.

A small downstream patch
300-teflon-conditional-npu-drivers.patch makes the
driver_etnaviv / driver_rocket / driver_ethosu link_with
entries in src/gallium/targets/teflon/meson.build conditional on
with_gallium_<X>.

A note on the embedded llvm-mesa

feeds/video/libs/llvm/ is a deliberate exception to the OpenWrt
"package each library separately, share via dynamic linking" rule:
Mesa-specific build (no RTTI, narrowed target list, static-only)
incompatible with what a system LLVM would expose; consumed at
link-time only and inlined into libgallium*.so / libvulkan_*.so.

Upstream:

@dangowrt dangowrt changed the title mesa: update to 26.0.6 llvm-mesa, mesa: update to LLVM 22.1.5 / Mesa 26.0.6 May 9, 2026
@dangowrt dangowrt force-pushed the mesa-26.0.6 branch 3 times, most recently from 246d851 to 5276a0d Compare May 10, 2026 11:29
@dangowrt dangowrt changed the title llvm-mesa, mesa: update to LLVM 22.1.5 / Mesa 26.0.6 llvm-mesa, mesa: LLVM 22.1.5 / Mesa 26.0.6 + virtio + teflon (rocket, etnaviv) May 10, 2026
@dangowrt dangowrt force-pushed the mesa-26.0.6 branch 2 times, most recently from dc852ba to 63f1ff5 Compare May 13, 2026 22:18
dangowrt added 2 commits May 15, 2026 00:47
Bump the Mesa-internal LLVM (kept in feeds/video/libs/llvm/) from
21.1.3 to 22.1.5, and the matching SPIRV-LLVM-Translator from
21.1.1 to 22.1.2.

The SPIRV-LLVM-Translator's major version tracks LLVM's major,
so it caps which LLVM major we can move to. Khronos has now
shipped v22.1.2 (latest in the 22.x series), allowing the LLVM
major bump.

Mesa 26.0.6 sets only a minimum LLVM (>= 18 / 15 / 8 depending
on the requested driver set); no upper bound, so LLVM 22.x is
acceptable.

Two LLVM 22 build-system changes need adapting in the Makefile:

 1. LIBCLC_TARGETS_TO_BUILD got stricter target name validation:
    'amdgcn--amdhsa' is rejected in favour of 'amdgcn-amd-amdhsa',
    and the 32-bit nvptx ('nvptx--', 'nvptx--nvidiacl') targets
    were dropped (the 64-bit equivalents remain).

 2. libclc bytecode now installs under
    'usr/lib/clang/<major>/lib/libclc/' rather than the previous
    'usr/share/clc/'. Adjust the SPIR-V .spv copy in Build/Install
    to source from the new location (a glob on the major version
    avoids re-touching this on the next bump).

The downstream 100-allow-arc-target.patch still applies unchanged.

Link: https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.5
Link: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/releases/tag/v22.1.2
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Bump mesa from 25.2.4 to latest stable point release in the 26.0.x
series.

Drop 001-gallivm-support-LLVM-21.patch which has been merged
upstream. Refresh the remaining downstream patches
(100-meson-allow-using-LLVM-as-embedded-project,
200-panfrost-Enable-cross-compilation-of-precompilers-on) for
the new upstream context.

Add +libdisplay-info to the DEPENDS of every libvulkan-* package
(broadcom, imagination, intel, intel-hasvk, lvp, panfrost, radeon,
virtio): Mesa 26.0 unconditionally pulls libdisplay-info into the
WSI Vulkan path on Linux (gated only by host_machine.system() ==
'windows'), so every ICD now NEEDED-links libdisplay-info.so.3
and OpenWrt's shlibs check rejects packages without the explicit
dependency. libvulkan-nouveau is @broken (needs Rust) so it does
not get touched.

The 'imagination-experimental' vulkan-drivers value got renamed to
plain 'imagination' in Mesa 26; update the VULKAN_DRIVERS entry
accordingly.

Add 'imagination' to the host build's -Dtools= list so the
PowerVR pco_clc precompiler is built and installed into
$(STAGING_DIR_HOSTPKG)/bin/ during the host-build stage. The
target vulkan variant uses -Dprecomp-compiler=system and looks
the binary up there via find_program('pco_clc', native:true);
without this, the target configure stage fails with
"Program 'pco_clc' not found or not executable" as soon as the
imagination vulkan driver enters the gallium tree.

New packages:

* libvulkan-virtio: the venus virtio-gpu Vulkan ICD, useful for
  VM/container guests forwarding Vulkan to a host GPU. Mirrors the
  libvulkan-lvp install pattern. Wired via VULKAN_DRIVERS+=virtio.

* libteflon-rocket and libteflon-etnaviv: two flavours of mesa's
  "teflon" TensorFlow Lite delegate. teflon links one or more NPU
  back-ends from gallium into a libteflon.so that TFLite loads as
  an external delegate. The two variants here cover the NPU silicon
  found on OpenWrt-supported hardware:

  - rocket: Rockchip RKNPU on RK3566 / RK3568 / RK3588(s)
    (rockchip/armv8 target).
  - etnaviv: VeriSilicon VIP9000-class NPU on NXP i.MX 8M Plus and
    i.MX 95 (imx/cortexa53 target).

  The Arm Ethos-U back-end is omitted; it targets Cortex-M55 MCUs
  which OpenWrt does not run on.

  Each variant is its own VARIANT= mesa build with
  -Dgallium-drivers=<rocket|etnaviv> -Dteflon=true; both produce
  /usr/lib/libteflon.so so the two packages declare each other as
  CONFLICTS (typical OpenWrt mesa-variant pattern).

A small downstream patch (300-teflon-conditional-npu-drivers.patch)
adjusts src/gallium/targets/teflon/meson.build so that the
driver_etnaviv / driver_rocket / driver_ethosu link_with entries
are conditional on with_gallium_<X> instead of unconditional.
Without it, building libteflon with only one back-end fails because
the other driver_X meson variables are undefined when the
corresponding gallium-driver is not selected.

Tested locally on aarch64_cortex-a53 (mediatek/filogic) building
the existing softpipe / llvmpipe / vulkan (now with virtio) variants
plus the new teflon-rocket and teflon-etnaviv variants in turn;
each produces its respective .apk with all NEEDED-links resolved
by the declared DEPENDS.

Link: https://docs.mesa3d.org/relnotes/26.0.6.html
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant