clear-pkgs-linux-iot-lts2018/0054-v4l-Extend-struct-v4l2...

106 lines
3.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Meng Wei <wei.meng@intel.com>
Date: Fri, 26 Oct 2018 09:52:40 +0800
Subject: [PATCH] v4l: Extend struct v4l2_mbus_frame_desc_entry
Add bus type to frame descriptors
Add bpp fields and bus-specific information (CSI-2).
Add information for 2D DMA to the frame descriptor entries
Signed-off-by: Chang Ying <ying.chang@intel.com>
Signed-off-by: Meng Wei <wei.meng@intel.com>
---
include/media/v4l2-subdev.h | 53 +++++++++++++++++++++++++++++++------
1 file changed, 45 insertions(+), 8 deletions(-)
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 4bd777a68d64..889deab36029 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -332,29 +332,66 @@ enum v4l2_mbus_frame_desc_flags {
V4L2_MBUS_FRAME_DESC_FL_BLOB = BIT(1),
};
+/**
+ * struct v4l2_mbus_frame_desc_entry_csi2
+ *
+ * @channel: CSI-2 virtual channel
+ * @data_type: CSI-2 data type ID
+ */
+struct v4l2_mbus_frame_desc_entry_csi2 {
+ u8 channel;
+ u8 data_type;
+};
+
/**
* struct v4l2_mbus_frame_desc_entry - media bus frame description structure
*
- * @flags: bitmask flags, as defined by &enum v4l2_mbus_frame_desc_flags.
- * @pixelcode: media bus pixel code, valid if @flags
- * %FRAME_DESC_FL_BLOB is not set.
- * @length: number of octets per frame, valid if @flags
- * %V4L2_MBUS_FRAME_DESC_FL_LEN_MAX is set.
+ * @flags: V4L2_MBUS_FRAME_DESC_FL_* flags
+ * @bpp: bits per pixel
+ * @pixelcode: media bus pixel code, valid if FRAME_DESC_FL_BLOB is not set
+ * @start_line: start line of the data for 2D DMA
+ * @start_pixel: start pixel of the data for 2D DMA
+ * @width: image width for 2D DMA
+ * @height: image height for 2D DMA
+ * @length: number of octets per frame, valid if V4L2_MBUS_FRAME_DESC_FL_BLOB
+ * is set
+ * @csi2: CSI-2 specific bus configuration
*/
struct v4l2_mbus_frame_desc_entry {
- enum v4l2_mbus_frame_desc_flags flags;
+ u16 flags;
+ u8 bpp;
u32 pixelcode;
- u32 length;
+ union {
+ struct {
+ u16 start_line;
+ u16 start_pixel;
+ u16 width;
+ u16 height;
+ } two_dim;
+ u32 length;
+ };
+ union {
+ struct v4l2_mbus_frame_desc_entry_csi2 csi2;
+ } bus;
+};
+
+enum {
+ V4L2_MBUS_FRAME_DESC_TYPE_PLATFORM,
+ V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL,
+ V4L2_MBUS_FRAME_DESC_TYPE_CCP2,
+ V4L2_MBUS_FRAME_DESC_TYPE_CSI2,
};
#define V4L2_FRAME_DESC_ENTRY_MAX 4
/**
* struct v4l2_mbus_frame_desc - media bus data frame description
+ * @type: type of the bus (V4L2_MBUS_FRAME_DESC_TYPE_*)
* @entry: frame descriptors array
* @num_entries: number of entries in @entry array
*/
struct v4l2_mbus_frame_desc {
+ u32 type;
struct v4l2_mbus_frame_desc_entry entry[V4L2_FRAME_DESC_ENTRY_MAX];
unsigned short num_entries;
};
@@ -783,7 +820,7 @@ struct v4l2_subdev_internal_ops {
/* Set this flag if this subdev generates events. */
#define V4L2_SUBDEV_FL_HAS_EVENTS (1U << 3)
/* Set this flag if this sub-device supports substreams. */
-#define V4L2_SUBDEV_FL_HAS_SUBSTREAMS (1U << 4)
+#define V4L2_SUBDEV_FL_HAS_SUBSTREAMS (1U << 4)
struct regulator_bulk_data;
--
https://clearlinux.org