diff options
Diffstat (limited to 'drivers/staging/media/ipu3/ipu3.h')
-rw-r--r-- | drivers/staging/media/ipu3/ipu3.h | 56 |
1 files changed, 36 insertions, 20 deletions
diff --git a/drivers/staging/media/ipu3/ipu3.h b/drivers/staging/media/ipu3/ipu3.h index 2e0c756a9e65..04fc99f47ebb 100644 --- a/drivers/staging/media/ipu3/ipu3.h +++ b/drivers/staging/media/ipu3/ipu3.h @@ -7,6 +7,7 @@ #include <linux/iova.h> #include <linux/pci.h> +#include <media/v4l2-ctrls.h> #include <media/v4l2-device.h> #include <media/videobuf2-dma-sg.h> @@ -28,9 +29,8 @@ #define IMGU_NODE_PARAMS 1 /* Input parameters */ #define IMGU_NODE_OUT 2 /* Main output for still or video */ #define IMGU_NODE_VF 3 /* Preview */ -#define IMGU_NODE_PV 4 /* Postview for still capture */ -#define IMGU_NODE_STAT_3A 5 /* 3A statistics */ -#define IMGU_NODE_NUM 6 +#define IMGU_NODE_STAT_3A 4 /* 3A statistics */ +#define IMGU_NODE_NUM 5 #define file_to_intel_ipu3_node(__file) \ container_of(video_devdata(__file), struct imgu_video_device, vdev) @@ -71,7 +71,6 @@ struct imgu_node_mapping { struct imgu_video_device { const char *name; bool output; - bool immutable; /* Can not be enabled/disabled */ bool enabled; struct v4l2_format vdev_fmt; /* Currently set format */ @@ -84,14 +83,27 @@ struct imgu_video_device { /* Protect vb2_queue and vdev structs*/ struct mutex lock; atomic_t sequence; + unsigned int id; + unsigned int pipe; }; -/* - * imgu_device -- ImgU (Imaging Unit) driver - */ -struct imgu_device { - struct pci_dev *pci_dev; - void __iomem *base; +struct imgu_v4l2_subdev { + unsigned int pipe; + struct v4l2_subdev subdev; + struct media_pad subdev_pads[IMGU_NODE_NUM]; + struct { + struct v4l2_rect eff; /* effective resolution */ + struct v4l2_rect bds; /* bayer-domain scaled resolution*/ + struct v4l2_rect gdc; /* gdc output resolution */ + } rect; + struct v4l2_ctrl_handler ctrl_handler; + struct v4l2_ctrl *ctrl; + atomic_t running_mode; + bool active; +}; + +struct imgu_media_pipe { + unsigned int pipe; /* Internally enabled queues */ struct { @@ -100,18 +112,26 @@ struct imgu_device { } queues[IPU3_CSS_QUEUES]; struct imgu_video_device nodes[IMGU_NODE_NUM]; bool queue_enabled[IMGU_NODE_NUM]; + struct media_pipeline pipeline; + struct imgu_v4l2_subdev imgu_sd; +}; + +/* + * imgu_device -- ImgU (Imaging Unit) driver + */ +struct imgu_device { + struct pci_dev *pci_dev; + void __iomem *base; /* Public fields, fill before registering */ unsigned int buf_struct_size; bool streaming; /* Public read only */ - struct v4l2_ctrl_handler *ctrl_handler; + + struct imgu_media_pipe imgu_pipe[IMGU_MAX_PIPE_NUM]; /* Private fields */ struct v4l2_device v4l2_dev; struct media_device media_dev; - struct media_pipeline pipeline; - struct v4l2_subdev subdev; - struct media_pad subdev_pads[IMGU_NODE_NUM]; struct v4l2_file_operations v4l2_file_ops; /* MMU driver for css */ @@ -128,11 +148,6 @@ struct imgu_device { struct mutex lock; /* Forbit streaming and buffer queuing during system suspend. */ atomic_t qbuf_barrier; - struct { - struct v4l2_rect eff; /* effective resolution */ - struct v4l2_rect bds; /* bayer-domain scaled resolution*/ - struct v4l2_rect gdc; /* gdc output resolution */ - } rect; /* Indicate if system suspend take place while imgu is streaming. */ bool suspend_in_stream; /* Used to wait for FW buffer queue drain. */ @@ -141,7 +156,8 @@ struct imgu_device { unsigned int imgu_node_to_queue(unsigned int node); unsigned int imgu_map_node(struct imgu_device *imgu, unsigned int css_queue); -int imgu_queue_buffers(struct imgu_device *imgu, bool initial); +int imgu_queue_buffers(struct imgu_device *imgu, bool initial, + unsigned int pipe); int imgu_v4l2_register(struct imgu_device *dev); int imgu_v4l2_unregister(struct imgu_device *dev); |