Lines Matching refs:vdev
703 static inline bool vb2_queue_is_busy(struct video_device *vdev, struct file *file) in vb2_queue_is_busy() argument
705 return vdev->queue->owner && vdev->queue->owner != file->private_data; in vb2_queue_is_busy()
713 struct video_device *vdev = video_devdata(file); in vb2_ioctl_reqbufs() local
714 int res = vb2_verify_memory_type(vdev->queue, p->memory, p->type); in vb2_ioctl_reqbufs()
718 if (vb2_queue_is_busy(vdev, file)) in vb2_ioctl_reqbufs()
720 res = vb2_core_reqbufs(vdev->queue, p->memory, &p->count); in vb2_ioctl_reqbufs()
724 vdev->queue->owner = p->count ? file->private_data : NULL; in vb2_ioctl_reqbufs()
732 struct video_device *vdev = video_devdata(file); in vb2_ioctl_create_bufs() local
733 int res = vb2_verify_memory_type(vdev->queue, p->memory, in vb2_ioctl_create_bufs()
736 p->index = vdev->queue->num_buffers; in vb2_ioctl_create_bufs()
745 if (vb2_queue_is_busy(vdev, file)) in vb2_ioctl_create_bufs()
748 res = vb2_create_bufs(vdev->queue, p); in vb2_ioctl_create_bufs()
750 vdev->queue->owner = file->private_data; in vb2_ioctl_create_bufs()
758 struct video_device *vdev = video_devdata(file); in vb2_ioctl_prepare_buf() local
760 if (vb2_queue_is_busy(vdev, file)) in vb2_ioctl_prepare_buf()
762 return vb2_prepare_buf(vdev->queue, p); in vb2_ioctl_prepare_buf()
768 struct video_device *vdev = video_devdata(file); in vb2_ioctl_querybuf() local
771 return vb2_querybuf(vdev->queue, p); in vb2_ioctl_querybuf()
777 struct video_device *vdev = video_devdata(file); in vb2_ioctl_qbuf() local
779 if (vb2_queue_is_busy(vdev, file)) in vb2_ioctl_qbuf()
781 return vb2_qbuf(vdev->queue, p); in vb2_ioctl_qbuf()
787 struct video_device *vdev = video_devdata(file); in vb2_ioctl_dqbuf() local
789 if (vb2_queue_is_busy(vdev, file)) in vb2_ioctl_dqbuf()
791 return vb2_dqbuf(vdev->queue, p, file->f_flags & O_NONBLOCK); in vb2_ioctl_dqbuf()
797 struct video_device *vdev = video_devdata(file); in vb2_ioctl_streamon() local
799 if (vb2_queue_is_busy(vdev, file)) in vb2_ioctl_streamon()
801 return vb2_streamon(vdev->queue, i); in vb2_ioctl_streamon()
807 struct video_device *vdev = video_devdata(file); in vb2_ioctl_streamoff() local
809 if (vb2_queue_is_busy(vdev, file)) in vb2_ioctl_streamoff()
811 return vb2_streamoff(vdev->queue, i); in vb2_ioctl_streamoff()
817 struct video_device *vdev = video_devdata(file); in vb2_ioctl_expbuf() local
819 if (vb2_queue_is_busy(vdev, file)) in vb2_ioctl_expbuf()
821 return vb2_expbuf(vdev->queue, p); in vb2_ioctl_expbuf()
829 struct video_device *vdev = video_devdata(file); in vb2_fop_mmap() local
831 return vb2_mmap(vdev->queue, vma); in vb2_fop_mmap()
837 struct video_device *vdev = video_devdata(file); in _vb2_fop_release() local
841 if (file->private_data == vdev->queue->owner) { in _vb2_fop_release()
842 vb2_queue_release(vdev->queue); in _vb2_fop_release()
843 vdev->queue->owner = NULL; in _vb2_fop_release()
853 struct video_device *vdev = video_devdata(file); in vb2_fop_release() local
854 struct mutex *lock = vdev->queue->lock ? vdev->queue->lock : vdev->lock; in vb2_fop_release()
863 struct video_device *vdev = video_devdata(file); in vb2_fop_write() local
864 struct mutex *lock = vdev->queue->lock ? vdev->queue->lock : vdev->lock; in vb2_fop_write()
867 if (!(vdev->queue->io_modes & VB2_WRITE)) in vb2_fop_write()
871 if (vb2_queue_is_busy(vdev, file)) in vb2_fop_write()
873 err = vb2_write(vdev->queue, buf, count, ppos, in vb2_fop_write()
875 if (vdev->queue->fileio) in vb2_fop_write()
876 vdev->queue->owner = file->private_data; in vb2_fop_write()
887 struct video_device *vdev = video_devdata(file); in vb2_fop_read() local
888 struct mutex *lock = vdev->queue->lock ? vdev->queue->lock : vdev->lock; in vb2_fop_read()
891 if (!(vdev->queue->io_modes & VB2_READ)) in vb2_fop_read()
895 if (vb2_queue_is_busy(vdev, file)) in vb2_fop_read()
897 err = vb2_read(vdev->queue, buf, count, ppos, in vb2_fop_read()
899 if (vdev->queue->fileio) in vb2_fop_read()
900 vdev->queue->owner = file->private_data; in vb2_fop_read()
910 struct video_device *vdev = video_devdata(file); in vb2_fop_poll() local
911 struct vb2_queue *q = vdev->queue; in vb2_fop_poll()
912 struct mutex *lock = q->lock ? q->lock : vdev->lock; in vb2_fop_poll()
927 res = vb2_poll(vdev->queue, file, wait); in vb2_fop_poll()
942 struct video_device *vdev = video_devdata(file); in vb2_fop_get_unmapped_area() local
944 return vb2_get_unmapped_area(vdev->queue, addr, len, pgoff, flags); in vb2_fop_get_unmapped_area()