[PATCH v2 00/12] media: rkvdec: Add support for VDPU381 and VDPU383
From: Detlev Casanova
Date: Fri Aug 08 2025 - 16:04:51 EST
These variants are found respectively in the RK3588 and RK3576 SoCs.
This patch only adds support for H264 and H265 in both variants.
As there is a considerable part of the code that can be shared with the
already supported rkvdec decoder driver, the support for these variants
is added here rather than writing a new driver.
This patch set uses the newly introduced hevc_ext_sps_[ls]t_rps v4l2
controls for HEVC [1].
Therefore, a patched version of userpace tools is needed for HEVC
support (added for GStreamer[2] and in an early stage for FFmpeg[3]).
This patch set also depends on the preparation patch set sent earlier [4]
as well as the iommu restore fix [5] (already merged in linux-media) and
Nicolas Frattaroli's bitmap patch [6] to support setting registers that
uses upper 16 bits as masks.
[1]: https://lore.kernel.org/all/20250807194327.69900-1-detlev.casanova@xxxxxxxxxxxxx/
[2]: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9355
[3]: https://gitlab.collabora.com/detlev/ffmpeg
[4]: https://lore.kernel.org/all/20250623160722.55938-1-detlev.casanova@xxxxxxxxxxxxx/
[5]: https://lore.kernel.org/all/20250508-rkvdec-iommu-reset-v1-1-c46b6efa6e9b@xxxxxxxxxxxxx/
[6]: https://lore.kernel.org/all/20250623-byeword-update-v2-1-cf1fc08a2e1f@xxxxxxxxxxxxx/
Changes since v1:
- Add parsing of the short and long term ref frame sets from the new v4l2
controls
- Add RPS cache to avoid parsing the same data again
- Fix HEVC pixel formats selection
- Fix multiple indentation errors
Detlev Casanova (12):
media: rkvdec: Switch to using structs instead of writel
media: rkvdec: Move cabac table to its own source file
media: rkvdec: Use structs to represent the HW RPS
media: rkvdec: Move h264 functions to common file
media: rkvdec: Add per variant configuration
media: rkvdec: Add RCB and SRAM support
media: rkvdec: Support per-variant interrupt handler
media: rkvdec: Enable all clocks without naming them
media: rkvdec: Add H264 support for the VDPU381 variant
media: rkvdec: Add H264 support for the VDPU383 variant
media: rkvdec: Add HEVC support for the VDPU381 variant
media: rkvdec: Add HEVC support for the VDPU383 variant
.../media/platform/rockchip/rkvdec/Kconfig | 1 +
.../media/platform/rockchip/rkvdec/Makefile | 13 +-
.../platform/rockchip/rkvdec/rkvdec-cabac.c | 3944 +++++++++++++++++
.../rockchip/rkvdec/rkvdec-h264-common.c | 253 ++
.../rockchip/rkvdec/rkvdec-h264-common.h | 81 +
.../platform/rockchip/rkvdec/rkvdec-h264.c | 891 +---
.../rockchip/rkvdec/rkvdec-hevc-common.c | 511 +++
.../rockchip/rkvdec/rkvdec-hevc-common.h | 101 +
.../platform/rockchip/rkvdec/rkvdec-rcb.c | 174 +
.../platform/rockchip/rkvdec/rkvdec-rcb.h | 29 +
.../platform/rockchip/rkvdec/rkvdec-regs.h | 567 ++-
.../rockchip/rkvdec/rkvdec-vdpu381-h264.c | 469 ++
.../rockchip/rkvdec/rkvdec-vdpu381-hevc.c | 596 +++
.../rockchip/rkvdec/rkvdec-vdpu381-regs.h | 427 ++
.../rockchip/rkvdec/rkvdec-vdpu383-h264.c | 582 +++
.../rockchip/rkvdec/rkvdec-vdpu383-hevc.c | 688 +++
.../rockchip/rkvdec/rkvdec-vdpu383-regs.h | 284 ++
.../platform/rockchip/rkvdec/rkvdec-vp9.c | 230 +-
.../media/platform/rockchip/rkvdec/rkvdec.c | 569 ++-
.../media/platform/rockchip/rkvdec/rkvdec.h | 39 +
20 files changed, 9260 insertions(+), 1189 deletions(-)
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-cabac.c
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-h264-common.c
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-h264-common.h
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-hevc-common.c
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-hevc-common.h
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-rcb.c
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-rcb.h
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-regs.h
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-regs.h
--
2.50.1