dmabuf-wayland↔KWin presentation handoff produces solid green on ohm — independent of decoder backend #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
On ohm (PineTab2 / RK3568 / hantro G1 / Mali-G52 / KWin 6 Wayland) as of 2026-05-08,
mpv --vo=dmabuf-waylandproduces a solid green frame regardless of the decoder backend in use. The bug reproduces with both libva (--hwdec=vaapiagainstlibva-v4l2-request-fourier) and ffmpeg's native V4L2 request hwaccel (--hwdec=v4l2request, libva entirely bypassed).--vo=gpuwith the same hwdec produces the correct picture (slow due to GPU shader path on Mali-G52, but content is real bbb), so the decoder is not at fault.The iter5 close (2026-05-05) of the libva-multiplanar campaign claims "mpv
--hwdec=vaapismooth" on ohm. That claim does not hold today against fresh-install + fresh-Plasma-session interactive testing. Either iter5/6/7/8 changed something about the dmabuf modifier reporting, or KWin / Mesa-panfrost / mpv has had a regression since 2026-05-05 that broke the dmabuf-wayland handoff.Reproducer
Result #3 demonstrates that the hantro decoder + ffmpeg + mpv + the dmabuf path are functional. The green only appears when
--vo=dmabuf-waylandis selected.Suspected handshake
From mpv
-vstartup log (libva path; ffmpeg-v4l2request path produces an analogous list):→ KWin advertises only one dmabuf format/modifier combo:
NV12 LINEAR(modifier0x0). Any buffer with a non-LINEAR modifier or non-matching pitch alignment is the suspect handoff path.The libva-multiplanar campaign already has a relevant finding: iter2 Fix 2 (
conditional DRM_FORMAT_MOD_INVALID for non-64-aligned pitch). Hantro G1 produces NV12 with 1920-byte stride for 1920×1080 content, which IS 64-aligned, so iter2'sMOD_INVALIDpath shouldn't fire — the buffer should reportMOD_LINEAR. But that does need verifying.For ffmpeg's path, the modifier comes from the
AVDRMFrameDescriptorfilled byav_hwframe_map(..., AV_HWFRAME_TRANSFER_DIRECTION_FROM). ffmpeg-v4l2-request-fourier's V4L2 hwaccel may report a different modifier than libva does.Color hypothesis already ruled out
Earlier in the diagnostic flow,
wp_color_manager_v1HDR PQ misinterpretation was suspected (KWin advertises HDR-capable, mpv tagged SDR content as PQ → SDR-as-HDR rendering = green). Disabled with--target-colorspace-hint=noand the explicit--target-trc=bt.1886 --target-prim=bt.709 --target-peak=100triple. Neither cleared the green. So it is not a colorspace handshake issue.Triage suggestions
vaExportSurfaceHandleon libva path andAVDRMFrameDescriptoron ffmpeg path. Compare to KWin's advertised list (NV12(0x0)). If non-zero → that's the mismatch.linux-dmabuf-v1request rejections in the protocol log.NV12 LINEARwithout issue, but maybe the import path adds modifier constraints.Workaround
Use
--vo=gpuinstead of--vo=dmabuf-wayland. Slower (GPU shader path on Mali-G52), but correct picture. This is the production HW-decode workflow on ohm right now.Cross-reference
20b3dd4).Environment
Triage update — root cause isolated 2026-05-08
Layer-by-layer A/B testing on ohm ruled out every layer that doesn't matter, then
WAYLAND_DEBUG=1capture surfaced the actual bug at the protocol-message level.Ruled out (each via a directed A/B):
--hwdec=v4l2requestalso greens, libva entirely bypassed)vo=gpu --hwdec=v4l2requestshows correct picture)--target-colorspace-hint=no+ explicit BT.709 SDR triple did nothing)--vo=wlshmshows correct picture — bypasses dmabuf entirely)Root cause isolated: mpv's
vo_dmabuf_wayland.cconstructs the wl_dmabuf protocol message with internally inconsistent plane semantics. WAYLAND_DEBUG trace:Filed the root-cause issue separately at marfrit/dmabuf-modifier-triage#1 with full diagnosis + suggested fix path. This issue stays open as the user-visible-symptom tracker; closes when an mpv patch lands and the green clears on ohm.
Next deferred verifier: re-run the WAYLAND_DEBUG capture with
--hwdec=vaapi(libva path) once libva-v4l2-request-fourier#1 is fixed and the cap_pool/REQBUFS cascade stops blocking libva playback. If both libva and ffmpeg paths produce the same wrong .add() pattern → bug is in mpv VO. If only one does → that path's producer (libva or ffmpeg-v4l2-request) is the bug.Working ohm HW-decode workflow remains:
mpv --hwdec=v4l2request --vo=gpu fourier-test/...(correct picture, slow due to GPU shader path on Mali-G52).Update — earlier root-cause comment overturned by Phase 2 source-read (2026-05-08)
Comment #243 above pointed at marfrit/dmabuf-modifier-triage#1 with a claimed root cause in mpv's
vo_dmabuf_wayland.cplane-semantics translation. That diagnosis was wrong. Phase 2 source-read of mpv 0.41.0 + Kwiboo's ffmpeg fork atb57fbbeshows both pieces of code do the right thing; the WAYLAND_DEBUG "different fds per plane" trace anomaly is most likely libwayland'swl_closure_marshaldup_cloexec'ing the fd at protocol-marshal time and printing the post-dup value. Full analysis in marfrit/dmabuf-modifier-triage#1 comment 252.Real layer is back open. Four candidates filed in the linked comment; cheapest decisive probe is
lseek(EXPBUF_fd, SEEK_END)on ohm to check whether hantro's kernel-sidedma_bufis sized for the full allocation (3,655,712) or just the Y plane (2,088,960).This comment exists to break the trail to the wrong analysis. The user-visible green-frame symptom and the workaround (
mpv --hwdec=v4l2request --vo=gpu) are unchanged.Still reproducible on ohm, 2026-05-18. Recommending close as duplicate of marfrit/dmabuf-modifier-triage#1 — that issue carries the actual root-cause analysis, this issue is the user-facing symptom report. Both can't be fixed independently; the actual fix has to land in mpv's
vo_dmabuf_wayland.c.Re-verification
Stack today:
mpv-fourier 1:0.41.0-10, samelibva-v4l2-request-fourier 1:1.0.0.r361.cf8cd9d-1we just upgraded ohm to for the libva-v4l2-request-fourier#1 triage. WAYLAND_DEBUG capture:Byte-identical to the broken pattern called out in dmabuf-modifier-triage#1: per-plane fds combined with a single-allocation offset for plane 1. mpv upstream hasn't fixed
vo_dmabuf_wayland.cbetween 2026-05-08 and today.Closing rationale
Two issues for the same upstream bug is overhead. Keeping dmabuf-modifier-triage#1 as canonical (root-cause + suggested fix); closing this one.
Workaround for ohm users remains
--vo=gpu(slower but correct).Correction to my earlier close comment on this issue (a few hours ago, before the visual re-verification on ohm 2026-05-18 ~09:50 UTC).
I closed this as duplicate-of-dmabuf-modifier-triage#1 with a "still reproducible" claim based on the WAYLAND_DEBUG trace pattern matching. That claim was wrong — I'd matched the trace pattern but hadn't verified the visual output. The trace pattern (different fds + non-zero offset for plane 1) is actually NORMAL for this case: V4L2 hantro NV12 uses single-allocation (one fd per buffer); the wayland fds are SCM_RIGHTS dups, not per-plane fds; and FFmpeg + mpv handle it correctly.
The bug IS fixed — by the cache-sync workaround in
mpv-fourier 0.41.0-10(your own earlier patch0001-vo_dmabuf_wayland-explicit-cache-sync-on-import-fd.patch). Visual re-verification 2026-05-18: real BBB content displayed.Full root-cause attribution + corrected analysis in dmabuf-modifier-triage#1's closing comment (or whichever ID the close-comment gets).
Issue stays closed; just correcting the record.