initial seed: retrofit campaign lineage from local working trees

panvk-bifrost campaigns (r1..r4 Vulkan compositor + r5.video1 Vulkan
video decode) shipped before this repo existed; the deliverable
patches live in marfrit-packages, but the reasoning chain, phase docs,
and source-state evidence lived only in local working trees on the
development host.

This retrofit imports:
- mesa-panvk-bifrost/   — r1..r4 era phase docs (iter1..iter18)
                          (libmali stub blobs at iter18/blob/ excluded
                          — 109MB of RE artifacts replaced with a README
                          pointer)
- mesa-panvk-bifrost-video/ — sibling campaign phase docs + probe
- evidence/             — frozen .tgz source snapshots at each milestone
                          (basis for the 0005 patch diff generation)

Future iterations should branch off here from day one, so each iter is
a commit rather than a snapshot. See [[feedback-session-local-process-pins]]
for the process drift this retrofit closes.

Total: 1.9 MB across 124 files.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-23 05:25:37 +02:00
parent 430d0da278
commit a4e7d8ab90
124 changed files with 22551 additions and 1 deletions
@@ -0,0 +1,67 @@
#!/bin/bash
# iter8 step-B diagnostic: install patched libvulkan_panfrost.so under LD_LIBRARY_PATH
# (no system overwrite) and characterize what Zink-on-patched-PanVk-Bifrost does.
#
# Usage on ohm (as user mfritsche):
# bash diagnose_zink_smoke.sh /path/to/built/libvulkan_panfrost.so
set -uo pipefail
LIB_SRC="${1:?usage: $0 /path/to/built/libvulkan_panfrost.so}"
if [[ ! -f "$LIB_SRC" ]]; then
echo "FAIL: $LIB_SRC not found"; exit 2
fi
STAGE=/home/mfritsche/panvk-patched-libs
mkdir -p "$STAGE"
cp "$LIB_SRC" "$STAGE/libvulkan_panfrost.so"
# Need a matching ICD JSON that points at this lib path, otherwise the loader
# uses the system one which points at /usr/lib/libvulkan_panfrost.so.
cat > "$STAGE/panfrost_icd_patched.json" <<EOF
{
"ICD": {
"api_version": "1.4.335",
"library_path": "$STAGE/libvulkan_panfrost.so"
},
"file_format_version": "1.0.1"
}
EOF
# Environment for all diagnostic runs:
COMMON_ENV=(
XDG_RUNTIME_DIR=/run/user/$(id -u)
WAYLAND_DISPLAY=wayland-0
PAN_I_WANT_A_BROKEN_VULKAN_DRIVER=1
VK_ICD_FILENAMES="$STAGE/panfrost_icd_patched.json"
)
echo
echo "===== STEP 1: vulkaninfo — does VK_EXT_robustness2 / nullDescriptor appear? ====="
env "${COMMON_ENV[@]}" vulkaninfo 2>&1 | grep -iE "driverInfo|robust|nullDescriptor" | head -15
RC1=$?
echo "(RC1=$RC1, but the real signal is whether VK_EXT_robustness2 + nullDescriptor=true appear above.)"
echo
echo "===== STEP 2: eglinfo with Zink — does Zink load against the patched lib? ====="
env "${COMMON_ENV[@]}" MESA_LOADER_DRIVER_OVERRIDE=zink eglinfo 2>&1 | grep -iE "renderer|version|zink|llvmpipe|nullDescriptor|Mali|error" | head -20
RC2=$?
echo "(if 'renderer' line mentions Mali-G52 / Zink => SUCCESS, if 'llvmpipe' => still failing)"
echo
echo "===== STEP 3: es2_info — does GLES2 context create against Zink-on-PanVk? ====="
env "${COMMON_ENV[@]}" MESA_LOADER_DRIVER_OVERRIDE=zink es2_info 2>&1 | head -30
RC3=$?
echo
echo "===== STEP 4: dmesg for GPU faults from these runs ====="
dmesg 2>/dev/null | tail -30 | grep -iE "panfrost|mali|gpu fault|page fault" | tail -10
echo
echo "===== STEP 5: minimal Zink-triggered shader workload ====="
# Run vkcube with MESA_VK_VERSION_OVERRIDE to see if Vulkan side still works
env "${COMMON_ENV[@]}" timeout 5 vkcube --c 60 --wsi wayland 2>&1 | head -5
echo "(vkcube confirms the patched lib still works for native Vulkan, no regression on iter7 baseline.)"
echo
echo "===== DONE ====="
@@ -0,0 +1,57 @@
From: claude-noether (on behalf of mfritsche)
Date: 2026-05-19
Subject: panvk: expose VK_KHR/EXT_robustness2 + nullDescriptor on Bifrost (PAN_ARCH 6/7)
Without this, Mesa's Zink driver refuses to use PanVk-Bifrost as its Vulkan
backend, falling back silently to llvmpipe (software rasterizer) for all
GL-via-Zink on Bifrost SBCs. That defeats the entire purpose of having a
Vulkan driver on Bifrost — GL acceleration via Zink is the most natural
near-term consumer.
panvk_vX_nir_lower_descriptors.c:1309 and panvk_vX_shader.c:1355 already
plumb dev->vk.enabled_features.nullDescriptor arch-agnostically — the gate
at panvk_vX_physical_device.c was set conservatively when Bifrost was
unmaintained, not because of hardware incapability.
iter17 of the panvk-bifrost campaign proved fundamental driver functions
on Mali-G52 r1 MC1 (PAN_ARCH=7). This patch is the iter8 follow-up.
robustBufferAccess2 and robustImageAccess2 are NOT flipped — they're
independent rb2 features Zink doesn't require, gated differently
(robustBufferAccess2 = PAN_ARCH >= 11, robustImageAccess2 = false), and
out of scope for iter8.
---
src/panfrost/vulkan/panvk_vX_physical_device.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/panfrost/vulkan/panvk_vX_physical_device.c b/src/panfrost/vulkan/panvk_vX_physical_device.c
--- a/src/panfrost/vulkan/panvk_vX_physical_device.c
+++ b/src/panfrost/vulkan/panvk_vX_physical_device.c
@@ -91,7 +91,7 @@ get_device_extensions(const struct panvk_physical_device *device,
.KHR_pipeline_binary = true,
.KHR_pipeline_executable_properties = true,
.KHR_pipeline_library = true,
- .KHR_robustness2 = PAN_ARCH >= 10,
+ .KHR_robustness2 = true,
.KHR_sampler_mirror_clamp_to_edge = true,
.KHR_sampler_ycbcr_conversion = true,
.KHR_separate_depth_stencil_layouts = true,
@@ -168,7 +168,7 @@ get_device_extensions(const struct panvk_physical_device *device,
.EXT_queue_family_foreign = true,
.EXT_robustness = pan_arch(device->kmod.dev->props.gpu_id) >= 9,
.EXT_image_robustness = true,
- .EXT_robustness2 = PAN_ARCH >= 10,
+ .EXT_robustness2 = true,
.EXT_sampler_filter_minmax = PAN_ARCH >= 10,
.EXT_scalar_block_layout = true,
.EXT_separate_stencil_usage = true,
@@ -493,7 +493,7 @@ get_device_features(const struct panvk_physical_device *device,
/* VK_KHR_robustness2 */
.robustBufferAccess2 = PAN_ARCH >= 11,
.robustImageAccess2 = false,
- .nullDescriptor = PAN_ARCH >= 10,
+ .nullDescriptor = true,
/* VK_KHR_shader_clock */
.shaderSubgroupClock = device->kmod.dev->props.gpu_can_query_timestamp,