.. | .. |
---|
14 | 14 | #include <linux/videodev2.h> |
---|
15 | 15 | #include <linux/slab.h> |
---|
16 | 16 | |
---|
17 | | -#include <media/videobuf-dma-contig.h> |
---|
18 | 17 | #include <media/v4l2-device.h> |
---|
19 | 18 | |
---|
20 | 19 | #include <video/omapvrfb.h> |
---|
.. | .. |
---|
40 | 39 | &vout->smsshado_phy_addr[i]); |
---|
41 | 40 | } |
---|
42 | 41 | if (!vout->smsshado_virt_addr[i] && startindex != -1) { |
---|
43 | | - if (V4L2_MEMORY_MMAP == vout->memory && i >= startindex) |
---|
| 42 | + if (vout->vq.memory == V4L2_MEMORY_MMAP && i >= startindex) |
---|
44 | 43 | break; |
---|
45 | 44 | } |
---|
46 | 45 | if (!vout->smsshado_virt_addr[i]) { |
---|
.. | .. |
---|
109 | 108 | dev_info(&pdev->dev, ": VRFB allocation failed\n"); |
---|
110 | 109 | for (j = 0; j < i; j++) |
---|
111 | 110 | omap_vrfb_release_ctx(&vout->vrfb_context[j]); |
---|
112 | | - ret = -ENOMEM; |
---|
113 | | - goto free_buffers; |
---|
| 111 | + return -ENOMEM; |
---|
114 | 112 | } |
---|
115 | 113 | } |
---|
116 | 114 | |
---|
.. | .. |
---|
155 | 153 | |
---|
156 | 154 | init_waitqueue_head(&vout->vrfb_dma_tx.wait); |
---|
157 | 155 | |
---|
158 | | - /* statically allocated the VRFB buffer is done through |
---|
159 | | - commands line aruments */ |
---|
| 156 | + /* |
---|
| 157 | + * statically allocated the VRFB buffer is done through |
---|
| 158 | + * command line arguments |
---|
| 159 | + */ |
---|
160 | 160 | if (static_vrfb_allocation) { |
---|
161 | 161 | if (omap_vout_allocate_vrfb_buffers(vout, &vrfb_num_bufs, -1)) { |
---|
162 | 162 | ret = -ENOMEM; |
---|
.. | .. |
---|
169 | 169 | release_vrfb_ctx: |
---|
170 | 170 | for (j = 0; j < VRFB_NUM_BUFS; j++) |
---|
171 | 171 | omap_vrfb_release_ctx(&vout->vrfb_context[j]); |
---|
172 | | -free_buffers: |
---|
173 | | - omap_vout_free_buffers(vout); |
---|
174 | | - |
---|
175 | 172 | return ret; |
---|
176 | 173 | } |
---|
177 | 174 | |
---|
.. | .. |
---|
231 | 228 | } |
---|
232 | 229 | |
---|
233 | 230 | int omap_vout_prepare_vrfb(struct omap_vout_device *vout, |
---|
234 | | - struct videobuf_buffer *vb) |
---|
| 231 | + struct vb2_buffer *vb) |
---|
235 | 232 | { |
---|
236 | 233 | struct dma_async_tx_descriptor *tx; |
---|
237 | 234 | enum dma_ctrl_flags flags = DMA_PREP_INTERRUPT | DMA_CTRL_ACK; |
---|
238 | 235 | struct dma_chan *chan = vout->vrfb_dma_tx.chan; |
---|
239 | 236 | struct dma_interleaved_template *xt = vout->vrfb_dma_tx.xt; |
---|
240 | 237 | dma_cookie_t cookie; |
---|
| 238 | + dma_addr_t buf_phy_addr = vb2_dma_contig_plane_dma_addr(vb, 0); |
---|
241 | 239 | enum dma_status status; |
---|
242 | 240 | enum dss_rotation rotation; |
---|
243 | 241 | size_t dst_icg; |
---|
.. | .. |
---|
255 | 253 | pixsize = vout->bpp * vout->vrfb_bpp; |
---|
256 | 254 | dst_icg = MAX_PIXELS_PER_LINE * pixsize - vout->pix.width * vout->bpp; |
---|
257 | 255 | |
---|
258 | | - xt->src_start = vout->buf_phy_addr[vb->i]; |
---|
259 | | - xt->dst_start = vout->vrfb_context[vb->i].paddr[0]; |
---|
| 256 | + xt->src_start = buf_phy_addr; |
---|
| 257 | + xt->dst_start = vout->vrfb_context[vb->index].paddr[0]; |
---|
260 | 258 | |
---|
261 | 259 | xt->numf = vout->pix.height; |
---|
262 | 260 | xt->frame_size = 1; |
---|
.. | .. |
---|
307 | 305 | /* Store buffers physical address into an array. Addresses |
---|
308 | 306 | * from this array will be used to configure DSS */ |
---|
309 | 307 | rotation = calc_rotation(vout); |
---|
310 | | - vout->queued_buf_addr[vb->i] = (u8 *) |
---|
311 | | - vout->vrfb_context[vb->i].paddr[rotation]; |
---|
| 308 | + vout->queued_buf_addr[vb->index] = (u8 *) |
---|
| 309 | + vout->vrfb_context[vb->index].paddr[rotation]; |
---|
312 | 310 | return 0; |
---|
313 | 311 | } |
---|
314 | 312 | |
---|