* [PATCH 0/4] media: rockchip: rkvdec: add support for the VDPU346 variant @ 2025-12-06 10:01 Christian Hewitt 2025-12-06 10:01 ` [PATCH 3/4] media: rkvdec: Add " Christian Hewitt 0 siblings, 1 reply; 3+ messages in thread From: Christian Hewitt @ 2025-12-06 10:01 UTC (permalink / raw) To: Detlev Casanova, Olivier Crête, Ezequiel Garcia, Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner, Diederik de Haas, Dmitry Osipenko, Thomas Gleixner, Dragan Simic, Chukun Pan, linux-media, linux-rockchip, devicetree, linux-arm-kernel, linux-kernel This series depends upon Detlev Casanova's current v5 series for VDPU381 and VDPU383 support [0]. Patch 1 is marked DO-NOT-MERGE as it contains fixups for minor nits spotted in Detlev's series. I've flagged them on IRC after v2 but the messages may have been missed as they are still present in v5. Patches 2/3/4 add support for the VDPU346 IP block used for H264, HEVC and (in future work) VP9 on the RK356X boards. VDPU346 appears to be a close relation to VDPU381 used with RK3588, except with a single core, output limited to 4K, and minor feature differences, e.g. HEVC level 5.1 on VDPU346 vs 6.1 on VDPU381. To handle differences we declare a new compatible. The device-tree changes are derived from prior-art in Detlev's patches for RK3576 and RK3588, the vendor kernel [1], and some earlier patch attempts from Piotr Oniszczuk and Diederik de Haas. The register differences between VDPU346 and VDPU381 appear to be minimal so we currently and intentionally reuse the VDPU381 h264, hevc, and regs files to avoid duplicating code. If further register analysis requires separate files for VDPU346 the refactoring to Detlev's drivers is a little beyond my current beginner level c skills. As the overall minor changeset to VDPU381 it would be awesome if this series could be absorbed. I had some discussion with Olivier Crête during VideoLan Dev Days last month that suggested this might be possible? - hence sending now. If not, I'll wait until Detlev's series has been merged before sending a next iteration of these patches. Testing with Jellyfish files of varying bitrates shows that RK356X starts to experience jerky playback above 10mbps, which seems rather low compared to RK3588 which can play 300mbps media without issues. The vendor kernel documents 'advanced' assigned-clock-rates but increasing them does not have any obvious impact so the difference looks to be something deeper. NB: The same is also seen with Detlev's patches for RK3576 (max 15mpbs) so further or follow-up work is likely required. Despite the apparent limitation real- world media from my collection plays well. [0] https://patchwork.kernel.org/project/linux-rockchip/list/?series=1015221 [1] https://github.com/rockchip-linux/kernel/blob/develop-6.6/arch/arm64/boot/dts/rockchip/rk356x.dtsi#L1539 Christian Hewitt (4): media: rkvdec: minor fixes for current DETLEV patches media: dt-bindings: rockchip: Add RK3568 Video Decoder bindings media: rkvdec: Add support for the VDPU346 variant arm64: dts: rockchip: Add the vdpu346 Video Decoders on RK356X .../bindings/media/rockchip,vdec.yaml | 2 + arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 49 ++++++++ .../rockchip/rkvdec/rkvdec-vdpu381-regs.h | 4 +- .../rockchip/rkvdec/rkvdec-vdpu383-hevc.c | 6 +- .../media/platform/rockchip/rkvdec/rkvdec.c | 110 ++++++++++++++++++ 5 files changed, 166 insertions(+), 5 deletions(-) -- 2.34.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 3/4] media: rkvdec: Add support for the VDPU346 variant 2025-12-06 10:01 [PATCH 0/4] media: rockchip: rkvdec: add support for the VDPU346 variant Christian Hewitt @ 2025-12-06 10:01 ` Christian Hewitt 0 siblings, 0 replies; 3+ messages in thread From: Christian Hewitt @ 2025-12-06 10:01 UTC (permalink / raw) To: Detlev Casanova, Olivier Crête, Ezequiel Garcia, Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner, Diederik de Haas, Dmitry Osipenko, Thomas Gleixner, Dragan Simic, Chukun Pan, linux-media, linux-rockchip, devicetree, linux-arm-kernel, linux-kernel VDPU346 is derived from VDPU381 but with a single core and limited to 4K60 media. It is also limited to H264 L5.1 and omits AV1 and AVS2 capabilities. It is used with RK3566 and RK3568. Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> --- .../media/platform/rockchip/rkvdec/rkvdec.c | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c b/drivers/media/platform/rockchip/rkvdec/rkvdec.c index a1c02ef3a97c..cf68454b2217 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c @@ -295,6 +295,62 @@ static const struct rkvdec_ctrls rkvdec_h264_ctrls = { .num_ctrls = ARRAY_SIZE(rkvdec_h264_ctrl_descs), }; +static const struct rkvdec_ctrl_desc vdpu346_hevc_ctrl_descs[] = { + { + .cfg.id = V4L2_CID_STATELESS_HEVC_DECODE_PARAMS, + }, + { + .cfg.id = V4L2_CID_STATELESS_HEVC_SPS, + .cfg.ops = &rkvdec_ctrl_ops, + }, + { + .cfg.id = V4L2_CID_STATELESS_HEVC_PPS, + }, + { + .cfg.id = V4L2_CID_STATELESS_HEVC_SCALING_MATRIX, + }, + { + .cfg.id = V4L2_CID_STATELESS_HEVC_DECODE_MODE, + .cfg.min = V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED, + .cfg.max = V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED, + .cfg.def = V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED, + }, + { + .cfg.id = V4L2_CID_STATELESS_HEVC_START_CODE, + .cfg.min = V4L2_STATELESS_HEVC_START_CODE_ANNEX_B, + .cfg.def = V4L2_STATELESS_HEVC_START_CODE_ANNEX_B, + .cfg.max = V4L2_STATELESS_HEVC_START_CODE_ANNEX_B, + }, + { + .cfg.id = V4L2_CID_MPEG_VIDEO_HEVC_PROFILE, + .cfg.min = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN, + .cfg.max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10, + .cfg.menu_skip_mask = + BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE), + .cfg.def = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN, + }, + { + .cfg.id = V4L2_CID_MPEG_VIDEO_HEVC_LEVEL, + .cfg.min = V4L2_MPEG_VIDEO_HEVC_LEVEL_1, + .cfg.max = V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1, + }, + { + .cfg.id = V4L2_CID_STATELESS_HEVC_EXT_SPS_ST_RPS, + .cfg.ops = &rkvdec_ctrl_ops, + .cfg.dims = { 65 }, + }, + { + .cfg.id = V4L2_CID_STATELESS_HEVC_EXT_SPS_LT_RPS, + .cfg.ops = &rkvdec_ctrl_ops, + .cfg.dims = { 65 }, + }, +}; + +static const struct rkvdec_ctrls vdpu346_hevc_ctrls = { + .ctrls = vdpu346_hevc_ctrl_descs, + .num_ctrls = ARRAY_SIZE(vdpu346_hevc_ctrl_descs), +}; + static const struct rkvdec_ctrl_desc vdpu38x_hevc_ctrl_descs[] = { { .cfg.id = V4L2_CID_STATELESS_HEVC_DECODE_PARAMS, @@ -449,6 +505,43 @@ static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = { } }; +static const struct rkvdec_coded_fmt_desc vdpu346_coded_fmts[] = { + { + .fourcc = V4L2_PIX_FMT_H264_SLICE, + .frmsize = { + .min_width = 64, + .max_width = 65520, + .step_width = 64, + .min_height = 64, + .max_height = 65520, + .step_height = 16, + }, + .ctrls = &rkvdec_h264_ctrls, + .ops = &rkvdec_vdpu381_h264_fmt_ops, + .num_decoded_fmts = ARRAY_SIZE(rkvdec_h264_decoded_fmts), + .decoded_fmts = rkvdec_h264_decoded_fmts, + .subsystem_flags = VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF, + .capability = RKVDEC_CAPABILITY_H264, + }, + { + .fourcc = V4L2_PIX_FMT_HEVC_SLICE, + .frmsize = { + .min_width = 64, + .max_width = 65472, + .step_width = 64, + .min_height = 64, + .max_height = 65472, + .step_height = 16, + }, + .ctrls = &vdpu346_hevc_ctrls, + .ops = &rkvdec_vdpu381_hevc_fmt_ops, + .num_decoded_fmts = ARRAY_SIZE(rkvdec_hevc_decoded_fmts), + .decoded_fmts = rkvdec_hevc_decoded_fmts, + .subsystem_flags = VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF, + .capability = RKVDEC_CAPABILITY_HEVC, + }, +}; + static const struct rkvdec_coded_fmt_desc vdpu381_coded_fmts[] = { { .fourcc = V4L2_PIX_FMT_H264_SLICE, @@ -1654,6 +1747,19 @@ static const struct rkvdec_variant rk3399_rkvdec_variant = { RKVDEC_CAPABILITY_VP9, }; +static const struct rkvdec_variant rk3568_vdpu346_variant = { + .coded_fmts = vdpu346_coded_fmts, + .num_coded_fmts = ARRAY_SIZE(vdpu346_coded_fmts), + .rcb_sizes = vdpu381_rcb_sizes, + .num_rcb_sizes = ARRAY_SIZE(vdpu381_rcb_sizes), + .irq_handler = vdpu381_irq_handler, + .colmv_size = rkvdec_colmv_size, + .flatten_matrices = transpose_and_flatten_matrices, + .named_regs = true, + .capabilities = RKVDEC_CAPABILITY_H264 | + RKVDEC_CAPABILITY_HEVC, +}; + static const struct rkvdec_variant rk3588_vdpu381_variant = { .coded_fmts = vdpu381_coded_fmts, .num_coded_fmts = ARRAY_SIZE(vdpu381_coded_fmts), @@ -1693,6 +1799,10 @@ static const struct of_device_id of_rkvdec_match[] = { .compatible = "rockchip,rk3399-vdec", .data = &rk3399_rkvdec_variant, }, + { + .compatible = "rockchip,rk3568-vdec", + .data = &rk3568_vdpu346_variant, + }, { .compatible = "rockchip,rk3588-vdec", .data = &rk3588_vdpu381_variant, -- 2.34.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 0/4] media: rockchip: rkvdec: add support for the VDPU346 variant @ 2025-12-06 8:28 Christian Hewitt 0 siblings, 0 replies; 3+ messages in thread From: Christian Hewitt @ 2025-12-06 8:28 UTC (permalink / raw) To: Detlev Casanova, Olivier Crête, Ezequiel Garcia, Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner, Diederik de Haas, Dmitry Osipenko, Thomas Gleixner, Dragan Simic, Chukun Pan, linux-media, linux-rockchip, devicetree, linux-arm-kernel, linux-kernel This series depends upon Detlev Casanova's current v5 series for VDPU381 and VDPU383 support [0]. Patch 1 is marked DO-NOT-MERGE as it contains fixups for minor nits spotted in Detlev's series. I've flagged them on IRC after v2 but the messages may have been missed as they are still present in v5. Patches 2/3/4 add support for the VDPU346 IP block used for H264, HEVC and (in future work) VP9 on the RK356X boards. VDPU346 appears to be a close relation to VDPU381 used with RK3588, except with a single core, output limited to 4K, and minor feature differences, e.g. HEVC level 5.1 on VDPU346 vs 6.1 on VDPU381. To handle differences we declare a new compatible. The device-tree changes are derived from prior-art in Detlev's patches for RK3576 and RK3588, the vendor kernel [1], and some earlier patch attempts from Piotr Oniszczuk and Diederik de Haas. The register differences between VDPU346 and VDPU381 appear to be minimal so we currently and intentionally reuse the VDPU381 h264, hevc, and regs files to avoid duplicating code. If further register analysis requires separate files for VDPU346 the refactoring to Detlev's drivers is a little beyond my current beginner level c skills. As the overall minor changeset to VDPU381 it would be awesome if this series could be absorbed. I had some discussion with Olivier Crête during VideoLan Dev Days last month that suggested this might be possible? - hence sending now. If not, I'll wait until Detlev's series has been merged before sending a next iteration of these patches. Testing with Jellyfish files of varying bitrates shows that RK356X starts to experience jerky playback above 10mbps, which seems rather low compared to RK3588 which can play 300mbps media without issues. The vendor kernel documents 'advanced' assigned-clock-rates but increasing them does not have any obvious impact so the difference looks to be something deeper. NB: The same is also seen with Detlev's patches for RK3576 (max 15mpbs) so further or follow-up work is likely required. Despite the apparent limitation real- world media from my collection plays well. [0] https://patchwork.kernel.org/project/linux-rockchip/list/?series=1015221 [1] https://github.com/rockchip-linux/kernel/blob/develop-6.6/arch/arm64/boot/dts/rockchip/rk356x.dtsi#L1539 Christian Hewitt (4): media: rkvdec: minor fixes for current DETLEV patches media: dt-bindings: rockchip: Add RK3568 Video Decoder bindings media: rkvdec: Add support for the VDPU346 variant arm64: dts: rockchip: Add the vdpu346 Video Decoders on RK356X .../bindings/media/rockchip,vdec.yaml | 2 + arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 49 ++++++++ .../rockchip/rkvdec/rkvdec-vdpu381-regs.h | 4 +- .../rockchip/rkvdec/rkvdec-vdpu383-hevc.c | 6 +- .../media/platform/rockchip/rkvdec/rkvdec.c | 110 ++++++++++++++++++ 5 files changed, 166 insertions(+), 5 deletions(-) -- 2.34.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-06 11:49 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2025-12-06 10:01 [PATCH 0/4] media: rockchip: rkvdec: add support for the VDPU346 variant Christian Hewitt 2025-12-06 10:01 ` [PATCH 3/4] media: rkvdec: Add " Christian Hewitt -- strict thread matches above, loose matches on Subject: below -- 2025-12-06 8:28 [PATCH 0/4] media: rockchip: rkvdec: add " Christian Hewitt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®