This source file includes following definitions.
- isp_pipeline_ready
1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef OMAP3_ISP_VIDEO_H
14 #define OMAP3_ISP_VIDEO_H
15
16 #include <linux/v4l2-mediabus.h>
17 #include <media/media-entity.h>
18 #include <media/v4l2-dev.h>
19 #include <media/v4l2-fh.h>
20 #include <media/videobuf2-v4l2.h>
21
22 #define ISP_VIDEO_DRIVER_NAME "ispvideo"
23 #define ISP_VIDEO_DRIVER_VERSION "0.0.2"
24
25 struct isp_device;
26 struct isp_video;
27 struct v4l2_mbus_framefmt;
28 struct v4l2_pix_format;
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 struct isp_format_info {
44 u32 code;
45 u32 truncated;
46 u32 uncompressed;
47 u32 flavor;
48 u32 pixelformat;
49 unsigned int width;
50 unsigned int bpp;
51 };
52
53 enum isp_pipeline_stream_state {
54 ISP_PIPELINE_STREAM_STOPPED = 0,
55 ISP_PIPELINE_STREAM_CONTINUOUS = 1,
56 ISP_PIPELINE_STREAM_SINGLESHOT = 2,
57 };
58
59 enum isp_pipeline_state {
60
61 ISP_PIPELINE_STREAM_INPUT = 1,
62
63 ISP_PIPELINE_STREAM_OUTPUT = 2,
64
65 ISP_PIPELINE_QUEUE_INPUT = 4,
66
67 ISP_PIPELINE_QUEUE_OUTPUT = 8,
68
69 ISP_PIPELINE_IDLE_INPUT = 16,
70
71 ISP_PIPELINE_IDLE_OUTPUT = 32,
72
73 ISP_PIPELINE_STREAM = 64,
74 };
75
76
77
78
79
80
81
82 struct isp_pipeline {
83 struct media_pipeline pipe;
84 spinlock_t lock;
85 unsigned int state;
86 enum isp_pipeline_stream_state stream_state;
87 struct isp_video *input;
88 struct isp_video *output;
89 struct media_entity_enum ent_enum;
90 unsigned long l3_ick;
91 unsigned int max_rate;
92 enum v4l2_field field;
93 atomic_t frame_number;
94 bool do_propagation;
95 bool error;
96 struct v4l2_fract max_timeperframe;
97 struct v4l2_subdev *external;
98 unsigned int external_rate;
99 unsigned int external_width;
100 };
101
102 #define to_isp_pipeline(__e) \
103 container_of((__e)->pipe, struct isp_pipeline, pipe)
104
105 static inline int isp_pipeline_ready(struct isp_pipeline *pipe)
106 {
107 return pipe->state == (ISP_PIPELINE_STREAM_INPUT |
108 ISP_PIPELINE_STREAM_OUTPUT |
109 ISP_PIPELINE_QUEUE_INPUT |
110 ISP_PIPELINE_QUEUE_OUTPUT |
111 ISP_PIPELINE_IDLE_INPUT |
112 ISP_PIPELINE_IDLE_OUTPUT);
113 }
114
115
116
117
118
119
120
121 struct isp_buffer {
122 struct vb2_v4l2_buffer vb;
123 struct list_head irqlist;
124 dma_addr_t dma;
125 };
126
127 #define to_isp_buffer(buf) container_of(buf, struct isp_buffer, vb)
128
129 enum isp_video_dmaqueue_flags {
130
131 ISP_VIDEO_DMAQUEUE_UNDERRUN = (1 << 0),
132
133 ISP_VIDEO_DMAQUEUE_QUEUED = (1 << 1),
134 };
135
136 #define isp_video_dmaqueue_flags_clr(video) \
137 ({ (video)->dmaqueue_flags = 0; })
138
139
140
141
142
143
144 struct isp_video_operations {
145 int(*queue)(struct isp_video *video, struct isp_buffer *buffer);
146 };
147
148 struct isp_video {
149 struct video_device video;
150 enum v4l2_buf_type type;
151 struct media_pad pad;
152
153 struct mutex mutex;
154 atomic_t active;
155
156 struct isp_device *isp;
157
158 unsigned int capture_mem;
159 unsigned int bpl_alignment;
160 unsigned int bpl_zero_padding;
161 unsigned int bpl_max;
162 unsigned int bpl_value;
163 unsigned int bpl_padding;
164
165
166 struct isp_pipeline pipe;
167 struct mutex stream_lock;
168 bool error;
169
170
171 struct vb2_queue *queue;
172 struct mutex queue_lock;
173 spinlock_t irqlock;
174 struct list_head dmaqueue;
175 enum isp_video_dmaqueue_flags dmaqueue_flags;
176
177 const struct isp_video_operations *ops;
178 };
179
180 #define to_isp_video(vdev) container_of(vdev, struct isp_video, video)
181
182 struct isp_video_fh {
183 struct v4l2_fh vfh;
184 struct isp_video *video;
185 struct vb2_queue queue;
186 struct v4l2_format format;
187 struct v4l2_fract timeperframe;
188 };
189
190 #define to_isp_video_fh(fh) container_of(fh, struct isp_video_fh, vfh)
191 #define isp_video_queue_to_isp_video_fh(q) \
192 container_of(q, struct isp_video_fh, queue)
193
194 int omap3isp_video_init(struct isp_video *video, const char *name);
195 void omap3isp_video_cleanup(struct isp_video *video);
196 int omap3isp_video_register(struct isp_video *video,
197 struct v4l2_device *vdev);
198 void omap3isp_video_unregister(struct isp_video *video);
199 struct isp_buffer *omap3isp_video_buffer_next(struct isp_video *video);
200 void omap3isp_video_cancel_stream(struct isp_video *video);
201 void omap3isp_video_resume(struct isp_video *video, int continuous);
202 struct media_pad *omap3isp_video_remote_pad(struct isp_video *video);
203
204 const struct isp_format_info *
205 omap3isp_video_format_info(u32 code);
206
207 #endif