diff options
-rw-r--r-- | include/media/videobuf2-core.h | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index e145f1475ffe..ce795cd0a7cc 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
@@ -786,7 +786,28 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb); | |||
786 | int vb2_core_dqbuf(struct vb2_queue *q, unsigned int *pindex, void *pb, | 786 | int vb2_core_dqbuf(struct vb2_queue *q, unsigned int *pindex, void *pb, |
787 | bool nonblocking); | 787 | bool nonblocking); |
788 | 788 | ||
789 | /** | ||
790 | * vb2_core_streamon() - Implements VB2 stream ON logic | ||
791 | * | ||
792 | * @q: pointer to &struct vb2_queue with videobuf2 queue | ||
793 | * @type: type of the queue to be started. | ||
794 | * For V4L2, this is defined by &enum v4l2_buf_type type. | ||
795 | * | ||
796 | * Should be called from &v4l2_ioctl_ops->vidioc_streamon ioctl handler of | ||
797 | * a driver. | ||
798 | */ | ||
789 | int vb2_core_streamon(struct vb2_queue *q, unsigned int type); | 799 | int vb2_core_streamon(struct vb2_queue *q, unsigned int type); |
800 | |||
801 | /** | ||
802 | * vb2_core_streamoff() - Implements VB2 stream OFF logic | ||
803 | * | ||
804 | * @q: pointer to &struct vb2_queue with videobuf2 queue | ||
805 | * @type: type of the queue to be started. | ||
806 | * For V4L2, this is defined by &enum v4l2_buf_type type. | ||
807 | * | ||
808 | * Should be called from &v4l2_ioctl_ops->vidioc_streamon ioctl handler of | ||
809 | * a driver. | ||
810 | */ | ||
790 | int vb2_core_streamoff(struct vb2_queue *q, unsigned int type); | 811 | int vb2_core_streamoff(struct vb2_queue *q, unsigned int type); |
791 | 812 | ||
792 | /** | 813 | /** |
@@ -874,6 +895,21 @@ void vb2_queue_error(struct vb2_queue *q); | |||
874 | int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma); | 895 | int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma); |
875 | 896 | ||
876 | #ifndef CONFIG_MMU | 897 | #ifndef CONFIG_MMU |
898 | /** | ||
899 | * vb2_get_unmapped_area - map video buffers into application address space. | ||
900 | * @q: pointer to &struct vb2_queue with videobuf2 queue. | ||
901 | * @addr: memory address. | ||
902 | * @len: buffer size. | ||
903 | * @pgoff: page offset. | ||
904 | * @flags: memory flags. | ||
905 | * | ||
906 | * This function is used in noMMU platforms to propose address mapping | ||
907 | * for a given buffer. It's intended to be used as a handler for the | ||
908 | * &file_operations->get_unmapped_area operation. | ||
909 | * | ||
910 | * This is called by the mmap() syscall routines will call this | ||
911 | * to get a proposed address for the mapping, when ``!CONFIG_MMU``. | ||
912 | */ | ||
877 | unsigned long vb2_get_unmapped_area(struct vb2_queue *q, | 913 | unsigned long vb2_get_unmapped_area(struct vb2_queue *q, |
878 | unsigned long addr, | 914 | unsigned long addr, |
879 | unsigned long len, | 915 | unsigned long len, |
@@ -882,7 +918,7 @@ unsigned long vb2_get_unmapped_area(struct vb2_queue *q, | |||
882 | #endif | 918 | #endif |
883 | 919 | ||
884 | /** | 920 | /** |
885 | * vb2_core_poll() - implements poll userspace operation. | 921 | * vb2_core_poll() - implements poll syscall() logic. |
886 | * @q: pointer to &struct vb2_queue with videobuf2 queue. | 922 | * @q: pointer to &struct vb2_queue with videobuf2 queue. |
887 | * @file: &struct file argument passed to the poll | 923 | * @file: &struct file argument passed to the poll |
888 | * file operation handler. | 924 | * file operation handler. |
@@ -902,8 +938,24 @@ unsigned long vb2_get_unmapped_area(struct vb2_queue *q, | |||
902 | unsigned int vb2_core_poll(struct vb2_queue *q, struct file *file, | 938 | unsigned int vb2_core_poll(struct vb2_queue *q, struct file *file, |
903 | poll_table *wait); | 939 | poll_table *wait); |
904 | 940 | ||
941 | /** | ||
942 | * vb2_read() - implements read() syscall logic. | ||
943 | * @q: pointer to &struct vb2_queue with videobuf2 queue. | ||
944 | * @data: pointed to target userspace buffer | ||
945 | * @count: number of bytes to read | ||
946 | * @ppos: file handle position tracking pointer | ||
947 | * @nonblock: mode selector (1 means blocking calls, 0 means nonblocking) | ||
948 | */ | ||
905 | size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count, | 949 | size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count, |
906 | loff_t *ppos, int nonblock); | 950 | loff_t *ppos, int nonblock); |
951 | /** | ||
952 | * vb2_read() - implements write() syscall logic. | ||
953 | * @q: pointer to &struct vb2_queue with videobuf2 queue. | ||
954 | * @data: pointed to target userspace buffer | ||
955 | * @count: number of bytes to write | ||
956 | * @ppos: file handle position tracking pointer | ||
957 | * @nonblock: mode selector (1 means blocking calls, 0 means nonblocking) | ||
958 | */ | ||
907 | size_t vb2_write(struct vb2_queue *q, const char __user *data, size_t count, | 959 | size_t vb2_write(struct vb2_queue *q, const char __user *data, size_t count, |
908 | loff_t *ppos, int nonblock); | 960 | loff_t *ppos, int nonblock); |
909 | 961 | ||