Skip to contentSkip to conversation

media: verisilicon: AV1: Discard none supported profiles

PATCH In review Benjamin Gaignard 2 participants 2 messages Mar 25

Subsystems (3)
lore
Share & tools
lore

Benjamin Gaignard

author maintainer
#0 lore raw

PATCH 1/1 media: verisilicon: AV1: Discard none supported profiles

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.

---
 drivers/media/platform/verisilicon/hantro_drv.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/platform/verisilicon/hantro_drv.c +2 -0
index 2e81877f640f..12f98e7e7994 100644
@@ -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;
Signature · 1 line
2.43.0
maintainer
#1 lore raw

Le mercredi 25 mars 2026 à 14:19 +0100, Benjamin Gaignard a écrit :

Quoted 17 lines

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.

---
 drivers/media/platform/verisilicon/hantro_drv.c | 2 ++

 1 file changed, 2 insertions(+)
drivers/media/platform/verisilicon/hantro_drv.c +0 -0
index 2e81877f640f..12f98e7e7994 100644
@@ -283,6 +283,8 @@ static int hantro_try_ctrl(struct v4l2_ctrl *ctrl)


  if (sequence->bit_depth != 8 && sequence->bit_depth != 10) return -EINVAL;

drivers/media/platform/verisilicon/hantro_drv.c static int hantro_try_ctrl(struct v4l2_ctrl *ctrl) · line 287

Quoted 2 lines
drivers/media/platform/verisilicon/hantro_drv.c +2 -0
+		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

Quoted 3 lines

  }

  return 0;