* [PATCH v2] media: verisilicon: AV1: Discard none supported profiles
@ 2026-12-04 12:09 Benjamin Gaignard
2026-12-04 12:14 ` Benjamin Gaignard
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Gaignard @ 2026-12-04 12:09 UTC (permalink / raw)
To: nicolas.dufresne, p.zabel, mchehab
Cc: linux-media, linux-rockchip, linux-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 and
inform userspace about hardware capabilities.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
changes in v2:
- Add control to inform userspace of the hardware capabilities.
drivers/media/platform/verisilicon/hantro_drv.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
index 56cb67846526c..bf6eba62ed70e 100644
--- a/drivers/media/platform/verisilicon/hantro_drv.c
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
@@ -305,7 +305,7 @@ 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)
+ if (sequence->seq_profile != V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN)
return -EINVAL;
}
@@ -615,6 +615,14 @@ static const struct hantro_ctrl controls[] = {
.cfg = {
.id = V4L2_CID_STATELESS_AV1_FILM_GRAIN,
},
+ }, {
+ .codec = HANTRO_AV1_DECODER,
+ .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,
+ },
},
};
--
2.53.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v2] media: verisilicon: AV1: Discard none supported profiles
2026-12-04 12:09 [PATCH v2] media: verisilicon: AV1: Discard none supported profiles Benjamin Gaignard
@ 2026-12-04 12:14 ` Benjamin Gaignard
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Gaignard @ 2026-12-04 12:14 UTC (permalink / raw)
To: nicolas.dufresne, p.zabel, mchehab
Cc: linux-media, linux-rockchip, linux-kernel, kernel
Le 04/12/2026 à 13:09, 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 and
> inform userspace about hardware capabilities.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
forget this one v3 is the correct patch.
Sorry,
Benjamin
> ---
> changes in v2:
> - Add control to inform userspace of the hardware capabilities.
>
> drivers/media/platform/verisilicon/hantro_drv.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index 56cb67846526c..bf6eba62ed70e 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -305,7 +305,7 @@ 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)
> + if (sequence->seq_profile != V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN)
> return -EINVAL;
> }
>
> @@ -615,6 +615,14 @@ static const struct hantro_ctrl controls[] = {
> .cfg = {
> .id = V4L2_CID_STATELESS_AV1_FILM_GRAIN,
> },
> + }, {
> + .codec = HANTRO_AV1_DECODER,
> + .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,
> + },
> },
> };
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-04 12:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-04 12:09 [PATCH v2] media: verisilicon: AV1: Discard none supported profiles Benjamin Gaignard
2026-12-04 12:14 ` Benjamin Gaignard
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®