Re: [PATCH 00/11] media: amlogic: vdec: S4 decoding beyond H.264 Baseline
From: Zhentao Guo
Date: Mon Oct 26 2026 - 01:53:54 EST
Hi Christian,
Very glad to see your contributions, I went through your patches this morning, the way you added support for other codecs is almost exactly what I had imagined. It seems that some of the code you added isn’t actually necessary for a stateless decoder (like the H264_CONFIG_REQUEST process in the h264 driver). You probably added it because you weren’t sure how the firmware behaves and assumed it was required. I have some feedback for you, hopefully I can get these ready this week.
To sync with you:
1.The H264 Main & high profiles are supported, please see: https://lore.kernel.org/linux-media/20260924-b4-s4-vdec-upstream-v10-0-1289303a58a4@xxxxxxxxxxx/
2. MAINTAINERS path was fixed in patch v8, please see: https://lore.kernel.org/linux-media/20260831-b4-s4-vdec-upstream-v8-4-830195b9bd91@xxxxxxxxxxx/
Regards,
Zhentao
From: Christian Stefan Kövér-Draxl <ckoever@xxxxxxxxxx>
This builds on Zhentao Guo's "[PATCH v6 0/4] Add Amlogic V4L2 stateless
decoder" and makes the S4 decoder usable for real streams:
1-2: MAINTAINERS path fix, binding update for the second (HEVC) core;
3: microcode loading that the secure world accepts, HEVC core setup;
4: H.264 Main and High profile, bit-exact;
5-6: MPEG-1/2 and MJPEG on the VDEC core;
7-9: AV1, VP9 (profile 0 and 2) and HEVC (Main, Main 10) on the HEVC
core, up to 4K;
10: MPEG-4 Part 2 SP/ASP;
11: regmap naming.
Bit-exactness was checked against ffmpeg/libavcodec frame by frame for
H.264, VP9, AV1 and HEVC conformance and real-world streams; MPEG-2
differs by the hardware's IDCT rounding. Tested with GStreamer
v4l2sl*dec and a VA-API backend (Firefox) on an S905W2.
Depends on Zhentao's v6 series (not resent).
Tool use (Documentation/process/generated-content.rst):
This work was done with the help of an AI coding assistant, Claude
(Anthropic), used through Claude Code over many sessions. It did a large
part of the hands-on work: it read the vendor kernel and the firmware
interfaces, probed registers on the board, drafted the code and the
changelogs, and ran the builds, checkpatch, dt_binding_check and the
tests on the hardware. I directed the work, reviewed every change and
the final patches, and take responsibility for them. There is no single
prompt to quote; the sessions were of the form "find out why X fails on
this board, fix it, test it on the box".
Tested on an Amediatech X98Q TV box (Amlogic S905W2, S4 family, 2 GiB),
vendor U-Boot and BL31/OP-TEE, Linux 7.3 plus this work.
Christian Stefan Kövér-Draxl (11):
MAINTAINERS: fix the Amlogic VDEC binding path
dt-bindings: media: amlogic,s4-vdec: describe both decoder cores
media: amlogic: vdec: fix the microcode loading and prepare the HEVC
core
media: amlogic: vdec: h264: decode Main and High profile bit-exact
media: amlogic: vdec: add MPEG-1/2 decoding
media: amlogic: vdec: add MJPEG decoding
media: amlogic: vdec: add AV1 decoding on the HEVC core
media: amlogic: vdec: add VP9 decoding on the HEVC core
media: amlogic: vdec: add HEVC decoding on the HEVC core
media: amlogic: vdec: add MPEG-4 Part 2 decoding
media: amlogic: vdec: give the regmaps their own names
.../bindings/media/amlogic,s4-vdec.yaml | 24 +-
MAINTAINERS | 2 +-
drivers/media/platform/amlogic/vdec/Kconfig | 1 +
drivers/media/platform/amlogic/vdec/Makefile | 2 +-
.../media/platform/amlogic/vdec/aml_vdec.c | 157 +-
.../platform/amlogic/vdec/aml_vdec_drv.h | 21 +
.../media/platform/amlogic/vdec/aml_vdec_hw.c | 178 +-
.../media/platform/amlogic/vdec/aml_vdec_hw.h | 64 +
.../platform/amlogic/vdec/aml_vdec_platform.c | 129 +-
.../platform/amlogic/vdec/aml_vdec_tee_fw.c | 102 +-
drivers/media/platform/amlogic/vdec/av1.c | 3140 +++++++++++++++++
drivers/media/platform/amlogic/vdec/av1.h | 308 ++
drivers/media/platform/amlogic/vdec/h264.c | 477 ++-
drivers/media/platform/amlogic/vdec/h264.h | 7 +
.../platform/amlogic/vdec/h264_headers.c | 249 ++
drivers/media/platform/amlogic/vdec/hevc.c | 1728 +++++++++
drivers/media/platform/amlogic/vdec/hevc.h | 125 +
drivers/media/platform/amlogic/vdec/mjpeg.c | 471 +++
drivers/media/platform/amlogic/vdec/mjpeg.h | 33 +
drivers/media/platform/amlogic/vdec/mpeg12.c | 708 ++++
drivers/media/platform/amlogic/vdec/mpeg12.h | 51 +
drivers/media/platform/amlogic/vdec/mpeg4.c | 480 +++
drivers/media/platform/amlogic/vdec/mpeg4.h | 52 +
.../media/platform/amlogic/vdec/reg_defines.h | 24 +
drivers/media/platform/amlogic/vdec/vp9.c | 2004 +++++++++++
drivers/media/platform/amlogic/vdec/vp9.h | 149 +
.../media/platform/amlogic/vdec/vp9_prob.c | 213 ++
.../media/platform/amlogic/vdec/vp9_prob.h | 32 +
28 files changed, 10847 insertions(+), 84 deletions(-)
create mode 100644 drivers/media/platform/amlogic/vdec/av1.c
create mode 100644 drivers/media/platform/amlogic/vdec/av1.h
create mode 100644 drivers/media/platform/amlogic/vdec/h264_headers.c
create mode 100644 drivers/media/platform/amlogic/vdec/hevc.c
create mode 100644 drivers/media/platform/amlogic/vdec/hevc.h
create mode 100644 drivers/media/platform/amlogic/vdec/mjpeg.c
create mode 100644 drivers/media/platform/amlogic/vdec/mjpeg.h
create mode 100644 drivers/media/platform/amlogic/vdec/mpeg12.c
create mode 100644 drivers/media/platform/amlogic/vdec/mpeg12.h
create mode 100644 drivers/media/platform/amlogic/vdec/mpeg4.c
create mode 100644 drivers/media/platform/amlogic/vdec/mpeg4.h
create mode 100644 drivers/media/platform/amlogic/vdec/vp9.c
create mode 100644 drivers/media/platform/amlogic/vdec/vp9.h
create mode 100644 drivers/media/platform/amlogic/vdec/vp9_prob.c
create mode 100644 drivers/media/platform/amlogic/vdec/vp9_prob.h
base-commit: 7be4bc52fd9e0e55dc9a2e0232b89427d2c4b614
prerequisite-patch-id: 106aac9a55fa72f68fe458d405a69a66678c7040
prerequisite-patch-id: ed3f15728a5c616aca82b5086dc924adba315993
prerequisite-patch-id: 6845fd22135330ee201405f38d5c2a72bbe9d452
prerequisite-patch-id: 626eaa3d309664901ba13acc331d327a4ddc64c1
--
2.56.0