All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH V0 0/2] media: v4l2: extend framework to support advanced feature of Mediatek Camsys driver
@ 2021-05-07  2:53 ` john.wei
  0 siblings, 0 replies; 12+ messages in thread
From: john.wei @ 2021-05-07  2:53 UTC (permalink / raw)
  To: john.wei, louis.kuo, mchehab, matthias.bgg
  Cc: linux-media, linux-kernel, linux-arm-kernel, linux-mediatek,
	wsd_upstream

Hello,

This is the first version of the RFC patch series to v4l2 and media framework
to support virtual channel (an advanced feature of MIPI CSI). Virtual channel
was used commonly among modern image sensor. It was used to transfer
metadata of an image such as statistical data of AE or AF.Some advanced
features of camera such as HDR (High dynamic range), PDAF (Phase Detection
Auto Focus) were achieved by virtual channel. Medaitek made some modification
to frame descriptor based on https://patchwork.kernel.org/patch/10875875/ and
https://patchwork.kernel.org/patch/10875875/.We extend the struct
v4l2_mbus_frame_desc_entry by add enable, hsize, vsize and user_data_desc.
With this modification, frame descriptor are now more powerful to meet all
kinds of need among different applications. Here is an example that we use
frame descriptor to describe all data streams in a frame output by a
 stagger sensor.

static struct v4l2_mbus_frame_desc_entry frame_desc_cus1[] = {
        {
                .bus.csi2 = {
                        .channel = 0,
                        .data_type = 0x2b,
                        .enable = 1,
                        .hsize = 0xF00,
                        .vsize = 0x870,
                        .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_LE,
                },
        },
        {
                .bus.csi2 = {
                        .channel = 1,
                        .data_type = 0x2b,
                        .enable = 1,
                        .hsize = 0xF00,
                        .vsize = 0x870,
                        .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SE,
                },
        },
};

The first data stream, data for long exposure was transfer by channel 0 with
data type 0x2b and the resolution was 0xF00 by horizontal and 0x870 by vertical.
The second data stream, data for short exposure was transfer by channel 1
with data type 0x2b and the resolution was also 0xF00 by horizontal and 0x870
by vertical. Both long exposure and short exposure data will be fused in ISP
stage to output a HDR image.

  media: v4l2: Add fields to frame descriptors
  media: v4l2-ctrl: Add user defined base for ISP user control

 include/media/v4l2-subdev.h        |   25 ++++++++++++++++++++++++-
 include/uapi/linux/v4l2-controls.h |   10 ++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)


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

* [RFC PATCH V0 0/2] media: v4l2: extend framework to support advanced feature of Mediatek Camsys driver
@ 2021-05-07  2:53 ` john.wei
  0 siblings, 0 replies; 12+ messages in thread
From: john.wei @ 2021-05-07  2:53 UTC (permalink / raw)
  To: john.wei, louis.kuo, mchehab, matthias.bgg
  Cc: linux-media, linux-kernel, linux-arm-kernel, linux-mediatek,
	wsd_upstream

Hello,

This is the first version of the RFC patch series to v4l2 and media framework
to support virtual channel (an advanced feature of MIPI CSI). Virtual channel
was used commonly among modern image sensor. It was used to transfer
metadata of an image such as statistical data of AE or AF.Some advanced
features of camera such as HDR (High dynamic range), PDAF (Phase Detection
Auto Focus) were achieved by virtual channel. Medaitek made some modification
to frame descriptor based on https://patchwork.kernel.org/patch/10875875/ and
https://patchwork.kernel.org/patch/10875875/.We extend the struct
v4l2_mbus_frame_desc_entry by add enable, hsize, vsize and user_data_desc.
With this modification, frame descriptor are now more powerful to meet all
kinds of need among different applications. Here is an example that we use
frame descriptor to describe all data streams in a frame output by a
 stagger sensor.

static struct v4l2_mbus_frame_desc_entry frame_desc_cus1[] = {
        {
                .bus.csi2 = {
                        .channel = 0,
                        .data_type = 0x2b,
                        .enable = 1,
                        .hsize = 0xF00,
                        .vsize = 0x870,
                        .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_LE,
                },
        },
        {
                .bus.csi2 = {
                        .channel = 1,
                        .data_type = 0x2b,
                        .enable = 1,
                        .hsize = 0xF00,
                        .vsize = 0x870,
                        .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SE,
                },
        },
};

The first data stream, data for long exposure was transfer by channel 0 with
data type 0x2b and the resolution was 0xF00 by horizontal and 0x870 by vertical.
The second data stream, data for short exposure was transfer by channel 1
with data type 0x2b and the resolution was also 0xF00 by horizontal and 0x870
by vertical. Both long exposure and short exposure data will be fused in ISP
stage to output a HDR image.

  media: v4l2: Add fields to frame descriptors
  media: v4l2-ctrl: Add user defined base for ISP user control

 include/media/v4l2-subdev.h        |   25 ++++++++++++++++++++++++-
 include/uapi/linux/v4l2-controls.h |   10 ++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [RFC PATCH V0 0/2] media: v4l2: extend framework to support advanced feature of Mediatek Camsys driver
@ 2021-05-07  2:53 ` john.wei
  0 siblings, 0 replies; 12+ messages in thread
From: john.wei @ 2021-05-07  2:53 UTC (permalink / raw)
  To: john.wei, louis.kuo, mchehab, matthias.bgg
  Cc: linux-media, linux-kernel, linux-arm-kernel, linux-mediatek,
	wsd_upstream

Hello,

This is the first version of the RFC patch series to v4l2 and media framework
to support virtual channel (an advanced feature of MIPI CSI). Virtual channel
was used commonly among modern image sensor. It was used to transfer
metadata of an image such as statistical data of AE or AF.Some advanced
features of camera such as HDR (High dynamic range), PDAF (Phase Detection
Auto Focus) were achieved by virtual channel. Medaitek made some modification
to frame descriptor based on https://patchwork.kernel.org/patch/10875875/ and
https://patchwork.kernel.org/patch/10875875/.We extend the struct
v4l2_mbus_frame_desc_entry by add enable, hsize, vsize and user_data_desc.
With this modification, frame descriptor are now more powerful to meet all
kinds of need among different applications. Here is an example that we use
frame descriptor to describe all data streams in a frame output by a
 stagger sensor.

static struct v4l2_mbus_frame_desc_entry frame_desc_cus1[] = {
        {
                .bus.csi2 = {
                        .channel = 0,
                        .data_type = 0x2b,
                        .enable = 1,
                        .hsize = 0xF00,
                        .vsize = 0x870,
                        .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_LE,
                },
        },
        {
                .bus.csi2 = {
                        .channel = 1,
                        .data_type = 0x2b,
                        .enable = 1,
                        .hsize = 0xF00,
                        .vsize = 0x870,
                        .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SE,
                },
        },
};

The first data stream, data for long exposure was transfer by channel 0 with
data type 0x2b and the resolution was 0xF00 by horizontal and 0x870 by vertical.
The second data stream, data for short exposure was transfer by channel 1
with data type 0x2b and the resolution was also 0xF00 by horizontal and 0x870
by vertical. Both long exposure and short exposure data will be fused in ISP
stage to output a HDR image.

  media: v4l2: Add fields to frame descriptors
  media: v4l2-ctrl: Add user defined base for ISP user control

 include/media/v4l2-subdev.h        |   25 ++++++++++++++++++++++++-
 include/uapi/linux/v4l2-controls.h |   10 ++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [RFC PATCH V0 1/2] media: v4l2: Add fields to frame descriptors
  2021-05-07  2:53 ` john.wei
  (?)
@ 2021-05-07  2:53   ` john.wei
  -1 siblings, 0 replies; 12+ messages in thread
From: john.wei @ 2021-05-07  2:53 UTC (permalink / raw)
  To: john.wei, louis.kuo, mchehab, matthias.bgg
  Cc: linux-media, linux-kernel, linux-arm-kernel, linux-mediatek,
	wsd_upstream

From: John Wei <john.wei@mediatek.com>

Add enable, hsize, vsize, user_data_desc to frame descriptors

This patch is derived from following patches
https://patchwork.kernel.org/patch/10875875/
https://patchwork.kernel.org/patch/10875869/

Signed-off-by: John Wei <john.wei@mediatek.com>
---
 include/media/v4l2-subdev.h |   25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 30ec011..f603831 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -308,15 +308,38 @@ struct v4l2_subdev_audio_ops {
 	int (*s_stream)(struct v4l2_subdev *sd, int enable);
 };
 
+enum v4l2_mbus_csi2_user_defined_data_desc {
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_NONE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_Y_HIST,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_AE_HIST,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_FLICKER,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_GYRO,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_PDAF_PIXEL,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_PDAF_DIFF,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_LE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_ME,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SSE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SSSE,
+};
+
 /**
  * struct v4l2_mbus_frame_desc_entry_csi2
  *
  * @channel: CSI-2 virtual channel
  * @data_type: CSI-2 data type ID
+ * @enable: enable this data identifier
+ * @hsize: horizontal size
+ * @vsize: vertical size
+ * @user_data_desc: the description of user defined data
  */
 struct v4l2_mbus_frame_desc_entry_csi2 {
 	u8 channel;
 	u8 data_type;
+	u8 enable;
+	u16 hsize;
+	u16 vsize;
+	enum v4l2_mbus_csi2_user_defined_data_desc user_data_desc;
 };
 
 /**
@@ -354,7 +377,7 @@ struct v4l2_mbus_frame_desc_entry {
 	} bus;
 };
 
-#define V4L2_FRAME_DESC_ENTRY_MAX	4
+#define V4L2_FRAME_DESC_ENTRY_MAX	8
 
 enum v4l2_mbus_frame_desc_type {
 	V4L2_MBUS_FRAME_DESC_TYPE_PLATFORM,
-- 
1.7.9.5


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

* [RFC PATCH V0 1/2] media: v4l2: Add fields to frame descriptors
@ 2021-05-07  2:53   ` john.wei
  0 siblings, 0 replies; 12+ messages in thread
From: john.wei @ 2021-05-07  2:53 UTC (permalink / raw)
  To: john.wei, louis.kuo, mchehab, matthias.bgg
  Cc: linux-media, linux-kernel, linux-arm-kernel, linux-mediatek,
	wsd_upstream

From: John Wei <john.wei@mediatek.com>

Add enable, hsize, vsize, user_data_desc to frame descriptors

This patch is derived from following patches
https://patchwork.kernel.org/patch/10875875/
https://patchwork.kernel.org/patch/10875869/

Signed-off-by: John Wei <john.wei@mediatek.com>
---
 include/media/v4l2-subdev.h |   25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 30ec011..f603831 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -308,15 +308,38 @@ struct v4l2_subdev_audio_ops {
 	int (*s_stream)(struct v4l2_subdev *sd, int enable);
 };
 
+enum v4l2_mbus_csi2_user_defined_data_desc {
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_NONE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_Y_HIST,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_AE_HIST,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_FLICKER,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_GYRO,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_PDAF_PIXEL,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_PDAF_DIFF,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_LE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_ME,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SSE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SSSE,
+};
+
 /**
  * struct v4l2_mbus_frame_desc_entry_csi2
  *
  * @channel: CSI-2 virtual channel
  * @data_type: CSI-2 data type ID
+ * @enable: enable this data identifier
+ * @hsize: horizontal size
+ * @vsize: vertical size
+ * @user_data_desc: the description of user defined data
  */
 struct v4l2_mbus_frame_desc_entry_csi2 {
 	u8 channel;
 	u8 data_type;
+	u8 enable;
+	u16 hsize;
+	u16 vsize;
+	enum v4l2_mbus_csi2_user_defined_data_desc user_data_desc;
 };
 
 /**
@@ -354,7 +377,7 @@ struct v4l2_mbus_frame_desc_entry {
 	} bus;
 };
 
-#define V4L2_FRAME_DESC_ENTRY_MAX	4
+#define V4L2_FRAME_DESC_ENTRY_MAX	8
 
 enum v4l2_mbus_frame_desc_type {
 	V4L2_MBUS_FRAME_DESC_TYPE_PLATFORM,
-- 
1.7.9.5
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [RFC PATCH V0 1/2] media: v4l2: Add fields to frame descriptors
@ 2021-05-07  2:53   ` john.wei
  0 siblings, 0 replies; 12+ messages in thread
From: john.wei @ 2021-05-07  2:53 UTC (permalink / raw)
  To: john.wei, louis.kuo, mchehab, matthias.bgg
  Cc: linux-media, linux-kernel, linux-arm-kernel, linux-mediatek,
	wsd_upstream

From: John Wei <john.wei@mediatek.com>

Add enable, hsize, vsize, user_data_desc to frame descriptors

This patch is derived from following patches
https://patchwork.kernel.org/patch/10875875/
https://patchwork.kernel.org/patch/10875869/

Signed-off-by: John Wei <john.wei@mediatek.com>
---
 include/media/v4l2-subdev.h |   25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 30ec011..f603831 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -308,15 +308,38 @@ struct v4l2_subdev_audio_ops {
 	int (*s_stream)(struct v4l2_subdev *sd, int enable);
 };
 
+enum v4l2_mbus_csi2_user_defined_data_desc {
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_NONE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_Y_HIST,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_AE_HIST,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_FLICKER,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_GYRO,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_PDAF_PIXEL,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_PDAF_DIFF,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_LE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_ME,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SSE,
+	V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SSSE,
+};
+
 /**
  * struct v4l2_mbus_frame_desc_entry_csi2
  *
  * @channel: CSI-2 virtual channel
  * @data_type: CSI-2 data type ID
+ * @enable: enable this data identifier
+ * @hsize: horizontal size
+ * @vsize: vertical size
+ * @user_data_desc: the description of user defined data
  */
 struct v4l2_mbus_frame_desc_entry_csi2 {
 	u8 channel;
 	u8 data_type;
+	u8 enable;
+	u16 hsize;
+	u16 vsize;
+	enum v4l2_mbus_csi2_user_defined_data_desc user_data_desc;
 };
 
 /**
@@ -354,7 +377,7 @@ struct v4l2_mbus_frame_desc_entry {
 	} bus;
 };
 
-#define V4L2_FRAME_DESC_ENTRY_MAX	4
+#define V4L2_FRAME_DESC_ENTRY_MAX	8
 
 enum v4l2_mbus_frame_desc_type {
 	V4L2_MBUS_FRAME_DESC_TYPE_PLATFORM,
-- 
1.7.9.5
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [RFC PATCH V0 2/2] media: v4l2-ctrl: Add user defined base for ISP user control
  2021-05-07  2:53 ` john.wei
  (?)
@ 2021-05-07  2:53   ` john.wei
  -1 siblings, 0 replies; 12+ messages in thread
From: john.wei @ 2021-05-07  2:53 UTC (permalink / raw)
  To: john.wei, louis.kuo, mchehab, matthias.bgg
  Cc: linux-media, linux-kernel, linux-arm-kernel, linux-mediatek,
	wsd_upstream

From: John Wei <john.wei@mediatek.com>

This patch is to add V4L2_CID_USER_SENINF_BASE and
V4L2_CID_USER_MTK_SENSOR_BASE for Mediatek ISP-only features

Signed-off-by: John Wei <john.wei@mediatek.com>
---
 include/uapi/linux/v4l2-controls.h |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index d43bec5..2bcde70 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -211,6 +211,16 @@ enum v4l2_colorfx {
  */
 #define V4L2_CID_USER_CCS_BASE			(V4L2_CID_USER_BASE + 0x10f0)
 
+/* The base for the mediatek sensor driver controls
+ * We reserve 64 controls for this driver.
+ */
+#define V4L2_CID_USER_MTK_SENSOR_BASE		(V4L2_CID_USER_BASE + 0x1100)
+
+/* The base for the mediatek sensor driver controls
+ * We reserve 64 controls for this driver.
+ */
+#define V4L2_CID_USER_MTK_SENINF_BASE		(V4L2_CID_USER_BASE + 0x1140)
+
 /* MPEG-class control IDs */
 /* The MPEG controls are applicable to all codec controls
  * and the 'MPEG' part of the define is historical */
-- 
1.7.9.5


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

* [RFC PATCH V0 2/2] media: v4l2-ctrl: Add user defined base for ISP user control
@ 2021-05-07  2:53   ` john.wei
  0 siblings, 0 replies; 12+ messages in thread
From: john.wei @ 2021-05-07  2:53 UTC (permalink / raw)
  To: john.wei, louis.kuo, mchehab, matthias.bgg
  Cc: linux-media, linux-kernel, linux-arm-kernel, linux-mediatek,
	wsd_upstream

From: John Wei <john.wei@mediatek.com>

This patch is to add V4L2_CID_USER_SENINF_BASE and
V4L2_CID_USER_MTK_SENSOR_BASE for Mediatek ISP-only features

Signed-off-by: John Wei <john.wei@mediatek.com>
---
 include/uapi/linux/v4l2-controls.h |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index d43bec5..2bcde70 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -211,6 +211,16 @@ enum v4l2_colorfx {
  */
 #define V4L2_CID_USER_CCS_BASE			(V4L2_CID_USER_BASE + 0x10f0)
 
+/* The base for the mediatek sensor driver controls
+ * We reserve 64 controls for this driver.
+ */
+#define V4L2_CID_USER_MTK_SENSOR_BASE		(V4L2_CID_USER_BASE + 0x1100)
+
+/* The base for the mediatek sensor driver controls
+ * We reserve 64 controls for this driver.
+ */
+#define V4L2_CID_USER_MTK_SENINF_BASE		(V4L2_CID_USER_BASE + 0x1140)
+
 /* MPEG-class control IDs */
 /* The MPEG controls are applicable to all codec controls
  * and the 'MPEG' part of the define is historical */
-- 
1.7.9.5
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [RFC PATCH V0 2/2] media: v4l2-ctrl: Add user defined base for ISP user control
@ 2021-05-07  2:53   ` john.wei
  0 siblings, 0 replies; 12+ messages in thread
From: john.wei @ 2021-05-07  2:53 UTC (permalink / raw)
  To: john.wei, louis.kuo, mchehab, matthias.bgg
  Cc: linux-media, linux-kernel, linux-arm-kernel, linux-mediatek,
	wsd_upstream

From: John Wei <john.wei@mediatek.com>

This patch is to add V4L2_CID_USER_SENINF_BASE and
V4L2_CID_USER_MTK_SENSOR_BASE for Mediatek ISP-only features

Signed-off-by: John Wei <john.wei@mediatek.com>
---
 include/uapi/linux/v4l2-controls.h |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index d43bec5..2bcde70 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -211,6 +211,16 @@ enum v4l2_colorfx {
  */
 #define V4L2_CID_USER_CCS_BASE			(V4L2_CID_USER_BASE + 0x10f0)
 
+/* The base for the mediatek sensor driver controls
+ * We reserve 64 controls for this driver.
+ */
+#define V4L2_CID_USER_MTK_SENSOR_BASE		(V4L2_CID_USER_BASE + 0x1100)
+
+/* The base for the mediatek sensor driver controls
+ * We reserve 64 controls for this driver.
+ */
+#define V4L2_CID_USER_MTK_SENINF_BASE		(V4L2_CID_USER_BASE + 0x1140)
+
 /* MPEG-class control IDs */
 /* The MPEG controls are applicable to all codec controls
  * and the 'MPEG' part of the define is historical */
-- 
1.7.9.5
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [RFC PATCH V0 0/2] media: v4l2: extend framework to support advanced feature of Mediatek Camsys driver
  2021-05-07  2:53 ` john.wei
  (?)
@ 2021-05-07  9:38   ` Sakari Ailus
  -1 siblings, 0 replies; 12+ messages in thread
From: Sakari Ailus @ 2021-05-07  9:38 UTC (permalink / raw)
  To: john.wei
  Cc: louis.kuo, mchehab, matthias.bgg, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek, wsd_upstream, Tomi Valkeinen

Hi John,

On Fri, May 07, 2021 at 10:53:35AM +0800, john.wei@mediatek.com wrote:
> Hello,
> 
> This is the first version of the RFC patch series to v4l2 and media framework
> to support virtual channel (an advanced feature of MIPI CSI). Virtual channel
> was used commonly among modern image sensor. It was used to transfer
> metadata of an image such as statistical data of AE or AF.Some advanced
> features of camera such as HDR (High dynamic range), PDAF (Phase Detection
> Auto Focus) were achieved by virtual channel. Medaitek made some modification
> to frame descriptor based on https://patchwork.kernel.org/patch/10875875/ and
> https://patchwork.kernel.org/patch/10875875/.We extend the struct
> v4l2_mbus_frame_desc_entry by add enable, hsize, vsize and user_data_desc.
> With this modification, frame descriptor are now more powerful to meet all
> kinds of need among different applications. Here is an example that we use
> frame descriptor to describe all data streams in a frame output by a
>  stagger sensor.

Thanks for your e-mail.

Work has been done to address the problem area previously but it hasn't
reached upstream yet.

Tomi Valkeinen has posted a set here:

<https://lore.kernel.org/linux-media/20210427124523.990938-1-tomi.valkeinen@ideasonboard.com/>

Cc Tomi as well.

> 
> static struct v4l2_mbus_frame_desc_entry frame_desc_cus1[] = {
>         {
>                 .bus.csi2 = {
>                         .channel = 0,
>                         .data_type = 0x2b,
>                         .enable = 1,
>                         .hsize = 0xF00,
>                         .vsize = 0x870,
>                         .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_LE,
>                 },
>         },
>         {
>                 .bus.csi2 = {
>                         .channel = 1,
>                         .data_type = 0x2b,
>                         .enable = 1,
>                         .hsize = 0xF00,
>                         .vsize = 0x870,
>                         .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SE,
>                 },
>         },
> };
> 
> The first data stream, data for long exposure was transfer by channel 0 with
> data type 0x2b and the resolution was 0xF00 by horizontal and 0x870 by vertical.
> The second data stream, data for short exposure was transfer by channel 1
> with data type 0x2b and the resolution was also 0xF00 by horizontal and 0x870
> by vertical. Both long exposure and short exposure data will be fused in ISP
> stage to output a HDR image.
> 
>   media: v4l2: Add fields to frame descriptors
>   media: v4l2-ctrl: Add user defined base for ISP user control
> 
>  include/media/v4l2-subdev.h        |   25 ++++++++++++++++++++++++-
>  include/uapi/linux/v4l2-controls.h |   10 ++++++++++
>  2 files changed, 34 insertions(+), 1 deletion(-)
> 

-- 
Kind regards,

Sakari Ailus

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

* Re: [RFC PATCH V0 0/2] media: v4l2: extend framework to support advanced feature of Mediatek Camsys driver
@ 2021-05-07  9:38   ` Sakari Ailus
  0 siblings, 0 replies; 12+ messages in thread
From: Sakari Ailus @ 2021-05-07  9:38 UTC (permalink / raw)
  To: john.wei
  Cc: louis.kuo, mchehab, matthias.bgg, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek, wsd_upstream, Tomi Valkeinen

Hi John,

On Fri, May 07, 2021 at 10:53:35AM +0800, john.wei@mediatek.com wrote:
> Hello,
> 
> This is the first version of the RFC patch series to v4l2 and media framework
> to support virtual channel (an advanced feature of MIPI CSI). Virtual channel
> was used commonly among modern image sensor. It was used to transfer
> metadata of an image such as statistical data of AE or AF.Some advanced
> features of camera such as HDR (High dynamic range), PDAF (Phase Detection
> Auto Focus) were achieved by virtual channel. Medaitek made some modification
> to frame descriptor based on https://patchwork.kernel.org/patch/10875875/ and
> https://patchwork.kernel.org/patch/10875875/.We extend the struct
> v4l2_mbus_frame_desc_entry by add enable, hsize, vsize and user_data_desc.
> With this modification, frame descriptor are now more powerful to meet all
> kinds of need among different applications. Here is an example that we use
> frame descriptor to describe all data streams in a frame output by a
>  stagger sensor.

Thanks for your e-mail.

Work has been done to address the problem area previously but it hasn't
reached upstream yet.

Tomi Valkeinen has posted a set here:

<https://lore.kernel.org/linux-media/20210427124523.990938-1-tomi.valkeinen@ideasonboard.com/>

Cc Tomi as well.

> 
> static struct v4l2_mbus_frame_desc_entry frame_desc_cus1[] = {
>         {
>                 .bus.csi2 = {
>                         .channel = 0,
>                         .data_type = 0x2b,
>                         .enable = 1,
>                         .hsize = 0xF00,
>                         .vsize = 0x870,
>                         .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_LE,
>                 },
>         },
>         {
>                 .bus.csi2 = {
>                         .channel = 1,
>                         .data_type = 0x2b,
>                         .enable = 1,
>                         .hsize = 0xF00,
>                         .vsize = 0x870,
>                         .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SE,
>                 },
>         },
> };
> 
> The first data stream, data for long exposure was transfer by channel 0 with
> data type 0x2b and the resolution was 0xF00 by horizontal and 0x870 by vertical.
> The second data stream, data for short exposure was transfer by channel 1
> with data type 0x2b and the resolution was also 0xF00 by horizontal and 0x870
> by vertical. Both long exposure and short exposure data will be fused in ISP
> stage to output a HDR image.
> 
>   media: v4l2: Add fields to frame descriptors
>   media: v4l2-ctrl: Add user defined base for ISP user control
> 
>  include/media/v4l2-subdev.h        |   25 ++++++++++++++++++++++++-
>  include/uapi/linux/v4l2-controls.h |   10 ++++++++++
>  2 files changed, 34 insertions(+), 1 deletion(-)
> 

-- 
Kind regards,

Sakari Ailus

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [RFC PATCH V0 0/2] media: v4l2: extend framework to support advanced feature of Mediatek Camsys driver
@ 2021-05-07  9:38   ` Sakari Ailus
  0 siblings, 0 replies; 12+ messages in thread
From: Sakari Ailus @ 2021-05-07  9:38 UTC (permalink / raw)
  To: john.wei
  Cc: louis.kuo, mchehab, matthias.bgg, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek, wsd_upstream, Tomi Valkeinen

Hi John,

On Fri, May 07, 2021 at 10:53:35AM +0800, john.wei@mediatek.com wrote:
> Hello,
> 
> This is the first version of the RFC patch series to v4l2 and media framework
> to support virtual channel (an advanced feature of MIPI CSI). Virtual channel
> was used commonly among modern image sensor. It was used to transfer
> metadata of an image such as statistical data of AE or AF.Some advanced
> features of camera such as HDR (High dynamic range), PDAF (Phase Detection
> Auto Focus) were achieved by virtual channel. Medaitek made some modification
> to frame descriptor based on https://patchwork.kernel.org/patch/10875875/ and
> https://patchwork.kernel.org/patch/10875875/.We extend the struct
> v4l2_mbus_frame_desc_entry by add enable, hsize, vsize and user_data_desc.
> With this modification, frame descriptor are now more powerful to meet all
> kinds of need among different applications. Here is an example that we use
> frame descriptor to describe all data streams in a frame output by a
>  stagger sensor.

Thanks for your e-mail.

Work has been done to address the problem area previously but it hasn't
reached upstream yet.

Tomi Valkeinen has posted a set here:

<https://lore.kernel.org/linux-media/20210427124523.990938-1-tomi.valkeinen@ideasonboard.com/>

Cc Tomi as well.

> 
> static struct v4l2_mbus_frame_desc_entry frame_desc_cus1[] = {
>         {
>                 .bus.csi2 = {
>                         .channel = 0,
>                         .data_type = 0x2b,
>                         .enable = 1,
>                         .hsize = 0xF00,
>                         .vsize = 0x870,
>                         .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_LE,
>                 },
>         },
>         {
>                 .bus.csi2 = {
>                         .channel = 1,
>                         .data_type = 0x2b,
>                         .enable = 1,
>                         .hsize = 0xF00,
>                         .vsize = 0x870,
>                         .user_data_desc = V4L2_MBUS_CSI2_USER_DEFINED_DATA_DESC_HDR_SE,
>                 },
>         },
> };
> 
> The first data stream, data for long exposure was transfer by channel 0 with
> data type 0x2b and the resolution was 0xF00 by horizontal and 0x870 by vertical.
> The second data stream, data for short exposure was transfer by channel 1
> with data type 0x2b and the resolution was also 0xF00 by horizontal and 0x870
> by vertical. Both long exposure and short exposure data will be fused in ISP
> stage to output a HDR image.
> 
>   media: v4l2: Add fields to frame descriptors
>   media: v4l2-ctrl: Add user defined base for ISP user control
> 
>  include/media/v4l2-subdev.h        |   25 ++++++++++++++++++++++++-
>  include/uapi/linux/v4l2-controls.h |   10 ++++++++++
>  2 files changed, 34 insertions(+), 1 deletion(-)
> 

-- 
Kind regards,

Sakari Ailus

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-05-07  9:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07  2:53 [RFC PATCH V0 0/2] media: v4l2: extend framework to support advanced feature of Mediatek Camsys driver john.wei
2021-05-07  2:53 ` john.wei
2021-05-07  2:53 ` john.wei
2021-05-07  2:53 ` [RFC PATCH V0 1/2] media: v4l2: Add fields to frame descriptors john.wei
2021-05-07  2:53   ` john.wei
2021-05-07  2:53   ` john.wei
2021-05-07  2:53 ` [RFC PATCH V0 2/2] media: v4l2-ctrl: Add user defined base for ISP user control john.wei
2021-05-07  2:53   ` john.wei
2021-05-07  2:53   ` john.wei
2021-05-07  9:38 ` [RFC PATCH V0 0/2] media: v4l2: extend framework to support advanced feature of Mediatek Camsys driver Sakari Ailus
2021-05-07  9:38   ` Sakari Ailus
2021-05-07  9:38   ` Sakari Ailus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.