rkvdec HEVC: missing HEVC_SLICE_PARAMS registration in vdpu38x_hevc_ctrl_descs #15
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
Follow-up to #14. The Casanova/Collabora v7.0 HEVC series introduced
vdpu38x_hevc_ctrl_descs[]for RK3588 (vdpu381) and RK3576 (vdpu383) but forgot to registerV4L2_CID_STATELESS_HEVC_SLICE_PARAMS. Every per-frameVIDIOC_S_EXT_CTRLSthen fails with-EINVALbecausefind_ref_lockreturns NULL for0xa40a92.Repro
LIBVA_DRIVER_NAME=v4l2_request ffmpeg -hwaccel vaapi ... -frames:v 3 .../tmp/o.nv12all zeros, dmesg:The
cannot finddprintk is gated behindV4L2_DEV_DEBUG_CTRL = 0x20. Default dev_debug=0 hides this. Enable per-device:Root cause
drivers/media/platform/rockchip/rkvdec/rkvdec.chas two HEVC tables. The legacyrkvdec_hevc_ctrl_descs[](RK3399, line 189) registers SLICE_PARAMS:The new
vdpu38x_hevc_ctrl_descs[]doesn't. Both feedrkvdec_hevc_run_preamble(rkvdec-hevc-common.c:485-488) which doesv4l2_ctrl_find(..., V4L2_CID_STATELESS_HEVC_SLICE_PARAMS)and storesctrl->p_cur.p+ctrl->new_elems. With the new table,findreturns NULL, but userspace already failedS_EXT_CTRLSbefore that, so no controls commit at all → decoder runs on zero-init state.Fix (verified working)
5 lines. Mirror of the legacy entry.
dims = {600}= absolute max slices/frame for HEVC level > 6 (matches visl + legacy rkvdec).Verification on ampere
cannot find control id, zeroS_EXT_CTRLS: error, zeroInternal error/tmp/o.nv12= 4147200 bytes (exact 3×NV12 frame size)Scope
vdpu38x_hevc_ctrl_descs[].rkvdec_hevc_ctrl_descs[]already has the entry).Campaign cross-ref
Found in
ampere-kernel-decodersiter4 (commit 46c956b). Full forensic trace initer4_close.md. Same kernel module from #14 fix carried, plus this patch.Blocks iter5 (decoder-produces-empty-output investigation).
Empirical verification: HEVC_SLICE_PARAMS registration eliminates EINVAL
Applied the 5-line patch to ampere's running kernel tree (
linux-rockchipv7.0-rc3 + mmind v7.0 + Casanova HEVC v7.0 + #14 fix) and re-ran the exact repro on a fresh reboot. Patch carried on top of the #14 fix (ext_sps NULL init in run_preamble).Patch as applied
Confirmed in source at
drivers/media/platform/rockchip/rkvdec/rkvdec.c:239-248. Built viamake M=drivers/media/platform/rockchip/rkvdec modules, installed to/lib/modules/7.0.0-rc3-devices+/kernel/..., depmod, fresh reboot (uptime 19 min at test, module .ko timestamp 13:16, boot at 13:17).Test
Result
cannot find control id,S_EXT_CTRLS: error,Internal error(full grep returned empty)25ae521379343783da65b1fc80b1e8e8— bit-identical to the iter4-close substrate run, confirming reproducibility across rebootBeginPicture/RenderPicture/EndPicturecycles; no kernel-side rejection of the 5-ctrl batchUnique-byte breakdown
Only Y=16 (luma black) and Cb/Cr=128 (chroma neutral). Structurally valid 3-frame NV12, content all black. This is the downstream bug already noted in the issue body (slated for #16 / iter5) and explicitly out of scope for this issue — the success criterion here is EINVAL gone + decoder runs + dmesg clean, all of which hold.
Diagnostic noise (harmless)
The iter4 Phase 6
pr_warn("iter4-DIAG validate_sps: ...")inrkvdec_hevc_validate_spsnow fires per-frame (≈ 32 lines per 3-frame test) rather than the twice-per-session observed pre-patch. Expected consequence of the patch: withS_EXT_CTRLSnow succeeding, the SPS ctrl is genuinely committed each frame, so the validate callback runs each time. The diagnostic is module-private and will be stripped before any upstream submission — leaving in place for iter5 instrumentation.Scope confirmed
Fix targets the
vdpu38x_hevc_ctrl_descs[]table consumed by both RK3588 (vdpu381) and RK3576 (vdpu383). Legacyrkvdec_hevc_ctrl_descs[](RK3399) already had the entry and is unaffected. Report-only — not promoting or closing here.EWONTFIX 2026-05-18.
HEVC on ampere (RK3588) is scoped out indefinitely. Joint decision covering this issue plus kernel-agent#14 (kernel stack-uninit OOPS), kernel-agent#15 (HEVC_SLICE_PARAMS registration), and libva-v4l2-request-fourier#3 (libva backend EXT_SPS_*_RPS submission).
Rationale
daedalus-fourierREADME's "YouTube ∩ Pi5-HW = ∅" framing) — HEVC on ampere doesn't move that needle.Reopen criteria
Reopen any of the three if a concrete HEVC workflow emerges on ampere (4K local file collection, HEVC-encoded archive that doesn't fit on fresnel, specific app that requires HEVC and runs only on ampere). The kernel side fix in #14 + #15 is closed-form (one-liner each); the libva side in #3 is straightforward bitstream-translation work. None of the analysis is lost; it's all archived in the closed issues' bodies + comments.
Closing.