From d5a0f5012ba24d8fa97628487910dee5c31680ff Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Mon, 20 Jul 2026 19:43:19 +0200 Subject: [PATCH] =?UTF-8?q?fix(encode):=20RGB-direct=20probe=20=E2=80=94?= =?UTF-8?q?=20accept=20cosited-even=20chroma=20siting=20(what=20VCN=20EFC?= =?UTF-8?q?=20actually=20offers)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On-glass B0 result from the 780M (RADV PHOENIX, host Mesa 26.0.4): the probe returned no-709-narrow-midpoint because RADV advertises xChromaOffsets = COSITED_EVEN only — the VCN EFC does canonical H.26x left-cosited x-chroma, while the requirement was written to bit-match our 2x2-average (midpoint) shader. The delta is a half-pel chroma-x phase, imperceptible and unsignalled in our bitstream; EFC's siting is arguably the more correct one. Accept either siting bit per axis (model + range stay exact: 709 narrow); B1 will pass the preferred available bit. With this the 780M probes rgb_direct=available; both GPU smoke tests (H265 + AV1) pass on that box against host Mesa 26.0.4 — the first real-RADV validation of the poll fix, the quality-level control, and B0. (Container mesa alone can't run the H265 smoke: Fedora ships RADV with H264/H265 encode compiled out — AV1 only. Use the host ICD via VK_ICD_FILENAMES on Atomic boxes.) Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/pf-encode/src/enc/linux/vulkan_video.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/pf-encode/src/enc/linux/vulkan_video.rs b/crates/pf-encode/src/enc/linux/vulkan_video.rs index 92175538..29115209 100644 --- a/crates/pf-encode/src/enc/linux/vulkan_video.rs +++ b/crates/pf-encode/src/enc/linux/vulkan_video.rs @@ -2572,12 +2572,19 @@ unsafe fn probe_rgb_direct( if r != vk::Result::SUCCESS { return "no-rgb-profile(caps)"; } + // Colour model + range must match the shader exactly (709 narrow). Chroma siting is looser + // BY ON-GLASS FINDING (RADV 26.0.4 / 780M): the VCN EFC advertises x=COSITED_EVEN only — + // the canonical H.26x left-cosited siting — while our 2x2-average shader is midpoint. The + // difference is a half-pel chroma-x phase, imperceptible (and EFC's is arguably the more + // correct one since nothing in our bitstream signals siting). Accept either bit per axis; + // B1 passes the preferred available bit (midpoint if offered, else cosited-even). + let any_siting = vrgb::CHROMA_OFFSET_MIDPOINT | vrgb::CHROMA_OFFSET_COSITED_EVEN; if rgb_caps.rgb_models & vrgb::MODEL_YCBCR_709 == 0 || rgb_caps.rgb_ranges & vrgb::RANGE_NARROW == 0 - || rgb_caps.x_chroma_offsets & vrgb::CHROMA_OFFSET_MIDPOINT == 0 - || rgb_caps.y_chroma_offsets & vrgb::CHROMA_OFFSET_MIDPOINT == 0 + || rgb_caps.x_chroma_offsets & any_siting == 0 + || rgb_caps.y_chroma_offsets & any_siting == 0 { - return "no-709-narrow-midpoint"; + return "no-709-narrow"; } // 4. The encode-src format set under this profile must offer BGRA with DRM-modifier tiling — // the capture hands LINEAR BGRx dmabufs (fourcc XR24), which import as B8G8R8A8_UNORM.