public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: verisilicon: AV1: Discard none supported profiles
@ 2026-03-25 13:19 Benjamin Gaignard
  2026-03-25 18:46 ` Nicolas Dufresne
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Gaignard @ 2026-03-25 13:19 UTC (permalink / raw)
  To: nicolas.dufresne, p.zabel, mchehab, heiko
  Cc: linux-media, linux-rockchip, linux-kernel, linux-arm-kernel,
	kernel, Benjamin Gaignard

AV1 hardware can only decode YUV420 pixel format. That means
that only profile 0 is supported. Discard all other profiles
when receiving AV1 sequence control.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
 drivers/media/platform/verisilicon/hantro_drv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
index 2e81877f640f..12f98e7e7994 100644
--- a/drivers/media/platform/verisilicon/hantro_drv.c
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
@@ -283,6 +283,8 @@ static int hantro_try_ctrl(struct v4l2_ctrl *ctrl)
 
 		if (sequence->bit_depth != 8 && sequence->bit_depth != 10)
 			return -EINVAL;
+		if (sequence->seq_profile != 0)
+			return -EINVAL;
 	}
 
 	return 0;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: verisilicon: AV1: Discard none supported profiles
  2026-03-25 13:19 [PATCH] media: verisilicon: AV1: Discard none supported profiles Benjamin Gaignard
@ 2026-03-25 18:46 ` Nicolas Dufresne
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Dufresne @ 2026-03-25 18:46 UTC (permalink / raw)
  To: Benjamin Gaignard, p.zabel, mchehab, heiko
  Cc: linux-media, linux-rockchip, linux-kernel, linux-arm-kernel,
	kernel

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

Le mercredi 25 mars 2026 à 14:19 +0100, Benjamin Gaignard a écrit :
> AV1 hardware can only decode YUV420 pixel format. That means
> that only profile 0 is supported. Discard all other profiles
> when receiving AV1 sequence control.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
>  drivers/media/platform/verisilicon/hantro_drv.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index 2e81877f640f..12f98e7e7994 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -283,6 +283,8 @@ static int hantro_try_ctrl(struct v4l2_ctrl *ctrl)
>  
>  		if (sequence->bit_depth != 8 && sequence->bit_depth != 10)
>  			return -EINVAL;
> +		if (sequence->seq_profile != 0)
> +			return -EINVAL;

You should also add the missing control to better tell userspace what it can and
cannot do. Check MTK driver for reference, I think the same config can be used:

drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
...
		.cfg = {
			.id = V4L2_CID_MPEG_VIDEO_AV1_PROFILE,
			.min = V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN,
			.def = V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN,
			.max = V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN,
		},
...

Nicolas

>  	}
>  
>  	return 0;

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-25 18:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-25 13:19 [PATCH] media: verisilicon: AV1: Discard none supported profiles Benjamin Gaignard
2026-03-25 18:46 ` Nicolas Dufresne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox