Lines Matching refs:vbq

257 static void omap24xxcam_vbq_free_mmap_buffers(struct videobuf_queue *vbq)  in omap24xxcam_vbq_free_mmap_buffers()  argument
261 mutex_lock(&vbq->vb_lock); in omap24xxcam_vbq_free_mmap_buffers()
264 if (NULL == vbq->bufs[i]) in omap24xxcam_vbq_free_mmap_buffers()
266 if (V4L2_MEMORY_MMAP != vbq->bufs[i]->memory) in omap24xxcam_vbq_free_mmap_buffers()
268 vbq->ops->buf_release(vbq, vbq->bufs[i]); in omap24xxcam_vbq_free_mmap_buffers()
269 omap24xxcam_vbq_free_mmap_buffer(vbq->bufs[i]); in omap24xxcam_vbq_free_mmap_buffers()
270 kfree(vbq->bufs[i]); in omap24xxcam_vbq_free_mmap_buffers()
271 vbq->bufs[i] = NULL; in omap24xxcam_vbq_free_mmap_buffers()
274 mutex_unlock(&vbq->vb_lock); in omap24xxcam_vbq_free_mmap_buffers()
276 videobuf_mmap_free(vbq); in omap24xxcam_vbq_free_mmap_buffers()
353 static int omap24xxcam_vbq_alloc_mmap_buffers(struct videobuf_queue *vbq, in omap24xxcam_vbq_alloc_mmap_buffers() argument
358 container_of(vbq, struct omap24xxcam_fh, vbq); in omap24xxcam_vbq_alloc_mmap_buffers()
360 mutex_lock(&vbq->vb_lock); in omap24xxcam_vbq_alloc_mmap_buffers()
363 err = omap24xxcam_vbq_alloc_mmap_buffer(vbq->bufs[i]); in omap24xxcam_vbq_alloc_mmap_buffers()
367 videobuf_to_dma(vbq->bufs[i])->sglen, i); in omap24xxcam_vbq_alloc_mmap_buffers()
370 mutex_unlock(&vbq->vb_lock); in omap24xxcam_vbq_alloc_mmap_buffers()
376 omap24xxcam_vbq_free_mmap_buffer(vbq->bufs[i]); in omap24xxcam_vbq_alloc_mmap_buffers()
379 mutex_unlock(&vbq->vb_lock); in omap24xxcam_vbq_alloc_mmap_buffers()
418 static void omap24xxcam_vbq_release(struct videobuf_queue *vbq, in omap24xxcam_vbq_release() argument
424 videobuf_waiton(vbq, vb, 0, 0); in omap24xxcam_vbq_release()
426 dma_unmap_sg(vbq->dev, dma->sglist, dma->sglen, in omap24xxcam_vbq_release()
430 videobuf_dma_unmap(vbq->dev, videobuf_to_dma(vb)); in omap24xxcam_vbq_release()
442 static int omap24xxcam_vbq_setup(struct videobuf_queue *vbq, unsigned int *cnt, in omap24xxcam_vbq_setup() argument
445 struct omap24xxcam_fh *fh = vbq->priv_data; in omap24xxcam_vbq_setup()
462 static int omap24xxcam_dma_iolock(struct videobuf_queue *vbq, in omap24xxcam_dma_iolock() argument
468 if (!dma_map_sg(vbq->dev, dma->sglist, dma->sglen, dma->direction)) { in omap24xxcam_dma_iolock()
478 static int omap24xxcam_vbq_prepare(struct videobuf_queue *vbq, in omap24xxcam_vbq_prepare() argument
482 struct omap24xxcam_fh *fh = vbq->priv_data; in omap24xxcam_vbq_prepare()
509 omap24xxcam_vbq_release(vbq, vb); in omap24xxcam_vbq_prepare()
531 err = omap24xxcam_dma_iolock(vbq, videobuf_to_dma(vb)); in omap24xxcam_vbq_prepare()
533 err = videobuf_iolock(vbq, vb, NULL); in omap24xxcam_vbq_prepare()
539 omap24xxcam_vbq_release(vbq, vb); in omap24xxcam_vbq_prepare()
544 static void omap24xxcam_vbq_queue(struct videobuf_queue *vbq, in omap24xxcam_vbq_queue() argument
547 struct omap24xxcam_fh *fh = vbq->priv_data; in omap24xxcam_vbq_queue()
1047 mutex_lock(&ofh->vbq.vb_lock); in vidioc_s_fmt_vid_cap()
1049 mutex_unlock(&ofh->vbq.vb_lock); in vidioc_s_fmt_vid_cap()
1085 omap24xxcam_vbq_free_mmap_buffers(&ofh->vbq); in vidioc_reqbufs()
1088 rval = videobuf_reqbufs(&ofh->vbq, b); in vidioc_reqbufs()
1097 rval = omap24xxcam_vbq_alloc_mmap_buffers(&ofh->vbq, rval); in vidioc_reqbufs()
1099 omap24xxcam_vbq_free_mmap_buffers(&ofh->vbq); in vidioc_reqbufs()
1110 return videobuf_querybuf(&ofh->vbq, b); in vidioc_querybuf()
1117 return videobuf_qbuf(&ofh->vbq, b); in vidioc_qbuf()
1128 rval = videobuf_dqbuf(&ofh->vbq, b, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
1132 vb = ofh->vbq.bufs[b->index]; in vidioc_dqbuf()
1150 videobuf_qbuf(&ofh->vbq, b); in vidioc_dqbuf()
1181 rval = videobuf_streamon(&ofh->vbq); in vidioc_streamon()
1197 struct videobuf_queue *q = &ofh->vbq; in vidioc_streamoff()
1354 mutex_lock(&fh->vbq.vb_lock); in omap24xxcam_poll()
1355 if (list_empty(&fh->vbq.stream)) { in omap24xxcam_poll()
1356 mutex_unlock(&fh->vbq.vb_lock); in omap24xxcam_poll()
1359 vb = list_entry(fh->vbq.stream.next, struct videobuf_buffer, stream); in omap24xxcam_poll()
1360 mutex_unlock(&fh->vbq.vb_lock); in omap24xxcam_poll()
1375 struct videobuf_queue *vbq = &fh->vbq; in omap24xxcam_mmap_buffers() local
1385 mutex_lock(&vbq->vb_lock); in omap24xxcam_mmap_buffers()
1389 if (NULL == vbq->bufs[first]) in omap24xxcam_mmap_buffers()
1391 if (V4L2_MEMORY_MMAP != vbq->bufs[first]->memory) in omap24xxcam_mmap_buffers()
1393 if (vbq->bufs[first]->boff == (vma->vm_pgoff << PAGE_SHIFT)) in omap24xxcam_mmap_buffers()
1399 if (NULL == vbq->bufs[last]) in omap24xxcam_mmap_buffers()
1401 if (V4L2_MEMORY_MMAP != vbq->bufs[last]->memory) in omap24xxcam_mmap_buffers()
1403 size += vbq->bufs[last]->bsize; in omap24xxcam_mmap_buffers()
1410 struct videobuf_dmabuf *dma = videobuf_to_dma(vbq->bufs[i]); in omap24xxcam_mmap_buffers()
1424 mutex_unlock(&vbq->vb_lock); in omap24xxcam_mmap_buffers()
1435 rval = videobuf_mmap_mapper(&fh->vbq, vma); in omap24xxcam_mmap()
1492 videobuf_queue_sg_init(&fh->vbq, &omap24xxcam_vbq_ops, NULL, in omap24xxcam_open()
1519 videobuf_streamoff(&fh->vbq); in omap24xxcam_release()
1532 omap24xxcam_vbq_free_mmap_buffers(&fh->vbq); in omap24xxcam_release()