* [PATCH 0/4] media: rockchip: rkvdec: add support for the VDPU346 variant
@ 2025-12-06 8:28 Christian Hewitt
2025-12-06 8:28 ` [PATCH DO-NOT-MERGE 1/4] media: rkvdec: minor fixes for current DETLEV patches Christian Hewitt
` (3 more replies)
0 siblings, 4 replies; 7+ 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] 7+ messages in thread* [PATCH DO-NOT-MERGE 1/4] media: rkvdec: minor fixes for current DETLEV patches 2025-12-06 8:28 [PATCH 0/4] media: rockchip: rkvdec: add support for the VDPU346 variant Christian Hewitt @ 2025-12-06 8:28 ` Christian Hewitt 2025-12-06 8:28 ` [PATCH 2/4] media: dt-bindings: rockchip: Add RK3568 Video Decoder bindings Christian Hewitt ` (2 subsequent siblings) 3 siblings, 0 replies; 7+ 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 RK3588 TRM Part 1 para 5.5.9 shows RKVDEC_SWREG12_SENCODARY_EN as the register name so the 'secondary' typo looks maybe intentional, but using correct spellings improves code readability. RK3588 TRM Part 1 para 5.4.3 shows RKVDEC_1080P_PIXELS should use 1920x1088 (to be 4px aligned) not 1920x1080. Also correct some H264 references in the H265 driver. Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> --- .../media/platform/rockchip/rkvdec/rkvdec-vdpu381-regs.h | 4 ++-- .../media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-regs.h b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-regs.h index 11b545e9ee7e..7cc6cbb8e549 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-regs.h +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-regs.h @@ -24,7 +24,7 @@ #define MAX_SLICE_NUMBER 0x3fff -#define RKVDEC_1080P_PIXELS (1920 * 1080) +#define RKVDEC_1080P_PIXELS (1920 * 1088) #define RKVDEC_4K_PIXELS (4096 * 2304) #define RKVDEC_8K_PIXELS (7680 * 4320) #define RKVDEC_TIMEOUT_1080p (0xefffff) @@ -90,7 +90,7 @@ struct rkvdec_vdpu381_regs_common { u32 reserved4 : 7; } reg011; - struct rkvdec_vdpu381_sencodary_en { + struct rkvdec_vdpu381_secondary_en { u32 wr_ddr_align_en : 1; u32 colmv_compress_en : 1; u32 fbc_e : 1; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c index dd7481a4353d..b4fc0d423c16 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c @@ -275,11 +275,11 @@ static void set_pps_ref_pic_poc(struct rkvdec_hevc_sps_pps *hw_ps, u32 poc, int static void assemble_hw_pps(struct rkvdec_ctx *ctx, struct rkvdec_hevc_run *run) { - struct rkvdec_hevc_ctx *h264_ctx = ctx->priv; + struct rkvdec_hevc_ctx *h265_ctx = ctx->priv; const struct v4l2_ctrl_hevc_sps *sps = run->sps; const struct v4l2_ctrl_hevc_pps *pps = run->pps; const struct v4l2_ctrl_hevc_decode_params *dec_params = run->decode_params; - struct rkvdec_hevc_priv_tbl *priv_tbl = h264_ctx->priv_tbl.cpu; + struct rkvdec_hevc_priv_tbl *priv_tbl = h265_ctx->priv_tbl.cpu; struct rkvdec_hevc_sps_pps *hw_ps; bool tiles_enabled; s32 max_cu_width; @@ -479,7 +479,7 @@ static void config_registers(struct rkvdec_ctx *ctx, memset(regs, 0, sizeof(*regs)); - /* Set H264 mode */ + /* Set HEVC mode */ regs->common.reg008_dec_mode = VDPU383_MODE_HEVC; /* Set input stream length */ -- 2.34.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/4] media: dt-bindings: rockchip: Add RK3568 Video Decoder bindings 2025-12-06 8:28 [PATCH 0/4] media: rockchip: rkvdec: add support for the VDPU346 variant Christian Hewitt 2025-12-06 8:28 ` [PATCH DO-NOT-MERGE 1/4] media: rkvdec: minor fixes for current DETLEV patches Christian Hewitt @ 2025-12-06 8:28 ` Christian Hewitt 2025-12-09 21:15 ` Rob Herring (Arm) 2025-12-06 8:28 ` [PATCH 3/4] media: rkvdec: Add support for the VDPU346 variant Christian Hewitt 2025-12-06 8:28 ` [PATCH 4/4] arm64: dts: rockchip: Add the vdpu346 Video Decoders on RK356X Christian Hewitt 3 siblings, 1 reply; 7+ 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 The video decoder in RK356X (vdpu346) is described in the same way as the one in RK3588 (vdpu381). A new compatible is added as the decoder capabilities are a subset of the vdpu381 capabilities. Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> --- nb: I've chosen to us rk3568-vdec not rk356x-vdec as other compatibles for these chips are using rk3568. Documentation/devicetree/bindings/media/rockchip,vdec.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml index 809fda45b3bd..656ceb1f116e 100644 --- a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml +++ b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml @@ -18,6 +18,7 @@ properties: oneOf: - const: rockchip,rk3288-vdec - const: rockchip,rk3399-vdec + - const: rockchip,rk3568-vdec - const: rockchip,rk3576-vdec - const: rockchip,rk3588-vdec - items: @@ -107,6 +108,7 @@ allOf: compatible: contains: enum: + - rockchip,rk3568-vdec - rockchip,rk3576-vdec - rockchip,rk3588-vdec then: -- 2.34.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/4] media: dt-bindings: rockchip: Add RK3568 Video Decoder bindings 2025-12-06 8:28 ` [PATCH 2/4] media: dt-bindings: rockchip: Add RK3568 Video Decoder bindings Christian Hewitt @ 2025-12-09 21:15 ` Rob Herring (Arm) 0 siblings, 0 replies; 7+ messages in thread From: Rob Herring (Arm) @ 2025-12-09 21:15 UTC (permalink / raw) To: Christian Hewitt Cc: Dmitry Osipenko, Krzysztof Kozlowski, Ezequiel Garcia, Conor Dooley, linux-rockchip, linux-arm-kernel, Dragan Simic, linux-media, Olivier Crête, devicetree, Diederik de Haas, Thomas Gleixner, Mauro Carvalho Chehab, Heiko Stuebner, linux-kernel, Chukun Pan, Detlev Casanova On Sat, 06 Dec 2025 08:28:07 +0000, Christian Hewitt wrote: > The video decoder in RK356X (vdpu346) is described in the same way as > the one in RK3588 (vdpu381). A new compatible is added as the decoder > capabilities are a subset of the vdpu381 capabilities. > > Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> > --- > nb: I've chosen to us rk3568-vdec not rk356x-vdec as other compatibles > for these chips are using rk3568. > > Documentation/devicetree/bindings/media/rockchip,vdec.yaml | 2 ++ > 1 file changed, 2 insertions(+) > Acked-by: Rob Herring (Arm) <robh@kernel.org> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/4] media: rkvdec: Add support for the VDPU346 variant 2025-12-06 8:28 [PATCH 0/4] media: rockchip: rkvdec: add support for the VDPU346 variant Christian Hewitt 2025-12-06 8:28 ` [PATCH DO-NOT-MERGE 1/4] media: rkvdec: minor fixes for current DETLEV patches Christian Hewitt 2025-12-06 8:28 ` [PATCH 2/4] media: dt-bindings: rockchip: Add RK3568 Video Decoder bindings Christian Hewitt @ 2025-12-06 8:28 ` Christian Hewitt 2025-12-24 19:10 ` Nicolas Dufresne 2025-12-06 8:28 ` [PATCH 4/4] arm64: dts: rockchip: Add the vdpu346 Video Decoders on RK356X Christian Hewitt 3 siblings, 1 reply; 7+ 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 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] 7+ messages in thread
* Re: [PATCH 3/4] media: rkvdec: Add support for the VDPU346 variant 2025-12-06 8:28 ` [PATCH 3/4] media: rkvdec: Add support for the VDPU346 variant Christian Hewitt @ 2025-12-24 19:10 ` Nicolas Dufresne 0 siblings, 0 replies; 7+ messages in thread From: Nicolas Dufresne @ 2025-12-24 19:10 UTC (permalink / raw) To: Christian Hewitt, 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 [-- Attachment #1: Type: text/plain, Size: 5702 bytes --] Le samedi 06 décembre 2025 à 08:28 +0000, Christian Hewitt a écrit : > 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> Reviewed-by: Nicolas Dufresne <nicolas.collabora@collabora.com> Please resend whenever there is a dependency update, I believe some of the variant stuff is being modified. Another note, I tried bigger resolution, but it only yielded green images, so the 65K max does not actually work and will need investigation. Nicolas > --- > .../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, [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/4] arm64: dts: rockchip: Add the vdpu346 Video Decoders on RK356X 2025-12-06 8:28 [PATCH 0/4] media: rockchip: rkvdec: add support for the VDPU346 variant Christian Hewitt ` (2 preceding siblings ...) 2025-12-06 8:28 ` [PATCH 3/4] media: rkvdec: Add support for the VDPU346 variant Christian Hewitt @ 2025-12-06 8:28 ` Christian Hewitt 3 siblings, 0 replies; 7+ 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 Cc: Diederik de Haas, Piotr Oniszczuk Add the vdpu346 Video Decoders to the rk356x-base devicetree to enable support on RK3566 and RK3568 boards. Also add the needed sram and vdec_mmu nodes. Suggested-by: Diederik de Haas <didi.debian@cknow.org> Suggested-by: Piotr Oniszczuk <piotr.oniszczuk@gmail.com> Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> --- arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi index c005135089d4..c51179e13657 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi @@ -383,6 +383,19 @@ usb2phy1_grf: syscon@fdca8000 { reg = <0x0 0xfdca8000 0x0 0x8000>; }; + sram@fdcc0000 { + compatible = "mmio-sram"; + reg = <0x0 0xfdcc0000 0x0 0xb000>; + ranges = <0x0 0x0 0xfdcc0000 0xb000>; + #address-cells = <1>; + #size-cells = <1>; + + vdec_sram: rkvdec-sram@0 { + reg = <0x0 0xb000>; + pool; + }; + }; + pmucru: clock-controller@fdd00000 { compatible = "rockchip,rk3568-pmucru"; reg = <0x0 0xfdd00000 0x0 0x1000>; @@ -619,6 +632,42 @@ vepu_mmu: iommu@fdee0800 { #iommu-cells = <0>; }; + vdec: video-codec@fdf80100 { + compatible = "rockchip,rk3568-vdec"; + reg = <0x0 0xfdf80200 0x0 0x500>, + <0x0 0xfdf80100 0x0 0x100>, + <0x0 0xfdf80700 0x0 0x100>; + reg-names = "function", "link", "cache"; + interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>, + <&cru CLK_RKVDEC_CA>, <&cru CLK_RKVDEC_CORE>, + <&cru CLK_RKVDEC_HEVC_CA>; + clock-names = "axi", "ahb", "cabac", "core", "hevc_cabac"; + assigned-clocks = <&cru ACLK_RKVDEC>, + <&cru CLK_RKVDEC_CORE>, + <&cru CLK_RKVDEC_CA>, + <&cru CLK_RKVDEC_HEVC_CA>; + assigned-clock-rates = <297000000>, <297000000>, + <297000000>, <600000000>; + iommus = <&vdec_mmu>; + power-domains = <&power RK3568_PD_RKVDEC>; + resets = <&cru SRST_A_RKVDEC>, <&cru SRST_H_RKVDEC>, + <&cru SRST_RKVDEC_CA>, <&cru SRST_RKVDEC_CORE>, + <&cru SRST_RKVDEC_HEVC_CA>; + reset-names = "axi", "ahb", "cabac", "core", "hevc_cabac"; + sram = <&vdec_sram>; + }; + + vdec_mmu: iommu@fdf80800 { + compatible = "rockchip,rk3568-iommu"; + reg = <0x0 0xfdf80800 0x0 0x40>, <0x0 0xfdf80840 0x0 0x40>; + interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>; + clock-names = "aclk", "iface"; + power-domains = <&power RK3568_PD_RKVDEC>; + #iommu-cells = <0>; + }; + sdmmc2: mmc@fe000000 { compatible = "rockchip,rk3568-dw-mshc", "rockchip,rk3288-dw-mshc"; reg = <0x0 0xfe000000 0x0 0x4000>; -- 2.34.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-12-24 19:10 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2025-12-06 8:28 [PATCH 0/4] media: rockchip: rkvdec: add support for the VDPU346 variant Christian Hewitt 2025-12-06 8:28 ` [PATCH DO-NOT-MERGE 1/4] media: rkvdec: minor fixes for current DETLEV patches Christian Hewitt 2025-12-06 8:28 ` [PATCH 2/4] media: dt-bindings: rockchip: Add RK3568 Video Decoder bindings Christian Hewitt 2025-12-09 21:15 ` Rob Herring (Arm) 2025-12-06 8:28 ` [PATCH 3/4] media: rkvdec: Add support for the VDPU346 variant Christian Hewitt 2025-12-24 19:10 ` Nicolas Dufresne 2025-12-06 8:28 ` [PATCH 4/4] arm64: dts: rockchip: Add the vdpu346 Video Decoders on RK356X 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®