devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] media: v4l: add support for Virtual Channel IDs
@ 2025-02-20 23:08 Cosmin Tanislav
  2025-02-20 23:08 ` [PATCH v2 1/6] dt-bindings: media: video-interfaces: " Cosmin Tanislav
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 23:08 UTC (permalink / raw)
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
	Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
	linux-kernel, Cosmin Tanislav

Multi-camera systems often have issues with receiving video streams
from multiple cameras at the same time because the cameras use the same
Virtual Channel IDs.

CSI bridges might not support remapping the Virtual Channel IDs, making
it impossible to receive the separate video streams at the same
time, while the CSI receiver is able to de-mux streams based on VC IDs.

Cameras sometimes have support for changing the VC IDs they output
themselves.

For a practical example, GMSL2 deserializer chips do not support VC ID
remapping in tunnel mode, and neither do the serializers. Allowing the
cameras to have their VC IDs configured would allow multi-camera setups
to use tunnel mode.

Add support for specifying these Virtual Channel IDs in Video Interface
Endpoints.

Add support for parsing VC IDs in v4l2_fwnode_endpoint_parse().
This allows us to retrieve the specified VC IDs in camera drivers and
configure the hardware to use them.

The supported values are 0 to 3, with a maximum of 4 values.
Although the CSI-2 specification allows for up to 32 virtual channels,
most hardware doesn't support more than 4. This can be extended later
if need be.

The driver must validate the number of VC IDs and the VC IDs
themselves.

Add an example implementation for IMX219.

V2:
 * goto err_rpm_put on failure to configure VC ID in imx219, and print
   error

Cosmin Tanislav (5):
  dt-bindings: media: video-interfaces: add support for Virtual Channel
    IDs
  media: v4l: fwnode: parse Virtual Channel IDs for CSI2 buses
  dt-bindings: media: imx219: add support for Virtual Channel IDs
  media: i2c: imx219: pass format's code to imx219_get_format_bpp()
  media: i2c: imx219: implement configurable VC ID

Laurent Pinchart (1):
  media: i2c: imx219: Report streams using frame descriptors

 .../devicetree/bindings/media/i2c/imx219.yaml |  2 +
 .../bindings/media/video-interfaces.yaml      | 11 ++++
 drivers/media/i2c/imx219.c                    | 56 ++++++++++++++++++-
 drivers/media/v4l2-core/v4l2-fwnode.c         | 15 +++++
 include/media/v4l2-mediabus.h                 |  5 ++
 5 files changed, 86 insertions(+), 3 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2 1/6] dt-bindings: media: video-interfaces: add support for Virtual Channel IDs
  2025-02-20 23:08 [PATCH v2 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
@ 2025-02-20 23:08 ` Cosmin Tanislav
  2025-02-21  8:38   ` Sakari Ailus
  2025-02-20 23:08 ` [PATCH v2 2/6] media: v4l: fwnode: parse Virtual Channel IDs for CSI2 buses Cosmin Tanislav
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 23:08 UTC (permalink / raw)
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
	Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
	linux-kernel, Cosmin Tanislav

Multi-camera systems often have issues with receiving video streams
from multiple cameras at the same time because the cameras use the same
Virtual Channel IDs.

CSI bridges might not support remapping the Virtual Channel IDs, making
it impossible to receive the separate video streams at the same
time, while the CSI receiver is able to de-mux streams based on VC IDs.

Cameras sometimes have support for changing the VC IDs they output
themselves.

For a practical example, GMSL2 deserializer chips do not support VC ID
remapping in tunnel mode, and neither do the serializers. Allowing the
cameras to have their VC IDs configured would allow multi-camera setups
to use tunnel mode.

Add support for specifying these Virtual Channel IDs in Video Interface
Endpoints. The supported values are 0 to 3, with a maximum of 4 values.
Although the CSI-2 specification allows for up to 32 virtual channels,
most hardware doesn't support more than 4. This can be extended later
if need be.

Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
 .../devicetree/bindings/media/video-interfaces.yaml   | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/video-interfaces.yaml b/Documentation/devicetree/bindings/media/video-interfaces.yaml
index 038e85b45befa..414b5fa8f3472 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.yaml
+++ b/Documentation/devicetree/bindings/media/video-interfaces.yaml
@@ -231,6 +231,17 @@ properties:
       shall be interpreted as 0 (ABC). This property is valid for CSI-2 C-PHY
       busses only.
 
+  vc-ids:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    minItems: 1
+    maxItems: 4
+    items:
+      maximum: 3
+    description:
+      An array of Virtual Channel IDs. These are unsigned integers that specify
+      the VC IDs used by the device for its data streams. This property is valid
+      for MIPI CSI-2 only.
+
   strobe:
     $ref: /schemas/types.yaml#/definitions/uint32
     enum: [ 0, 1 ]
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 2/6] media: v4l: fwnode: parse Virtual Channel IDs for CSI2 buses
  2025-02-20 23:08 [PATCH v2 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
  2025-02-20 23:08 ` [PATCH v2 1/6] dt-bindings: media: video-interfaces: " Cosmin Tanislav
@ 2025-02-20 23:08 ` Cosmin Tanislav
  2025-02-20 23:08 ` [PATCH v2 3/6] dt-bindings: media: imx219: add support for Virtual Channel IDs Cosmin Tanislav
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 23:08 UTC (permalink / raw)
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
	Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
	linux-kernel, Cosmin Tanislav

Multi-camera systems often have issues with receiving video streams
from multiple cameras at the same time because the cameras use the same
Virtual Channel IDs.

CSI bridges might not support remapping the Virtual Channel IDs, making
it impossible to receive the separate video streams at the same
time, while the CSI receiver is able to de-mux streams based on VC IDs.

Cameras sometimes have support for changing the VC IDs they output
themselves.

For a practical example, GMSL2 deserializer chips do not support VC ID
remapping in tunnel mode, and neither do the serializers. Allowing the
cameras to have their VC IDs configured would allow multi-camera setups
to use tunnel mode.

Add support for parsing VC IDs in v4l2_fwnode_endpoint_parse().
This allows us to retrieve the specified VC IDs in camera drivers and
configure the hardware to use them.

The supported values are 0 to 3, with a maximum of 4 values.
Although the CSI-2 specification allows for up to 32 virtual channels,
most hardware doesn't support more than 4. This can be extended later
if need be.

The driver must validate the number of VC IDs and the VC IDs
themselves.

Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
 drivers/media/v4l2-core/v4l2-fwnode.c | 15 +++++++++++++++
 include/media/v4l2-mediabus.h         |  5 +++++
 2 files changed, 20 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index cb153ce42c45d..97ecc01e1e39e 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -129,8 +129,10 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
 	bool have_clk_lane = false, have_data_lanes = false,
 		have_lane_polarities = false, have_line_orders = false;
 	unsigned int flags = 0, lanes_used = 0;
+	u32 vc_ids_array[V4L2_MBUS_CSI2_MAX_VC_IDS];
 	u32 array[1 + V4L2_MBUS_CSI2_MAX_DATA_LANES];
 	u32 clock_lane = 0;
+	unsigned int num_vc_ids = 0;
 	unsigned int num_data_lanes = 0;
 	bool use_default_lane_mapping = false;
 	unsigned int i;
@@ -208,6 +210,15 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
 		have_line_orders = true;
 	}
 
+	rval = fwnode_property_count_u32(fwnode, "vc-ids");
+	if (rval > 0) {
+		num_vc_ids =
+			min_t(unsigned int, V4L2_MBUS_CSI2_MAX_VC_IDS, rval);
+
+		fwnode_property_read_u32_array(fwnode, "vc-ids", vc_ids_array,
+					       num_vc_ids);
+	}
+
 	if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v)) {
 		clock_lane = v;
 		pr_debug("clock lane position %u\n", v);
@@ -248,6 +259,10 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
 				bus->data_lanes[i] = array[i];
 		}
 
+		bus->num_vc_ids = num_vc_ids;
+		for (i = 0; i < num_vc_ids; i++)
+			bus->vc_ids[i] = vc_ids_array[i];
+
 		if (have_lane_polarities) {
 			fwnode_property_read_u32_array(fwnode,
 						       "lane-polarities", array,
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 24c738cd78940..291b680d2a845 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -72,6 +72,7 @@
 #define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK	BIT(0)
 
 #define V4L2_MBUS_CSI2_MAX_DATA_LANES		8
+#define V4L2_MBUS_CSI2_MAX_VC_IDS		4
 
 /**
  * enum v4l2_mbus_csi2_cphy_line_orders_type - CSI-2 C-PHY line order
@@ -94,8 +95,10 @@ enum v4l2_mbus_csi2_cphy_line_orders_type {
 /**
  * struct v4l2_mbus_config_mipi_csi2 - MIPI CSI-2 data bus configuration
  * @flags: media bus (V4L2_MBUS_*) flags
+ * @vc_ids: an array of Virtual Channel IDs
  * @data_lanes: an array of physical data lane indexes
  * @clock_lane: physical lane index of the clock lane
+ * @num_vc_ids: number of Virtual Channel IDs
  * @num_data_lanes: number of data lanes
  * @lane_polarities: polarity of the lanes. The order is the same of
  *		   the physical lanes.
@@ -104,8 +107,10 @@ enum v4l2_mbus_csi2_cphy_line_orders_type {
  */
 struct v4l2_mbus_config_mipi_csi2 {
 	unsigned int flags;
+	unsigned char vc_ids[V4L2_MBUS_CSI2_MAX_VC_IDS];
 	unsigned char data_lanes[V4L2_MBUS_CSI2_MAX_DATA_LANES];
 	unsigned char clock_lane;
+	unsigned char num_vc_ids;
 	unsigned char num_data_lanes;
 	bool lane_polarities[1 + V4L2_MBUS_CSI2_MAX_DATA_LANES];
 	enum v4l2_mbus_csi2_cphy_line_orders_type line_orders[V4L2_MBUS_CSI2_MAX_DATA_LANES];
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 3/6] dt-bindings: media: imx219: add support for Virtual Channel IDs
  2025-02-20 23:08 [PATCH v2 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
  2025-02-20 23:08 ` [PATCH v2 1/6] dt-bindings: media: video-interfaces: " Cosmin Tanislav
  2025-02-20 23:08 ` [PATCH v2 2/6] media: v4l: fwnode: parse Virtual Channel IDs for CSI2 buses Cosmin Tanislav
@ 2025-02-20 23:08 ` Cosmin Tanislav
  2025-02-20 23:08 ` [PATCH v2 4/6] media: i2c: imx219: pass format's code to imx219_get_format_bpp() Cosmin Tanislav
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 23:08 UTC (permalink / raw)
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
	Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
	linux-kernel, Cosmin Tanislav

IMX219 supports configuring the Virtual Channel ID used for image and
embedded data streams.

Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
 Documentation/devicetree/bindings/media/i2c/imx219.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/i2c/imx219.yaml b/Documentation/devicetree/bindings/media/i2c/imx219.yaml
index 07d088cf66e0b..766b0e5fedb05 100644
--- a/Documentation/devicetree/bindings/media/i2c/imx219.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/imx219.yaml
@@ -66,6 +66,8 @@ properties:
 
           clock-noncontinuous: true
           link-frequencies: true
+          vc-ids:
+            maxItems: 1
 
         required:
           - link-frequencies
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 4/6] media: i2c: imx219: pass format's code to imx219_get_format_bpp()
  2025-02-20 23:08 [PATCH v2 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
                   ` (2 preceding siblings ...)
  2025-02-20 23:08 ` [PATCH v2 3/6] dt-bindings: media: imx219: add support for Virtual Channel IDs Cosmin Tanislav
@ 2025-02-20 23:08 ` Cosmin Tanislav
  2025-02-21  7:03   ` Jai Luthra
  2025-02-20 23:08 ` [PATCH v2 5/6] media: i2c: imx219: Report streams using frame descriptors Cosmin Tanislav
  2025-02-20 23:08 ` [PATCH v2 6/6] media: i2c: imx219: implement configurable VC ID Cosmin Tanislav
  5 siblings, 1 reply; 13+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 23:08 UTC (permalink / raw)
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
	Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
	linux-kernel, Cosmin Tanislav

imx219_get_format_bpp() only uses the code of the format, pass it
instead of the whole format to allow usage when the whole format is not
available.

Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
 drivers/media/i2c/imx219.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
index fcd98ee54768e..ad1965a91ae3c 100644
--- a/drivers/media/i2c/imx219.c
+++ b/drivers/media/i2c/imx219.c
@@ -387,9 +387,9 @@ static u32 imx219_get_format_code(struct imx219 *imx219, u32 code)
 	return imx219_mbus_formats[i];
 }
 
-static u32 imx219_get_format_bpp(const struct v4l2_mbus_framefmt *format)
+static u32 imx219_get_format_bpp(u32 code)
 {
-	switch (format->code) {
+	switch (code) {
 	case MEDIA_BUS_FMT_SRGGB8_1X8:
 	case MEDIA_BUS_FMT_SGRBG8_1X8:
 	case MEDIA_BUS_FMT_SGBRG8_1X8:
@@ -680,7 +680,7 @@ static int imx219_set_framefmt(struct imx219 *imx219,
 
 	format = v4l2_subdev_state_get_format(state, 0);
 	crop = v4l2_subdev_state_get_crop(state, 0);
-	bpp = imx219_get_format_bpp(format);
+	bpp = imx219_get_format_bpp(format->code);
 
 	cci_write(imx219->regmap, IMX219_REG_X_ADD_STA_A,
 		  crop->left - IMX219_PIXEL_ARRAY_LEFT, &ret);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 5/6] media: i2c: imx219: Report streams using frame descriptors
  2025-02-20 23:08 [PATCH v2 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
                   ` (3 preceding siblings ...)
  2025-02-20 23:08 ` [PATCH v2 4/6] media: i2c: imx219: pass format's code to imx219_get_format_bpp() Cosmin Tanislav
@ 2025-02-20 23:08 ` Cosmin Tanislav
  2025-02-26  8:52   ` Sakari Ailus
  2025-02-20 23:08 ` [PATCH v2 6/6] media: i2c: imx219: implement configurable VC ID Cosmin Tanislav
  5 siblings, 1 reply; 13+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 23:08 UTC (permalink / raw)
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
	Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
	linux-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Implement the .get_frame_desc() subdev operation to report information
about streams to the connected CSI-2 receiver. This is required to let
the CSI-2 receiver driver know about virtual channels and data types for
each stream.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/i2c/imx219.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
index ad1965a91ae3c..4c4ebe54f191b 100644
--- a/drivers/media/i2c/imx219.c
+++ b/drivers/media/i2c/imx219.c
@@ -23,6 +23,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
 
+#include <media/mipi-csi2.h>
 #include <media/v4l2-cci.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
@@ -990,6 +991,28 @@ static int imx219_init_state(struct v4l2_subdev *sd,
 	return 0;
 }
 
+static int imx219_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
+				 struct v4l2_mbus_frame_desc *fd)
+{
+	struct v4l2_subdev_state *state;
+	u32 code;
+
+	state = v4l2_subdev_lock_and_get_active_state(sd);
+	code = v4l2_subdev_state_get_format(state, 0)->code;
+	v4l2_subdev_unlock_state(state);
+
+	fd->type = V4L2_MBUS_FRAME_DESC_TYPE_CSI2;
+	fd->num_entries = 1;
+
+	fd->entry[0].pixelcode = code;
+	fd->entry[0].stream = 0;
+	fd->entry[0].bus.csi2.vc = 0;
+	fd->entry[0].bus.csi2.dt = imx219_get_format_bpp(code) == 8
+				 ? MIPI_CSI2_DT_RAW8 : MIPI_CSI2_DT_RAW10;
+
+	return 0;
+}
+
 static const struct v4l2_subdev_video_ops imx219_video_ops = {
 	.s_stream = imx219_set_stream,
 };
@@ -1000,6 +1023,7 @@ static const struct v4l2_subdev_pad_ops imx219_pad_ops = {
 	.set_fmt = imx219_set_pad_format,
 	.get_selection = imx219_get_selection,
 	.enum_frame_size = imx219_enum_frame_size,
+	.get_frame_desc = imx219_get_frame_desc,
 };
 
 static const struct v4l2_subdev_ops imx219_subdev_ops = {
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 6/6] media: i2c: imx219: implement configurable VC ID
  2025-02-20 23:08 [PATCH v2 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
                   ` (4 preceding siblings ...)
  2025-02-20 23:08 ` [PATCH v2 5/6] media: i2c: imx219: Report streams using frame descriptors Cosmin Tanislav
@ 2025-02-20 23:08 ` Cosmin Tanislav
  5 siblings, 0 replies; 13+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 23:08 UTC (permalink / raw)
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
	Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
	linux-kernel, Cosmin Tanislav

IMX219 supports configuring the Virtual Channel ID used for image and
embedded data streams.

Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
 drivers/media/i2c/imx219.c | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
index 4c4ebe54f191b..ae93ac2bbe367 100644
--- a/drivers/media/i2c/imx219.c
+++ b/drivers/media/i2c/imx219.c
@@ -38,6 +38,8 @@
 #define IMX219_MODE_STANDBY		0x00
 #define IMX219_MODE_STREAMING		0x01
 
+#define IMX219_REG_CSI_CH_ID		CCI_REG8(0x0110)
+
 #define IMX219_REG_CSI_LANE_MODE	CCI_REG8(0x0114)
 #define IMX219_CSI_2_LANE_MODE		0x01
 #define IMX219_CSI_4_LANE_MODE		0x03
@@ -363,6 +365,9 @@ struct imx219 {
 
 	/* Two or Four lanes */
 	u8 lanes;
+
+	/* Virtual channel ID */
+	u8 vc_id;
 };
 
 static inline struct imx219 *to_imx219(struct v4l2_subdev *_sd)
@@ -724,6 +729,12 @@ static int imx219_configure_lanes(struct imx219 *imx219)
 				  ARRAY_SIZE(imx219_4lane_regs), NULL);
 };
 
+static int imx219_configure_vc(struct imx219 *imx219)
+{
+	return cci_write(imx219->regmap, IMX219_REG_CSI_CH_ID,
+			 imx219->vc_id, NULL);
+}
+
 static int imx219_start_streaming(struct imx219 *imx219,
 				  struct v4l2_subdev_state *state)
 {
@@ -749,6 +760,13 @@ static int imx219_start_streaming(struct imx219 *imx219,
 		goto err_rpm_put;
 	}
 
+	/* Configure Virtual Channel ID */
+	ret = imx219_configure_vc(imx219);
+	if (ret) {
+		dev_err(&client->dev, "%s failed to configure vc\n", __func__);
+		goto err_rpm_put;
+	}
+
 	/* Apply format and crop settings. */
 	ret = imx219_set_framefmt(imx219, state);
 	if (ret) {
@@ -994,6 +1012,7 @@ static int imx219_init_state(struct v4l2_subdev *sd,
 static int imx219_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
 				 struct v4l2_mbus_frame_desc *fd)
 {
+	struct imx219 *imx219 = to_imx219(sd);
 	struct v4l2_subdev_state *state;
 	u32 code;
 
@@ -1006,7 +1025,7 @@ static int imx219_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
 
 	fd->entry[0].pixelcode = code;
 	fd->entry[0].stream = 0;
-	fd->entry[0].bus.csi2.vc = 0;
+	fd->entry[0].bus.csi2.vc = imx219->vc_id;
 	fd->entry[0].bus.csi2.dt = imx219_get_format_bpp(code) == 8
 				 ? MIPI_CSI2_DT_RAW8 : MIPI_CSI2_DT_RAW10;
 
@@ -1149,6 +1168,13 @@ static int imx219_check_hwcfg(struct device *dev, struct imx219 *imx219)
 	}
 	imx219->lanes = ep_cfg.bus.mipi_csi2.num_data_lanes;
 
+	if (ep_cfg.bus.mipi_csi2.num_vc_ids > 1) {
+		dev_err_probe(dev, -EINVAL,
+			      "only 1 virtual channel id is supported\n");
+		goto error_out;
+	}
+	imx219->vc_id = ep_cfg.bus.mipi_csi2.vc_ids[0];
+
 	/* Check the link frequency set in device tree */
 	switch (imx219->lanes) {
 	case 2:
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 4/6] media: i2c: imx219: pass format's code to imx219_get_format_bpp()
  2025-02-20 23:08 ` [PATCH v2 4/6] media: i2c: imx219: pass format's code to imx219_get_format_bpp() Cosmin Tanislav
@ 2025-02-21  7:03   ` Jai Luthra
  0 siblings, 0 replies; 13+ messages in thread
From: Jai Luthra @ 2025-02-21  7:03 UTC (permalink / raw)
  To: Cosmin Tanislav
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
	Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1528 bytes --]

Hi Cosmin,

Thanks for the patch.

On Feb 21, 2025 at 01:08:12 +0200, Cosmin Tanislav wrote:
> imx219_get_format_bpp() only uses the code of the format, pass it
> instead of the whole format to allow usage when the whole format is not
> available.
> 
> Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>

Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>

> ---
>  drivers/media/i2c/imx219.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
> index fcd98ee54768e..ad1965a91ae3c 100644
> --- a/drivers/media/i2c/imx219.c
> +++ b/drivers/media/i2c/imx219.c
> @@ -387,9 +387,9 @@ static u32 imx219_get_format_code(struct imx219 *imx219, u32 code)
>  	return imx219_mbus_formats[i];
>  }
>  
> -static u32 imx219_get_format_bpp(const struct v4l2_mbus_framefmt *format)
> +static u32 imx219_get_format_bpp(u32 code)
>  {
> -	switch (format->code) {
> +	switch (code) {
>  	case MEDIA_BUS_FMT_SRGGB8_1X8:
>  	case MEDIA_BUS_FMT_SGRBG8_1X8:
>  	case MEDIA_BUS_FMT_SGBRG8_1X8:
> @@ -680,7 +680,7 @@ static int imx219_set_framefmt(struct imx219 *imx219,
>  
>  	format = v4l2_subdev_state_get_format(state, 0);
>  	crop = v4l2_subdev_state_get_crop(state, 0);
> -	bpp = imx219_get_format_bpp(format);
> +	bpp = imx219_get_format_bpp(format->code);
>  
>  	cci_write(imx219->regmap, IMX219_REG_X_ADD_STA_A,
>  		  crop->left - IMX219_PIXEL_ARRAY_LEFT, &ret);
> -- 
> 2.48.1
> 

-- 
Thanks,
Jai

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/6] dt-bindings: media: video-interfaces: add support for Virtual Channel IDs
  2025-02-20 23:08 ` [PATCH v2 1/6] dt-bindings: media: video-interfaces: " Cosmin Tanislav
@ 2025-02-21  8:38   ` Sakari Ailus
  2025-02-21  8:55     ` Cosmin Tanislav
  2025-02-21 14:27     ` Cosmin Tanislav
  0 siblings, 2 replies; 13+ messages in thread
From: Sakari Ailus @ 2025-02-21  8:38 UTC (permalink / raw)
  To: Cosmin Tanislav
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Laurent Pinchart,
	linux-media, devicetree, imx, linux-arm-kernel, linux-kernel

Hi Cosmin,

Thanks for the patches.

On Fri, Feb 21, 2025 at 01:08:09AM +0200, Cosmin Tanislav wrote:
> Multi-camera systems often have issues with receiving video streams
> from multiple cameras at the same time because the cameras use the same
> Virtual Channel IDs.
> 
> CSI bridges might not support remapping the Virtual Channel IDs, making
> it impossible to receive the separate video streams at the same
> time, while the CSI receiver is able to de-mux streams based on VC IDs.
> 
> Cameras sometimes have support for changing the VC IDs they output
> themselves.
> 
> For a practical example, GMSL2 deserializer chips do not support VC ID
> remapping in tunnel mode, and neither do the serializers. Allowing the
> cameras to have their VC IDs configured would allow multi-camera setups
> to use tunnel mode.

We've tried to avoid having virtual channels in firmware and in UAPI,
I'm not yet entirely convinced we need to depart from the established
practices. Let's see. Apart from that, please see my comments below.

> 
> Add support for specifying these Virtual Channel IDs in Video Interface
> Endpoints. The supported values are 0 to 3, with a maximum of 4 values.
> Although the CSI-2 specification allows for up to 32 virtual channels,
> most hardware doesn't support more than 4. This can be extended later
> if need be.
> 
> Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
> ---
>  .../devicetree/bindings/media/video-interfaces.yaml   | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.yaml b/Documentation/devicetree/bindings/media/video-interfaces.yaml
> index 038e85b45befa..414b5fa8f3472 100644
> --- a/Documentation/devicetree/bindings/media/video-interfaces.yaml
> +++ b/Documentation/devicetree/bindings/media/video-interfaces.yaml
> @@ -231,6 +231,17 @@ properties:
>        shall be interpreted as 0 (ABC). This property is valid for CSI-2 C-PHY
>        busses only.
>  
> +  vc-ids:

Other properties aren't using abbreviations, at least most of them. How
about "virtual-channels"?

> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> +    minItems: 1
> +    maxItems: 4

Shouldn't this be 32?

> +    items:
> +      maximum: 3

31 here, too.

> +    description:
> +      An array of Virtual Channel IDs. These are unsigned integers that specify

I'd leave out the explanation on the data type. It's redundant.

> +      the VC IDs used by the device for its data streams. This property is valid
> +      for MIPI CSI-2 only.
> +
>    strobe:
>      $ref: /schemas/types.yaml#/definitions/uint32
>      enum: [ 0, 1 ]

-- 
Kind regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/6] dt-bindings: media: video-interfaces: add support for Virtual Channel IDs
  2025-02-21  8:38   ` Sakari Ailus
@ 2025-02-21  8:55     ` Cosmin Tanislav
  2025-02-21 14:27     ` Cosmin Tanislav
  1 sibling, 0 replies; 13+ messages in thread
From: Cosmin Tanislav @ 2025-02-21  8:55 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Laurent Pinchart,
	linux-media, devicetree, imx, linux-arm-kernel, linux-kernel



On 2/21/25 10:38 AM, Sakari Ailus wrote:
> Hi Cosmin,
> 
> Thanks for the patches.
> 
> On Fri, Feb 21, 2025 at 01:08:09AM +0200, Cosmin Tanislav wrote:
>> Multi-camera systems often have issues with receiving video streams
>> from multiple cameras at the same time because the cameras use the same
>> Virtual Channel IDs.
>>
>> CSI bridges might not support remapping the Virtual Channel IDs, making
>> it impossible to receive the separate video streams at the same
>> time, while the CSI receiver is able to de-mux streams based on VC IDs.
>>
>> Cameras sometimes have support for changing the VC IDs they output
>> themselves.
>>
>> For a practical example, GMSL2 deserializer chips do not support VC ID
>> remapping in tunnel mode, and neither do the serializers. Allowing the
>> cameras to have their VC IDs configured would allow multi-camera setups
>> to use tunnel mode.
> 
> We've tried to avoid having virtual channels in firmware and in UAPI,
> I'm not yet entirely convinced we need to depart from the established
> practices. Let's see. Apart from that, please see my comments below.
> 

Sadly there's no other way to handle multi-camera support for GMSL
devices that don't support VC ID remapping. And upcomming GMSL3 devices
only support tunnel mode which doesn't support any type of remapping.

>>
>> Add support for specifying these Virtual Channel IDs in Video Interface
>> Endpoints. The supported values are 0 to 3, with a maximum of 4 values.
>> Although the CSI-2 specification allows for up to 32 virtual channels,
>> most hardware doesn't support more than 4. This can be extended later
>> if need be.
>>
>> Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
>> ---
>>   .../devicetree/bindings/media/video-interfaces.yaml   | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.yaml b/Documentation/devicetree/bindings/media/video-interfaces.yaml
>> index 038e85b45befa..414b5fa8f3472 100644
>> --- a/Documentation/devicetree/bindings/media/video-interfaces.yaml
>> +++ b/Documentation/devicetree/bindings/media/video-interfaces.yaml
>> @@ -231,6 +231,17 @@ properties:
>>         shall be interpreted as 0 (ABC). This property is valid for CSI-2 C-PHY
>>         busses only.
>>   
>> +  vc-ids:
> 
> Other properties aren't using abbreviations, at least most of them. How
> about "virtual-channels"?
> 

That works for me.

>> +    $ref: /schemas/types.yaml#/definitions/uint32-array
>> +    minItems: 1
>> +    maxItems: 4
> 
> Shouldn't this be 32?
> 

For the moment I picked 4 VC IDs (2 bits per VC ID) because any more
than that doesn't seem to be supported by CSI receivers, since most
do not support extended VC IDs.

Also, from the MIPI specification:

The Data Identifier byte contains the Virtual Channel Identifier (VC) 
value and the Data Type (DT) value as illustrated in Figure 32.

The Virtual Channel Identifier is contained in the two MS bits of the
Data Identifier Byte. The Data Type value is contained in the six LS
bits of the Data Identifier Byte.

>> +    items:
>> +      maximum: 3
> 
> 31 here, too.
> 
>> +    description:
>> +      An array of Virtual Channel IDs. These are unsigned integers that specify
> 
> I'd leave out the explanation on the data type. It's redundant.
> 
>> +      the VC IDs used by the device for its data streams. This property is valid
>> +      for MIPI CSI-2 only.
>> +
>>     strobe:
>>       $ref: /schemas/types.yaml#/definitions/uint32
>>       enum: [ 0, 1 ]
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/6] dt-bindings: media: video-interfaces: add support for Virtual Channel IDs
  2025-02-21  8:38   ` Sakari Ailus
  2025-02-21  8:55     ` Cosmin Tanislav
@ 2025-02-21 14:27     ` Cosmin Tanislav
  2025-02-24 21:40       ` Laurent Pinchart
  1 sibling, 1 reply; 13+ messages in thread
From: Cosmin Tanislav @ 2025-02-21 14:27 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Laurent Pinchart,
	linux-media, devicetree, imx, linux-arm-kernel, linux-kernel



On 2/21/25 10:38 AM, Sakari Ailus wrote:
> Hi Cosmin,
> 
> Thanks for the patches.
> 
> On Fri, Feb 21, 2025 at 01:08:09AM +0200, Cosmin Tanislav wrote:
>> Multi-camera systems often have issues with receiving video streams
>> from multiple cameras at the same time because the cameras use the same
>> Virtual Channel IDs.
>>
>> CSI bridges might not support remapping the Virtual Channel IDs, making
>> it impossible to receive the separate video streams at the same
>> time, while the CSI receiver is able to de-mux streams based on VC IDs.
>>
>> Cameras sometimes have support for changing the VC IDs they output
>> themselves.
>>
>> For a practical example, GMSL2 deserializer chips do not support VC ID
>> remapping in tunnel mode, and neither do the serializers. Allowing the
>> cameras to have their VC IDs configured would allow multi-camera setups
>> to use tunnel mode.
> 
> We've tried to avoid having virtual channels in firmware and in UAPI,
> I'm not yet entirely convinced we need to depart from the established
> practices. Let's see. Apart from that, please see my comments below.
> 

Can you think if any other way of handling this? The most useful way
would be to have it accessible at runtime so that devices upstream of
the cameras could assign the VC IDs dynamically.

This would be useful when having more cameras than the maximum supported
number of VC IDs (4, without extended VC IDs), and streaming from them
selectively.

For example, for 8 cameras, you'd have to prepare your VC IDs in advance
to fit the streaming selection you want to make. If the cameras 0 to 7
have the VC IDs 0, 1, 2, 3, 0, 1, 2, 3, you wouldn't be able to stream
camera 0 together with camera 4.

Dynamic configuration of the VC IDs would solve that usecase since it
would assign VC IDs based on the routed streams.

v4l2_subdev_pad_ops has a .set_frame_desc() that could be used to apply
an updated v4l2_mbus_frame_desc, after retrieving it using
.get_frame_desc(). Cameras that don't support VC ID remapping would just
modify the v4l2_mbus_frame_desc to restore the VC ID to the original one
(similar to how set_fmt() can modify the passed in format to what it
supports) and the caller would have to handle that situation how it sees
fit.

Does that sound better than sticking the VC ID in device tree?

>>
>> Add support for specifying these Virtual Channel IDs in Video Interface
>> Endpoints. The supported values are 0 to 3, with a maximum of 4 values.
>> Although the CSI-2 specification allows for up to 32 virtual channels,
>> most hardware doesn't support more than 4. This can be extended later
>> if need be.
>>
>> Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
>> ---
>>   .../devicetree/bindings/media/video-interfaces.yaml   | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.yaml b/Documentation/devicetree/bindings/media/video-interfaces.yaml
>> index 038e85b45befa..414b5fa8f3472 100644
>> --- a/Documentation/devicetree/bindings/media/video-interfaces.yaml
>> +++ b/Documentation/devicetree/bindings/media/video-interfaces.yaml
>> @@ -231,6 +231,17 @@ properties:
>>         shall be interpreted as 0 (ABC). This property is valid for CSI-2 C-PHY
>>         busses only.
>>   
>> +  vc-ids:
> 
> Other properties aren't using abbreviations, at least most of them. How
> about "virtual-channels"?
> 
>> +    $ref: /schemas/types.yaml#/definitions/uint32-array
>> +    minItems: 1
>> +    maxItems: 4
> 
> Shouldn't this be 32?
> 
>> +    items:
>> +      maximum: 3
> 
> 31 here, too.
> 
>> +    description:
>> +      An array of Virtual Channel IDs. These are unsigned integers that specify
> 
> I'd leave out the explanation on the data type. It's redundant.
> 
>> +      the VC IDs used by the device for its data streams. This property is valid
>> +      for MIPI CSI-2 only.
>> +
>>     strobe:
>>       $ref: /schemas/types.yaml#/definitions/uint32
>>       enum: [ 0, 1 ]
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/6] dt-bindings: media: video-interfaces: add support for Virtual Channel IDs
  2025-02-21 14:27     ` Cosmin Tanislav
@ 2025-02-24 21:40       ` Laurent Pinchart
  0 siblings, 0 replies; 13+ messages in thread
From: Laurent Pinchart @ 2025-02-24 21:40 UTC (permalink / raw)
  To: Cosmin Tanislav
  Cc: Sakari Ailus, Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, linux-media, devicetree,
	imx, linux-arm-kernel, linux-kernel

Hi Cosmin,

On Fri, Feb 21, 2025 at 04:27:55PM +0200, Cosmin Tanislav wrote:
> On 2/21/25 10:38 AM, Sakari Ailus wrote:
> > On Fri, Feb 21, 2025 at 01:08:09AM +0200, Cosmin Tanislav wrote:
> >> Multi-camera systems often have issues with receiving video streams
> >> from multiple cameras at the same time because the cameras use the same
> >> Virtual Channel IDs.
> >>
> >> CSI bridges might not support remapping the Virtual Channel IDs, making
> >> it impossible to receive the separate video streams at the same
> >> time, while the CSI receiver is able to de-mux streams based on VC IDs.
> >>
> >> Cameras sometimes have support for changing the VC IDs they output
> >> themselves.
> >>
> >> For a practical example, GMSL2 deserializer chips do not support VC ID
> >> remapping in tunnel mode, and neither do the serializers. Allowing the
> >> cameras to have their VC IDs configured would allow multi-camera setups
> >> to use tunnel mode.
> > 
> > We've tried to avoid having virtual channels in firmware and in UAPI,
> > I'm not yet entirely convinced we need to depart from the established
> > practices. Let's see. Apart from that, please see my comments below.
> 
> Can you think if any other way of handling this? The most useful way
> would be to have it accessible at runtime so that devices upstream of
> the cameras could assign the VC IDs dynamically.
> 
> This would be useful when having more cameras than the maximum supported
> number of VC IDs (4, without extended VC IDs), and streaming from them
> selectively.
> 
> For example, for 8 cameras, you'd have to prepare your VC IDs in advance
> to fit the streaming selection you want to make. If the cameras 0 to 7
> have the VC IDs 0, 1, 2, 3, 0, 1, 2, 3, you wouldn't be able to stream
> camera 0 together with camera 4.
> 
> Dynamic configuration of the VC IDs would solve that usecase since it
> would assign VC IDs based on the routed streams.
> 
> v4l2_subdev_pad_ops has a .set_frame_desc() that could be used to apply
> an updated v4l2_mbus_frame_desc, after retrieving it using
> .get_frame_desc(). Cameras that don't support VC ID remapping would just
> modify the v4l2_mbus_frame_desc to restore the VC ID to the original one
> (similar to how set_fmt() can modify the passed in format to what it
> supports) and the caller would have to handle that situation how it sees
> fit.
> 
> Does that sound better than sticking the VC ID in device tree?

I think a VC allocator would be very interesting development. It's
probably a bit more complex than hardcoding the information in DT, but
it would also be much nicer :-) I haven't really thought about how this
could be implemented though, but I'd be happy to discuss it.

The timing is slightly unfortunate, as I'll be travelling on weeks 11
and 12 and will have limited time then, but I'm sure Sakari and Tomi can
also provide guidelines.

> >> Add support for specifying these Virtual Channel IDs in Video Interface
> >> Endpoints. The supported values are 0 to 3, with a maximum of 4 values.
> >> Although the CSI-2 specification allows for up to 32 virtual channels,
> >> most hardware doesn't support more than 4. This can be extended later
> >> if need be.
> >>
> >> Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
> >> ---
> >>   .../devicetree/bindings/media/video-interfaces.yaml   | 11 +++++++++++
> >>   1 file changed, 11 insertions(+)
> >>
> >> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.yaml b/Documentation/devicetree/bindings/media/video-interfaces.yaml
> >> index 038e85b45befa..414b5fa8f3472 100644
> >> --- a/Documentation/devicetree/bindings/media/video-interfaces.yaml
> >> +++ b/Documentation/devicetree/bindings/media/video-interfaces.yaml
> >> @@ -231,6 +231,17 @@ properties:
> >>         shall be interpreted as 0 (ABC). This property is valid for CSI-2 C-PHY
> >>         busses only.
> >>   
> >> +  vc-ids:
> > 
> > Other properties aren't using abbreviations, at least most of them. How
> > about "virtual-channels"?
> > 
> >> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> >> +    minItems: 1
> >> +    maxItems: 4
> > 
> > Shouldn't this be 32?
> > 
> >> +    items:
> >> +      maximum: 3
> > 
> > 31 here, too.
> > 
> >> +    description:
> >> +      An array of Virtual Channel IDs. These are unsigned integers that specify
> > 
> > I'd leave out the explanation on the data type. It's redundant.
> > 
> >> +      the VC IDs used by the device for its data streams. This property is valid
> >> +      for MIPI CSI-2 only.
> >> +
> >>     strobe:
> >>       $ref: /schemas/types.yaml#/definitions/uint32
> >>       enum: [ 0, 1 ]

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 5/6] media: i2c: imx219: Report streams using frame descriptors
  2025-02-20 23:08 ` [PATCH v2 5/6] media: i2c: imx219: Report streams using frame descriptors Cosmin Tanislav
@ 2025-02-26  8:52   ` Sakari Ailus
  0 siblings, 0 replies; 13+ messages in thread
From: Sakari Ailus @ 2025-02-26  8:52 UTC (permalink / raw)
  To: Cosmin Tanislav
  Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Laurent Pinchart,
	linux-media, devicetree, imx, linux-arm-kernel, linux-kernel

Hi Cosmin,

On Fri, Feb 21, 2025 at 01:08:13AM +0200, Cosmin Tanislav wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Implement the .get_frame_desc() subdev operation to report information
> about streams to the connected CSI-2 receiver. This is required to let
> the CSI-2 receiver driver know about virtual channels and data types for
> each stream.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

In addition to this, the idea has been that the set_frame_desc() could be
used to set aspects of the frame descriptor. My thinking has been that you
could modify the entries, up to the degree supported by the driver, but not
add or remove them. This should be properly documented in v4l2-subdev.h.

-- 
Regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-02-26  8:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20 23:08 [PATCH v2 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
2025-02-20 23:08 ` [PATCH v2 1/6] dt-bindings: media: video-interfaces: " Cosmin Tanislav
2025-02-21  8:38   ` Sakari Ailus
2025-02-21  8:55     ` Cosmin Tanislav
2025-02-21 14:27     ` Cosmin Tanislav
2025-02-24 21:40       ` Laurent Pinchart
2025-02-20 23:08 ` [PATCH v2 2/6] media: v4l: fwnode: parse Virtual Channel IDs for CSI2 buses Cosmin Tanislav
2025-02-20 23:08 ` [PATCH v2 3/6] dt-bindings: media: imx219: add support for Virtual Channel IDs Cosmin Tanislav
2025-02-20 23:08 ` [PATCH v2 4/6] media: i2c: imx219: pass format's code to imx219_get_format_bpp() Cosmin Tanislav
2025-02-21  7:03   ` Jai Luthra
2025-02-20 23:08 ` [PATCH v2 5/6] media: i2c: imx219: Report streams using frame descriptors Cosmin Tanislav
2025-02-26  8:52   ` Sakari Ailus
2025-02-20 23:08 ` [PATCH v2 6/6] media: i2c: imx219: implement configurable VC ID Cosmin Tanislav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).