From: "Diederik de Haas" <didi.debian@cknow.org>
To: "Jonas Karlman" <jonas@kwiboo.se>,
"Detlev Casanova" <detlev.casanova@collabora.com>
Cc: "Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Heiko Stuebner" <heiko@sntech.de>, <linux-media@vger.kernel.org>,
<linux-rockchip@lists.infradead.org>,
<linux-arm-kernel@lists.infradead.org>, <kernel@collabora.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 09/12] media: rkvdec: Add H264 support for the VDPU381 variant
Date: Sat, 20 Sep 2025 20:06:36 +0200 [thread overview]
Message-ID: <DCXTSROW5FPM.1008CWKUXILAI@cknow.org> (raw)
In-Reply-To: <ea0914d9-bd12-4bdc-b465-3ae82571118a@kwiboo.se>
[-- Attachment #1: Type: text/plain, Size: 3919 bytes --]
Hi Jonas,
On Sat Sep 20, 2025 at 6:15 PM CEST, Jonas Karlman wrote:
> On 9/20/2025 5:00 PM, Diederik de Haas wrote:
>> Thanks a LOT for this patch set!
>> As already reported the results were quite impressive :-D
>>
>> To figure out how to make VDPU346 for rk3568 work, I had a close look at
>> the TRM and compared that to rk3588's TRM and compared it to your code.
>> I think I may have found a few potential issue, but I may also not
>> understand things correctly.
>>
>> On Fri Aug 8, 2025 at 10:03 PM CEST, Detlev Casanova wrote:
>>> This decoder variant is found in Rockchip RK3588 SoC family.
>>>
>>> Like for rkvdec on rk3399, it supports the NV12, NV15, NV16 and NV20
>>> output formats and level up to 5.1.
>>>
>>> The maximum width and height have been significantly increased
>>> supporting up to 65520 pixels for both.
>>>
>>> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
>>> ---
>>> .../media/platform/rockchip/rkvdec/Makefile | 1 +
>>> .../rockchip/rkvdec/rkvdec-h264-common.h | 2 +
>>> .../platform/rockchip/rkvdec/rkvdec-h264.c | 36 --
>>> .../rockchip/rkvdec/rkvdec-vdpu381-h264.c | 469 ++++++++++++++++++
>>> .../rockchip/rkvdec/rkvdec-vdpu381-regs.h | 427 ++++++++++++++++
>>> .../media/platform/rockchip/rkvdec/rkvdec.c | 164 +++++-
>>> .../media/platform/rockchip/rkvdec/rkvdec.h | 6 +
>>> 7 files changed, 1067 insertions(+), 38 deletions(-)
>>> create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c
>>> create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-regs.h
>>>
>>> ...
>>>
>>> diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
>>> index 0ccf1ba81958a..1b55fe4ff2baf 100644
>>> --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c
>>> +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
>>>
>>> ...
>>>
>>> @@ -287,6 +327,25 @@ static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = {
>>> }
>>> };
>>>
>>> +static const struct rkvdec_coded_fmt_desc vdpu381_coded_fmts[] = {
>>> + {
>>> + .fourcc = V4L2_PIX_FMT_H264_SLICE,
>>> + .frmsize = {
>>> + .min_width = 64,
>>> + .max_width = 65520,
>>> + .step_width = 64,
>>> + .min_height = 16,
>>> + .max_height = 65520,
>>> + .step_height = 16,
>>> + },
>>
>> Also in the RK3588 TRM Part 1 paragraph 5.4.3, I see "Supported image size" :
>> 16x16 to 65520x65520; step size 16 pixels
>>
>> I interpret that that .min_width and .step_width should both be 16.
>> (.min_height and .step_height are correct at 16; if I read the TRM right)
>
> The frmsize used internally for rkvdec is only meant to restrict/align
> the frame buffer use while decoding, It does not reflect sizes the HW
> can decode.
>
> frmsize should typically be min 64x64 with step_height 16 and step_width
> 64 to ensure stride is 16 byte aligned for both 8-bit and 10-bit video.
>
> Only max_width and max_height is used from here to signal userspace what
> max res is supported, together with min/max res and step of 1.
Interesting, thanks for the explanation :-)
So if I understand correctly, only .min_height should be changed to '64'
here? And it should also be 64+64+64+16 for HEVC (patch 11)?
(and also for VP9 and AVS2?)
> Regards,
> Jonas
Cheers,
Diederik
>>
>>> + .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,
>>> + },
>>> +};
>>> +
>>> static const struct rkvdec_coded_fmt_desc *
>>> rkvdec_find_coded_fmt_desc(struct rkvdec_ctx *ctx, u32 fourcc)
>>> {
>>> @@ -1125,6 +1184,35 @@ static irqreturn_t rk3399_irq_handler(struct rkvdec_ctx *ctx)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: "Diederik de Haas" <didi.debian@cknow.org>
To: "Jonas Karlman" <jonas@kwiboo.se>,
"Detlev Casanova" <detlev.casanova@collabora.com>
Cc: "Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Heiko Stuebner" <heiko@sntech.de>, <linux-media@vger.kernel.org>,
<linux-rockchip@lists.infradead.org>,
<linux-arm-kernel@lists.infradead.org>, <kernel@collabora.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 09/12] media: rkvdec: Add H264 support for the VDPU381 variant
Date: Sat, 20 Sep 2025 20:06:36 +0200 [thread overview]
Message-ID: <DCXTSROW5FPM.1008CWKUXILAI@cknow.org> (raw)
In-Reply-To: <ea0914d9-bd12-4bdc-b465-3ae82571118a@kwiboo.se>
[-- Attachment #1.1: Type: text/plain, Size: 3919 bytes --]
Hi Jonas,
On Sat Sep 20, 2025 at 6:15 PM CEST, Jonas Karlman wrote:
> On 9/20/2025 5:00 PM, Diederik de Haas wrote:
>> Thanks a LOT for this patch set!
>> As already reported the results were quite impressive :-D
>>
>> To figure out how to make VDPU346 for rk3568 work, I had a close look at
>> the TRM and compared that to rk3588's TRM and compared it to your code.
>> I think I may have found a few potential issue, but I may also not
>> understand things correctly.
>>
>> On Fri Aug 8, 2025 at 10:03 PM CEST, Detlev Casanova wrote:
>>> This decoder variant is found in Rockchip RK3588 SoC family.
>>>
>>> Like for rkvdec on rk3399, it supports the NV12, NV15, NV16 and NV20
>>> output formats and level up to 5.1.
>>>
>>> The maximum width and height have been significantly increased
>>> supporting up to 65520 pixels for both.
>>>
>>> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
>>> ---
>>> .../media/platform/rockchip/rkvdec/Makefile | 1 +
>>> .../rockchip/rkvdec/rkvdec-h264-common.h | 2 +
>>> .../platform/rockchip/rkvdec/rkvdec-h264.c | 36 --
>>> .../rockchip/rkvdec/rkvdec-vdpu381-h264.c | 469 ++++++++++++++++++
>>> .../rockchip/rkvdec/rkvdec-vdpu381-regs.h | 427 ++++++++++++++++
>>> .../media/platform/rockchip/rkvdec/rkvdec.c | 164 +++++-
>>> .../media/platform/rockchip/rkvdec/rkvdec.h | 6 +
>>> 7 files changed, 1067 insertions(+), 38 deletions(-)
>>> create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c
>>> create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-regs.h
>>>
>>> ...
>>>
>>> diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
>>> index 0ccf1ba81958a..1b55fe4ff2baf 100644
>>> --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c
>>> +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
>>>
>>> ...
>>>
>>> @@ -287,6 +327,25 @@ static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = {
>>> }
>>> };
>>>
>>> +static const struct rkvdec_coded_fmt_desc vdpu381_coded_fmts[] = {
>>> + {
>>> + .fourcc = V4L2_PIX_FMT_H264_SLICE,
>>> + .frmsize = {
>>> + .min_width = 64,
>>> + .max_width = 65520,
>>> + .step_width = 64,
>>> + .min_height = 16,
>>> + .max_height = 65520,
>>> + .step_height = 16,
>>> + },
>>
>> Also in the RK3588 TRM Part 1 paragraph 5.4.3, I see "Supported image size" :
>> 16x16 to 65520x65520; step size 16 pixels
>>
>> I interpret that that .min_width and .step_width should both be 16.
>> (.min_height and .step_height are correct at 16; if I read the TRM right)
>
> The frmsize used internally for rkvdec is only meant to restrict/align
> the frame buffer use while decoding, It does not reflect sizes the HW
> can decode.
>
> frmsize should typically be min 64x64 with step_height 16 and step_width
> 64 to ensure stride is 16 byte aligned for both 8-bit and 10-bit video.
>
> Only max_width and max_height is used from here to signal userspace what
> max res is supported, together with min/max res and step of 1.
Interesting, thanks for the explanation :-)
So if I understand correctly, only .min_height should be changed to '64'
here? And it should also be 64+64+64+16 for HEVC (patch 11)?
(and also for VP9 and AVS2?)
> Regards,
> Jonas
Cheers,
Diederik
>>
>>> + .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,
>>> + },
>>> +};
>>> +
>>> static const struct rkvdec_coded_fmt_desc *
>>> rkvdec_find_coded_fmt_desc(struct rkvdec_ctx *ctx, u32 fourcc)
>>> {
>>> @@ -1125,6 +1184,35 @@ static irqreturn_t rk3399_irq_handler(struct rkvdec_ctx *ctx)
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2025-09-20 18:07 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-08 20:03 [PATCH v2 00/12] media: rkvdec: Add support for VDPU381 and VDPU383 Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-08 20:03 ` [PATCH v2 01/12] media: rkvdec: Switch to using structs instead of writel Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-08 20:03 ` [PATCH v2 02/12] media: rkvdec: Move cabac table to its own source file Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-08 20:03 ` [PATCH v2 03/12] media: rkvdec: Use structs to represent the HW RPS Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-08 20:03 ` [PATCH v2 04/12] media: rkvdec: Move h264 functions to common file Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-08 20:03 ` [PATCH v2 05/12] media: rkvdec: Add per variant configuration Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-11 6:13 ` Krzysztof Kozlowski
2025-08-11 6:13 ` Krzysztof Kozlowski
2025-08-11 13:52 ` Detlev Casanova
2025-08-11 13:52 ` Detlev Casanova
2025-08-08 20:03 ` [PATCH v2 06/12] media: rkvdec: Add RCB and SRAM support Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-11 6:13 ` Krzysztof Kozlowski
2025-08-11 6:13 ` Krzysztof Kozlowski
2025-08-11 13:54 ` Detlev Casanova
2025-08-11 13:54 ` Detlev Casanova
2025-08-11 14:01 ` Krzysztof Kozlowski
2025-08-11 14:01 ` Krzysztof Kozlowski
2025-08-11 18:44 ` Detlev Casanova
2025-08-11 18:44 ` Detlev Casanova
2025-08-08 20:03 ` [PATCH v2 07/12] media: rkvdec: Support per-variant interrupt handler Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-08 20:03 ` [PATCH v2 08/12] media: rkvdec: Enable all clocks without naming them Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-08 20:03 ` [PATCH v2 09/12] media: rkvdec: Add H264 support for the VDPU381 variant Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-12 17:07 ` Dmitry Osipenko
2025-08-12 17:07 ` Dmitry Osipenko
2025-09-20 15:00 ` Diederik de Haas
2025-09-20 15:00 ` Diederik de Haas
2025-09-20 16:15 ` Jonas Karlman
2025-09-20 16:15 ` Jonas Karlman
2025-09-20 18:06 ` Diederik de Haas [this message]
2025-09-20 18:06 ` Diederik de Haas
2025-08-08 20:03 ` [PATCH v2 10/12] media: rkvdec: Add H264 support for the VDPU383 variant Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-09 11:53 ` kernel test robot
2025-08-09 11:53 ` kernel test robot
2025-08-11 18:28 ` Nicolas Dufresne
2025-08-11 18:28 ` Nicolas Dufresne
2025-08-08 20:03 ` [PATCH v2 11/12] media: rkvdec: Add HEVC support for the VDPU381 variant Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-09 13:17 ` kernel test robot
2025-08-09 13:17 ` kernel test robot
2025-09-20 15:07 ` Diederik de Haas
2025-09-20 15:07 ` Diederik de Haas
2025-09-20 16:23 ` Jonas Karlman
2025-09-20 16:23 ` Jonas Karlman
2025-09-22 14:19 ` Nicolas Dufresne
2025-09-22 14:19 ` Nicolas Dufresne
2025-09-29 12:47 ` Detlev Casanova
2025-09-29 12:47 ` Detlev Casanova
2025-08-08 20:03 ` [PATCH v2 12/12] media: rkvdec: Add HEVC support for the VDPU383 variant Detlev Casanova
2025-08-08 20:03 ` Detlev Casanova
2025-08-11 9:56 ` [PATCH v2 00/12] media: rkvdec: Add support for VDPU381 and VDPU383 Heiko Stübner
2025-08-11 9:56 ` Heiko Stübner
2025-08-11 16:33 ` Detlev Casanova
2025-08-11 16:33 ` Detlev Casanova
2025-08-12 7:20 ` Piotr Oniszczuk
2025-08-12 7:20 ` Piotr Oniszczuk
2025-09-17 17:34 ` Diederik de Haas
2025-09-17 17:34 ` Diederik de Haas
2025-09-18 13:31 ` Nicolas Dufresne
2025-09-18 13:31 ` Nicolas Dufresne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DCXTSROW5FPM.1008CWKUXILAI@cknow.org \
--to=didi.debian@cknow.org \
--cc=detlev.casanova@collabora.com \
--cc=heiko@sntech.de \
--cc=jonas@kwiboo.se \
--cc=kernel@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.