Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Tharit Tangkijwanichakul <tharitt97@gmail.com>,
	Detlev Casanova	 <detlev.casanova@collabora.com>,
	Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	 Hans Verkuil <hverkuil+cisco@kernel.org>,
	linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
	 linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	 linux-kernel-mentees@lists.linux.dev, skhan@linuxfoundation.org,
	 me@brighamcampbell.com, jkoolstra@xs4all.nl
Subject: Re: [PATCH] media: rkvdec: fix v4l2-compliance failure
Date: Mon, 10 Aug 2026 10:05:29 -0400	[thread overview]
Message-ID: <3cfca6fd11f39c6ce161d5a2e7fb650b2e9289ec.camel@collabora.com> (raw)
In-Reply-To: <20260730153603.5721-1-tharitt97@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2714 bytes --]

Hi,

Le jeudi 30 juillet 2026 à 15:36 +0000, Tharit Tangkijwanichakul a écrit :
> rkvdec fails v4l2-compliance in two tests related to
> V4L2_CID_STATELESS_HEVC_SPS. The Control ioctls test reads the control
> with GET_EXT_CTRLS and writes the same value back; TRY_EXT_CTRLS then
> returns -EINVAL because the VDPU38x rkvdec_hevc_validate_sps() rejects
> sps->chroma_format_idc == 0, which is the value returned when the
> control has no default.
> 
>     v4l2-compliance 1.33.0-5491, 64 bits, 64-bit time_t
>     v4l2-compliance SHA: b32589c51481 2026-07-16 08:51:38
>     Control ioctls:
>         fail: v4l2-test-controls.cpp(942):
> 	try_ext_ctrls returned an error (22)
>       test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL
>     Buffer ioctls:
>         fail: v4l2-test-buffers.cpp(3102): node->streamon(q.g_type())
>         fail: v4l2-test-buffers.cpp(3157): testBlockingDQBuf(node, m2m_q)
>       test blocking wait: FAIL
> 
> Provide a control default via p_def with chroma_format_idc = 1 (4:2:0),
> which is the only value the VDPU38x SPS validation accepts.
> This fixes both the Control ioctls and the Buffer ioctls failures.
> 
> Tested on Radxa Rock 5B (RK3588).
> 
> Fixes: c9a59dc2acc7 ("media: rkvdec: Add HEVC support for the VDPU381 variant")
> Signed-off-by: Tharit Tangkijwanichakul <tharitt97@gmail.com>
> ---
>  drivers/media/platform/rockchip/rkvdec/rkvdec.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
> index 1d1e9bfef8e9..37603f049788 100644
> --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c
> +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
> @@ -236,6 +236,10 @@ static const struct rkvdec_ctrls rkvdec_hevc_ctrls = {
>  	.num_ctrls = ARRAY_SIZE(rkvdec_hevc_ctrl_descs),
>  };
>  
> +static struct v4l2_ctrl_hevc_sps vdpu38x_hevc_sps_default = {
> +	.chroma_format_idc = 1,
> +};
> +
>  static const struct rkvdec_ctrl_desc vdpu38x_hevc_ctrl_descs[] = {
>  	{
>  		.cfg.id = V4L2_CID_STATELESS_HEVC_DECODE_PARAMS,
> @@ -243,6 +247,7 @@ static const struct rkvdec_ctrl_desc vdpu38x_hevc_ctrl_descs[] = {
>  	{
>  		.cfg.id = V4L2_CID_STATELESS_HEVC_SPS,
>  		.cfg.ops = &rkvdec_ctrl_ops,
> +		.cfg.p_def.p_hevc_sps = &vdpu38x_hevc_sps_default,

Thanks for your patch. Have you considered setting this default in v4l2-common
instead ? Monochrome is rarely supported of implemented in codecs, so setting
the global default to 4:2:0 seems like it would be valid for all drivers.

Nicolas

>  	},
>  	{
>  		.cfg.id = V4L2_CID_STATELESS_HEVC_PPS,

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2026-08-10 14:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 15:36 [PATCH] media: rkvdec: fix v4l2-compliance failure Tharit Tangkijwanichakul
2026-08-10 14:05 ` Nicolas Dufresne [this message]

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=3cfca6fd11f39c6ce161d5a2e7fb650b2e9289ec.camel@collabora.com \
    --to=nicolas.dufresne@collabora.com \
    --cc=detlev.casanova@collabora.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=heiko@sntech.de \
    --cc=hverkuil+cisco@kernel.org \
    --cc=jkoolstra@xs4all.nl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=me@brighamcampbell.com \
    --cc=skhan@linuxfoundation.org \
    --cc=tharitt97@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox