[PATCH 0/7] media: rkvdec: Enable multi-core support
Detlev Casanova
detlev.casanova at collabora.com
Thu Apr 9 06:50:35 PDT 2026
Since the driver is used for decoding on rk3588 and that the SoC has
2 identical decoding cores, enable support for it.
Instead of exposing 2 v4l2 devices to userspace, the driver will only
expose one and handle the 2 cores transparently.
The 2 cores are able to work in parallel, but only contexts are
parallelized: 1 stream, that uses 1 context, will only be able to use
1 core as it usually needs previous frames already decoded to use as
reference frames.
To avoid complex scheduling, only different streams can use cores at the
same time.
To achieve this, the v4l2_m2m_buf_done_and_job_finish() had to be split
in a done and a finish part (still keeping the unsplit function for other
drivers). That allows the driver to get new jobs to run while the previous
one is still running.
The job_ready() callback is used to avoid scheduling multiple jobs from
the same context.
The IOMMU support is in a different commit, as it needed a bit more
thought to work correctly, but I'm wondering if it should be merged with
the multicore support commit.
A fix for the RCB (Row and Cols Buffer) size computation is also provided
as it was causing issues with some fluster tests.
Performance-wise, fluster doesn't seem to run much faster, but I tested
with an HEVC test video from Jellyfin and observed that frames start
dropping with 6 concurrent gstreamer instances, instead of 4 without
multi-core enabled.
Signed-off-by: Detlev Casanova <detlev.casanova at collabora.com>
---
Detlev Casanova (7):
media: v4l2-mem2mem: Add v4l2_m2m_buf_done_manual()
media: v4l2-mem2mem: Remove WARN_ON() in v4l2_m2m_job_finish()
media: rkvdec: Keep RCB to the correct size
media: rkvdec: Remove unused need_reset
media: rkvdec: Add multicore support
media: rkvdec: Wait for all buffers before stop_streaming
media: rkvdec: Add multicore IOMMU support
.../media/platform/rockchip/rkvdec/rkvdec-h264.c | 17 +-
.../media/platform/rockchip/rkvdec/rkvdec-hevc.c | 16 +-
.../media/platform/rockchip/rkvdec/rkvdec-rcb.c | 77 ++--
.../media/platform/rockchip/rkvdec/rkvdec-rcb.h | 8 +-
.../platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c | 24 +-
.../platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c | 24 +-
.../platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c | 24 +-
.../platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c | 26 +-
.../media/platform/rockchip/rkvdec/rkvdec-vp9.c | 27 +-
drivers/media/platform/rockchip/rkvdec/rkvdec.c | 482 +++++++++++++--------
drivers/media/platform/rockchip/rkvdec/rkvdec.h | 31 +-
drivers/media/v4l2-core/v4l2-mem2mem.c | 34 +-
include/media/v4l2-mem2mem.h | 20 +
13 files changed, 500 insertions(+), 310 deletions(-)
---
base-commit: 3036cd0d3328220a1858b1ab390be8b562774e8a
change-id: 20260408-rkvdec-multicore-98831da51072
Best regards,
--
Detlev Casanova <detlev.casanova at collabora.com>
More information about the Linux-rockchip
mailing list