Skip to contentSkip to conversation

media: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format.

PATCH Superseded Dafna Hirschfeld 2 participants 5 messages Oct 20, 2020 – Oct 30, 2020

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 media: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format.

MEDIA_BUS_FMT_METADATA_FIXED should be used when the same driver handles both sides of the link and the bus format is a fixed metadata format that is not configurable from userspace.
The width and height will be set to 0 for this format.

---
changes since v1:
1. replace "This format may have 0 height and width." with "Width and height will be set to 0 for this format." and add it also to the commit log
2. s/meida:/media:/ in the patch subject line

 include/uapi/linux/media-bus-format.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/uapi/linux/media-bus-format.h +8 -0
index 84fa53ffb13f..2ce3d891d344 100644
@@ -156,4 +156,12 @@
 /* HSV - next is	0x6002 */
 #define MEDIA_BUS_FMT_AHSV8888_1X32		0x6001
 
+/*
+ * This format should be used when the same driver handles
+ * both sides of the link and the bus format is a fixed
+ * metadata format that is not configurable from userspace.
+ * Width and height will be set to 0 for this format.
+ */
+#define MEDIA_BUS_FMT_METADATA_FIXED		0x7001
+
 #endif /* __LINUX_MEDIA_BUS_FORMAT_H */
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 2/2 media: staging: rkisp1: isp: set metadata pads to MEDIA_BUS_FMT_METADATA_FIXED

Set the code of the metadata pads of the isp entity to MEDIA_BUS_FMT_METADATA_FIXED and set the width and height of their formats to 0. This solves the TODO item:
"Fix pad format size for statistics and parameters entities."

---
no changes since v1

 drivers/staging/media/rkisp1/TODO         | 1 -
 drivers/staging/media/rkisp1/rkisp1-isp.c | 8 ++++----
 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/staging/media/rkisp1/TODO +0 -1
index e7c8398fc2ce..c30c83681452 100644
@@ -1,4 +1,3 @@
-* Fix pad format size for statistics and parameters entities.
 * Fix checkpatch errors.
 * Add uapi docs. Remember to add documentation of how quantization is handled.
 * streaming paths (mainpath and selfpath) check if the other path is streaming
drivers/staging/media/rkisp1/rkisp1-isp.c +4 -4
index fb23461d865c..889982d8ca41 100644
@@ -574,7 +574,7 @@ static int rkisp1_isp_enum_mbus_code(struct v4l2_subdev *sd,
 	} else {
 		if (code->index > 0)
 			return -EINVAL;
-		code->code = MEDIA_BUS_FMT_FIXED;
+		code->code = MEDIA_BUS_FMT_METADATA_FIXED;
 		return 0;
 	}
 
@@ -633,10 +633,10 @@ static int rkisp1_isp_init_config(struct v4l2_subdev *sd,
 					      RKISP1_ISP_PAD_SINK_PARAMS);
 	src_fmt = v4l2_subdev_get_try_format(sd, cfg,
 					     RKISP1_ISP_PAD_SOURCE_STATS);
-	sink_fmt->width = RKISP1_DEFAULT_WIDTH;
-	sink_fmt->height = RKISP1_DEFAULT_HEIGHT;
+	sink_fmt->width = 0;
+	sink_fmt->height = 0;
 	sink_fmt->field = V4L2_FIELD_NONE;
-	sink_fmt->code = MEDIA_BUS_FMT_FIXED;
+	sink_fmt->code = MEDIA_BUS_FMT_METADATA_FIXED;
 	*src_fmt = *sink_fmt;
 
 	return 0;
Signature · 1 line
2.17.1
#2 lore raw
In reply to Dafna Hirschfeld
Quoted 26 lines · Dafna Hirschfeld

MEDIA_BUS_FMT_METADATA_FIXED should be used when the same driver handles both sides of the link and the bus format is a fixed metadata format that is not configurable from userspace.
The width and height will be set to 0 for this format.

---
changes since v1:
1. replace "This format may have 0 height and width." with "Width and height will be set to 0 for this format." and add it also to the commit log
2. s/meida:/media:/ in the patch subject line

 include/uapi/linux/media-bus-format.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/uapi/linux/media-bus-format.h +0 -0
index 84fa53ffb13f..2ce3d891d344 100644
@@ -156,4 +156,12 @@
 /* HSV - next is	0x6002 */
 #define MEDIA_BUS_FMT_AHSV8888_1X32		0x6001

include/uapi/linux/media-bus-format.h line 167

Quoted 10 lines
include/uapi/linux/media-bus-format.h +8 -0
 
+/*
+ * This format should be used when the same driver handles
+ * both sides of the link and the bus format is a fixed
+ * metadata format that is not configurable from userspace.
+ * Width and height will be set to 0 for this format.
+ */
+#define MEDIA_BUS_FMT_METADATA_FIXED		0x7001
+
 #endif /* __LINUX_MEDIA_BUS_FORMAT_H */

Documentation/userspace-api/media/v4l/subdev-formats.rst also needs to be updated.

Regards,

Hans

#3 lore raw

Am 30.10.20 um 09:58 schrieb Hans Verkuil:

Quoted 27 lines · Dafna Hirschfeld
Quoted 26 lines

MEDIA_BUS_FMT_METADATA_FIXED should be used when the same driver handles both sides of the link and the bus format is a fixed metadata format that is not configurable from userspace.
The width and height will be set to 0 for this format.

---
changes since v1:
1. replace "This format may have 0 height and width." with "Width and height will be set to 0 for this format." and add it also to the commit log
2. s/meida:/media:/ in the patch subject line

  include/uapi/linux/media-bus-format.h | 8 ++++++++
  1 file changed, 8 insertions(+)
include/uapi/linux/media-bus-format.h +0 -0
index 84fa53ffb13f..2ce3d891d344 100644
@@ -156,4 +156,12 @@
  /* HSV - next is	0x6002 */
  #define MEDIA_BUS_FMT_AHSV8888_1X32		0x6001
 
Quoted 13 lines

include/uapi/linux/media-bus-format.h line 167

Quoted 10 lines
include/uapi/linux/media-bus-format.h +8 -0
+/*
+ * This format should be used when the same driver handles
+ * both sides of the link and the bus format is a fixed
+ * metadata format that is not configurable from userspace.
+ * Width and height will be set to 0 for this format.
+ */
+#define MEDIA_BUS_FMT_METADATA_FIXED		0x7001
+
  #endif /* __LINUX_MEDIA_BUS_FORMAT_H */

Documentation/userspace-api/media/v4l/subdev-formats.rst also needs to be updated.

hi,
I wonder what should be the documentation, since this mbus code is for very specific use case. You think that the 0x7* mbus codes should be 'metadata mbus codes'?

Thanks,
Dafna

Quoted 5 lines

Regards,

Hans

#4 lore raw
Quoted 44 lines · Dafna Hirschfeld

Am 30.10.20 um 09:58 schrieb Hans Verkuil:

Quoted 27 lines · Dafna Hirschfeld
Quoted 26 lines

MEDIA_BUS_FMT_METADATA_FIXED should be used when the same driver handles both sides of the link and the bus format is a fixed metadata format that is not configurable from userspace.
The width and height will be set to 0 for this format.

---
changes since v1:
1. replace "This format may have 0 height and width." with "Width and height will be set to 0 for this format." and add it also to the commit log
2. s/meida:/media:/ in the patch subject line

  include/uapi/linux/media-bus-format.h | 8 ++++++++
  1 file changed, 8 insertions(+)
include/uapi/linux/media-bus-format.h +0 -0
index 84fa53ffb13f..2ce3d891d344 100644
@@ -156,4 +156,12 @@
  /* HSV - next is	0x6002 */
  #define MEDIA_BUS_FMT_AHSV8888_1X32		0x6001
 
Quoted 13 lines

include/uapi/linux/media-bus-format.h line 167

Quoted 10 lines
include/uapi/linux/media-bus-format.h +8 -0
+/*
+ * This format should be used when the same driver handles
+ * both sides of the link and the bus format is a fixed
+ * metadata format that is not configurable from userspace.
+ * Width and height will be set to 0 for this format.
+ */
+#define MEDIA_BUS_FMT_METADATA_FIXED		0x7001
+
  #endif /* __LINUX_MEDIA_BUS_FORMAT_H */

Documentation/userspace-api/media/v4l/subdev-formats.rst also needs to be updated.

Quoted 2 lines

hi,
I wonder what should be the documentation, since this mbus code

Basically the same as you wrote in the comment above.

Quoted 2 lines

is for very specific use case. You think that the 0x7* mbus codes should be 'metadata mbus codes'?

Yes.

Regards,

Hans