Lines Matching refs:vout
30 static int omap_vout_allocate_vrfb_buffers(struct omap_vout_device *vout, in omap_vout_allocate_vrfb_buffers() argument
36 if (!vout->smsshado_virt_addr[i]) { in omap_vout_allocate_vrfb_buffers()
37 vout->smsshado_virt_addr[i] = in omap_vout_allocate_vrfb_buffers()
38 omap_vout_alloc_buffer(vout->smsshado_size, in omap_vout_allocate_vrfb_buffers()
39 &vout->smsshado_phy_addr[i]); in omap_vout_allocate_vrfb_buffers()
41 if (!vout->smsshado_virt_addr[i] && startindex != -1) { in omap_vout_allocate_vrfb_buffers()
42 if (vout->vq.memory == V4L2_MEMORY_MMAP && i >= startindex) in omap_vout_allocate_vrfb_buffers()
45 if (!vout->smsshado_virt_addr[i]) { in omap_vout_allocate_vrfb_buffers()
48 vout->smsshado_virt_addr[j], in omap_vout_allocate_vrfb_buffers()
49 vout->smsshado_size); in omap_vout_allocate_vrfb_buffers()
50 vout->smsshado_virt_addr[j] = 0; in omap_vout_allocate_vrfb_buffers()
51 vout->smsshado_phy_addr[j] = 0; in omap_vout_allocate_vrfb_buffers()
56 memset((void *)(long)vout->smsshado_virt_addr[i], 0, in omap_vout_allocate_vrfb_buffers()
57 vout->smsshado_size); in omap_vout_allocate_vrfb_buffers()
76 void omap_vout_free_vrfb_buffers(struct omap_vout_device *vout) in omap_vout_free_vrfb_buffers() argument
81 if (vout->smsshado_virt_addr[j]) { in omap_vout_free_vrfb_buffers()
82 omap_vout_free_buffer(vout->smsshado_virt_addr[j], in omap_vout_free_vrfb_buffers()
83 vout->smsshado_size); in omap_vout_free_vrfb_buffers()
84 vout->smsshado_virt_addr[j] = 0; in omap_vout_free_vrfb_buffers()
85 vout->smsshado_phy_addr[j] = 0; in omap_vout_free_vrfb_buffers()
94 struct omap_vout_device *vout; in omap_vout_setup_vrfb_bufs() local
103 vout = vid_dev->vouts[vid_num]; in omap_vout_setup_vrfb_bufs()
104 vfd = vout->vfd; in omap_vout_setup_vrfb_bufs()
107 if (omap_vrfb_request_ctx(&vout->vrfb_context[i])) { in omap_vout_setup_vrfb_bufs()
110 omap_vrfb_release_ctx(&vout->vrfb_context[j]); in omap_vout_setup_vrfb_bufs()
128 vout->smsshado_size = PAGE_ALIGN(image_width * image_height * 2 * 2); in omap_vout_setup_vrfb_bufs()
135 vout->vrfb_dma_tx.chan = dma_request_chan_by_mask(&mask); in omap_vout_setup_vrfb_bufs()
136 if (IS_ERR(vout->vrfb_dma_tx.chan)) { in omap_vout_setup_vrfb_bufs()
137 vout->vrfb_dma_tx.req_status = DMA_CHAN_NOT_ALLOTED; in omap_vout_setup_vrfb_bufs()
142 vout->vrfb_dma_tx.xt = kzalloc(xt_size, GFP_KERNEL); in omap_vout_setup_vrfb_bufs()
143 if (!vout->vrfb_dma_tx.xt) { in omap_vout_setup_vrfb_bufs()
144 dma_release_channel(vout->vrfb_dma_tx.chan); in omap_vout_setup_vrfb_bufs()
145 vout->vrfb_dma_tx.req_status = DMA_CHAN_NOT_ALLOTED; in omap_vout_setup_vrfb_bufs()
149 if (vout->vrfb_dma_tx.req_status == DMA_CHAN_NOT_ALLOTED) in omap_vout_setup_vrfb_bufs()
154 init_waitqueue_head(&vout->vrfb_dma_tx.wait); in omap_vout_setup_vrfb_bufs()
161 if (omap_vout_allocate_vrfb_buffers(vout, &vrfb_num_bufs, -1)) { in omap_vout_setup_vrfb_bufs()
165 vout->vrfb_static_allocation = true; in omap_vout_setup_vrfb_bufs()
171 omap_vrfb_release_ctx(&vout->vrfb_context[j]); in omap_vout_setup_vrfb_bufs()
178 void omap_vout_release_vrfb(struct omap_vout_device *vout) in omap_vout_release_vrfb() argument
183 omap_vrfb_release_ctx(&vout->vrfb_context[i]); in omap_vout_release_vrfb()
185 if (vout->vrfb_dma_tx.req_status == DMA_CHAN_ALLOTED) { in omap_vout_release_vrfb()
186 vout->vrfb_dma_tx.req_status = DMA_CHAN_NOT_ALLOTED; in omap_vout_release_vrfb()
187 kfree(vout->vrfb_dma_tx.xt); in omap_vout_release_vrfb()
188 dmaengine_terminate_sync(vout->vrfb_dma_tx.chan); in omap_vout_release_vrfb()
189 dma_release_channel(vout->vrfb_dma_tx.chan); in omap_vout_release_vrfb()
197 int omap_vout_vrfb_buffer_setup(struct omap_vout_device *vout, in omap_vout_vrfb_buffer_setup() argument
203 if (!is_rotation_enabled(vout)) in omap_vout_vrfb_buffer_setup()
212 if (!vout->vrfb_static_allocation) in omap_vout_vrfb_buffer_setup()
213 if (omap_vout_allocate_vrfb_buffers(vout, count, startindex)) in omap_vout_vrfb_buffer_setup()
216 if (vout->dss_mode == OMAP_DSS_COLOR_YUV2 || in omap_vout_vrfb_buffer_setup()
217 vout->dss_mode == OMAP_DSS_COLOR_UYVY) in omap_vout_vrfb_buffer_setup()
223 omap_vrfb_setup(&vout->vrfb_context[i], in omap_vout_vrfb_buffer_setup()
224 vout->smsshado_phy_addr[i], vout->pix.width, in omap_vout_vrfb_buffer_setup()
225 vout->pix.height, vout->bpp, yuv_mode); in omap_vout_vrfb_buffer_setup()
230 int omap_vout_prepare_vrfb(struct omap_vout_device *vout, in omap_vout_prepare_vrfb() argument
235 struct dma_chan *chan = vout->vrfb_dma_tx.chan; in omap_vout_prepare_vrfb()
236 struct dma_interleaved_template *xt = vout->vrfb_dma_tx.xt; in omap_vout_prepare_vrfb()
244 if (!is_rotation_enabled(vout)) in omap_vout_prepare_vrfb()
253 pixsize = vout->bpp * vout->vrfb_bpp; in omap_vout_prepare_vrfb()
254 dst_icg = MAX_PIXELS_PER_LINE * pixsize - vout->pix.width * vout->bpp; in omap_vout_prepare_vrfb()
257 xt->dst_start = vout->vrfb_context[vb->index].paddr[0]; in omap_vout_prepare_vrfb()
259 xt->numf = vout->pix.height; in omap_vout_prepare_vrfb()
261 xt->sgl[0].size = vout->pix.width * vout->bpp; in omap_vout_prepare_vrfb()
277 tx->callback_param = &vout->vrfb_dma_tx; in omap_vout_prepare_vrfb()
285 vout->vrfb_dma_tx.tx_status = 0; in omap_vout_prepare_vrfb()
288 wait_event_interruptible_timeout(vout->vrfb_dma_tx.wait, in omap_vout_prepare_vrfb()
289 vout->vrfb_dma_tx.tx_status == 1, in omap_vout_prepare_vrfb()
294 if (vout->vrfb_dma_tx.tx_status == 0) { in omap_vout_prepare_vrfb()
307 rotation = calc_rotation(vout); in omap_vout_prepare_vrfb()
308 vout->queued_buf_addr[vb->index] = in omap_vout_prepare_vrfb()
309 vout->vrfb_context[vb->index].paddr[rotation]; in omap_vout_prepare_vrfb()
318 void omap_vout_calculate_vrfb_offset(struct omap_vout_device *vout) in omap_vout_calculate_vrfb_offset() argument
321 bool mirroring = vout->mirror; in omap_vout_calculate_vrfb_offset()
322 struct v4l2_rect *crop = &vout->crop; in omap_vout_calculate_vrfb_offset()
323 struct v4l2_pix_format *pix = &vout->pix; in omap_vout_calculate_vrfb_offset()
324 int *cropped_offset = &vout->cropped_offset; in omap_vout_calculate_vrfb_offset()
328 rotation = calc_rotation(vout); in omap_vout_calculate_vrfb_offset()
332 if (is_rotation_enabled(vout)) { in omap_vout_calculate_vrfb_offset()
349 vout->ps = ps; in omap_vout_calculate_vrfb_offset()
350 vout->vr_ps = vr_ps; in omap_vout_calculate_vrfb_offset()
352 if (is_rotation_enabled(vout)) { in omap_vout_calculate_vrfb_offset()
359 vout->line_length = line_length; in omap_vout_calculate_vrfb_offset()
362 offset = vout->vrfb_context[0].yoffset * in omap_vout_calculate_vrfb_offset()
363 vout->vrfb_context[0].bytespp; in omap_vout_calculate_vrfb_offset()
375 offset = ((MAX_PIXELS_PER_LINE * vout->vrfb_context[0].yoffset * in omap_vout_calculate_vrfb_offset()
376 vout->vrfb_context[0].bytespp) + in omap_vout_calculate_vrfb_offset()
377 (vout->vrfb_context[0].xoffset * in omap_vout_calculate_vrfb_offset()
378 vout->vrfb_context[0].bytespp)); in omap_vout_calculate_vrfb_offset()
390 offset = MAX_PIXELS_PER_LINE * vout->vrfb_context[0].xoffset * in omap_vout_calculate_vrfb_offset()
391 vout->vrfb_context[0].bytespp; in omap_vout_calculate_vrfb_offset()