From 28b14b2ad02e012bd68b3f0b0b4c7f8091fb2da1 Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Fri, 26 Jun 2026 03:59:39 -0400 Subject: [PATCH] hw: surface import_raw failures (diagnose washed-out 10-bit HDR) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A failed DMA-BUF import returned None silently → core falls back to software, whose RGBA path does no BT.2020→709 gamut conversion, so HDR clips render washed out. The detection log fires before import_raw, so it didn't reveal this. Log the actual import error (with ten_bit) instead of swallowing it, to confirm whether 10-bit P010 import is failing. Co-Authored-By: Claude Opus 4.8 --- lightningbeam-ui/lightningbeam-editor/src/hw_video.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lightningbeam-ui/lightningbeam-editor/src/hw_video.rs b/lightningbeam-ui/lightningbeam-editor/src/hw_video.rs index 2f349f9..906599e 100644 --- a/lightningbeam-ui/lightningbeam-editor/src/hw_video.rs +++ b/lightningbeam-ui/lightningbeam-editor/src/hw_video.rs @@ -133,7 +133,15 @@ impl HwVideoImporter for SharedHwImporter { let imported = dmabuf::import_raw(&self.device, &self.adapter, &buf); ff::av_frame_free(&mut (drm_f as *mut _)); // the fd was dup'd into Vulkan - let (y, uv) = imported.ok()?.into_planes(); + let (y, uv) = match imported { + Ok(t) => t.into_planes(), + Err(e) => { + // Surface the failure: a silent None here makes core fall back to software (no gamut + // conversion → BT.2020 looks washed out). 10-bit P010 import is the likely culprit. + eprintln!("[hw_video] import_raw failed (ten_bit={ten_bit}): {e}"); + return None; + } + }; Some(GpuVideoFrame { y: Arc::new(y), uv: Arc::new(uv),