Skip to contentSkip to conversation

media: verisilicon: AV1: Discard none supported profiles

PATCH New Benjamin Gaignard 1 participant 1 message Dec 4

Subsystems (3)
lore
Share & tools
lore

Benjamin Gaignard

author maintainer
#0 lore raw

PATCH v3 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 and inform userspace about hardware capabilities.

---
 drivers/media/platform/verisilicon/hantro_drv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/media/platform/verisilicon/hantro_drv.c +10 -0
index ad77942096d48..bf6eba62ed70e 100644
@@ -305,6 +305,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 != V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN)
+			return -EINVAL;
 	}
 
 	return 0;
@@ -613,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,
+		},
 	},
 };
 
Signature · 1 line
2.53.0