.. | .. |
---|
11 | 11 | #ifndef OMAP_VOUTDEF_H |
---|
12 | 12 | #define OMAP_VOUTDEF_H |
---|
13 | 13 | |
---|
| 14 | +#include <media/videobuf2-dma-contig.h> |
---|
14 | 15 | #include <media/v4l2-ctrls.h> |
---|
15 | 16 | #include <video/omapfb_dss.h> |
---|
16 | 17 | #include <video/omapvrfb.h> |
---|
.. | .. |
---|
37 | 38 | #define VID_MAX_WIDTH 1280 /* Largest width */ |
---|
38 | 39 | #define VID_MAX_HEIGHT 720 /* Largest height */ |
---|
39 | 40 | |
---|
40 | | -/* Mimimum requirement is 2x2 for DSS */ |
---|
| 41 | +/* Minimum requirement is 2x2 for DSS */ |
---|
41 | 42 | #define VID_MIN_WIDTH 2 |
---|
42 | 43 | #define VID_MIN_HEIGHT 2 |
---|
43 | 44 | |
---|
.. | .. |
---|
113 | 114 | struct omap_overlay_manager *managers[MAX_MANAGERS]; |
---|
114 | 115 | }; |
---|
115 | 116 | |
---|
| 117 | +/* buffer for one video frame */ |
---|
| 118 | +struct omap_vout_buffer { |
---|
| 119 | + /* common v4l buffer stuff -- must be first */ |
---|
| 120 | + struct vb2_v4l2_buffer vbuf; |
---|
| 121 | + struct list_head queue; |
---|
| 122 | +}; |
---|
| 123 | + |
---|
| 124 | +static inline struct omap_vout_buffer *vb2_to_omap_vout_buffer(struct vb2_buffer *vb) |
---|
| 125 | +{ |
---|
| 126 | + struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); |
---|
| 127 | + |
---|
| 128 | + return container_of(vbuf, struct omap_vout_buffer, vbuf); |
---|
| 129 | +} |
---|
| 130 | + |
---|
116 | 131 | /* per-device data structure */ |
---|
117 | 132 | struct omap_vout_device { |
---|
118 | 133 | |
---|
.. | .. |
---|
121 | 136 | struct omap2video_device *vid_dev; |
---|
122 | 137 | struct v4l2_ctrl_handler ctrl_handler; |
---|
123 | 138 | int vid; |
---|
124 | | - int opened; |
---|
125 | 139 | |
---|
126 | | - /* we don't allow to change image fmt/size once buffer has |
---|
127 | | - * been allocated |
---|
128 | | - */ |
---|
129 | | - int buffer_allocated; |
---|
130 | 140 | /* allow to reuse previously allocated buffer which is big enough */ |
---|
131 | 141 | int buffer_size; |
---|
132 | | - /* keep buffer info across opens */ |
---|
133 | | - unsigned long buf_virt_addr[VIDEO_MAX_FRAME]; |
---|
134 | | - unsigned long buf_phy_addr[VIDEO_MAX_FRAME]; |
---|
135 | 142 | enum omap_color_mode dss_mode; |
---|
136 | 143 | |
---|
137 | | - /* we don't allow to request new buffer when old buffers are |
---|
138 | | - * still mmaped |
---|
139 | | - */ |
---|
140 | | - int mmap_count; |
---|
141 | | - |
---|
142 | | - spinlock_t vbq_lock; /* spinlock for videobuf queues */ |
---|
143 | | - unsigned long field_count; /* field counter for videobuf_buffer */ |
---|
144 | | - |
---|
145 | | - /* non-NULL means streaming is in progress. */ |
---|
146 | | - bool streaming; |
---|
| 144 | + u32 sequence; |
---|
147 | 145 | |
---|
148 | 146 | struct v4l2_pix_format pix; |
---|
149 | 147 | struct v4l2_rect crop; |
---|
.. | .. |
---|
169 | 167 | unsigned char pos; |
---|
170 | 168 | |
---|
171 | 169 | int ps, vr_ps, line_length, first_int, field_id; |
---|
172 | | - enum v4l2_memory memory; |
---|
173 | | - struct videobuf_buffer *cur_frm, *next_frm; |
---|
| 170 | + struct omap_vout_buffer *cur_frm, *next_frm; |
---|
| 171 | + spinlock_t vbq_lock; /* spinlock for dma_queue */ |
---|
174 | 172 | struct list_head dma_queue; |
---|
175 | 173 | u8 *queued_buf_addr[VIDEO_MAX_FRAME]; |
---|
176 | 174 | u32 cropped_offset; |
---|
177 | 175 | s32 tv_field1_offset; |
---|
178 | 176 | void *isr_handle; |
---|
179 | | - |
---|
180 | | - /* Buffer queue variables */ |
---|
181 | | - struct omap_vout_device *vout; |
---|
182 | | - enum v4l2_buf_type type; |
---|
183 | | - struct videobuf_queue vbq; |
---|
184 | | - int io_allowed; |
---|
| 177 | + struct vb2_queue vq; |
---|
185 | 178 | |
---|
186 | 179 | }; |
---|
187 | 180 | |
---|