Skip to contentSkip to conversation

media: verisilicon: AV1: Discard none supported profiles

PATCH Superseded Benjamin Gaignard 1 participant 2 messages Dec 4

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Benjamin Gaignard

author maintainer
#0 lore raw

PATCH v2 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.

---
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(-)
drivers/media/platform/verisilicon/hantro_drv.c +9 -1
index 56cb67846526c..bf6eba62ed70e 100644
@@ -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,
+		},
 	},
 };
 
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

Le 04/12/2026 à 13:09, Benjamin Gaignard a écrit :

Quoted 6 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 and inform userspace about hardware capabilities.

forget this one v3 is the correct patch.

Sorry,
Benjamin

Quoted 25 lines

---
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(-)
drivers/media/platform/verisilicon/hantro_drv.c +2 -1
index 56cb67846526c..bf6eba62ed70e 100644
@@ -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,
  		},
+	}, {

drivers/media/platform/verisilicon/hantro_drv.c static const struct hantro_ctrl controls[] = { · line 628

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

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip