Lines Matching +full:per +full:- +full:operation
2 * videobuf2-core.h - Video Buffer 2 Core Framework
18 #include <linux/dma-buf.h>
20 #include <media/media-request.h>
27 * enum vb2_memory - type of memory model used to make the buffers visible
52 * struct vb2_mem_ops - memory handling/memory allocator operations.
55 * per-buffer data on success; the returned private structure
62 * argument is the allocator private per-buffer structure
64 * @get_dmabuf: acquire userspace memory for a hardware operation; used for
66 * @get_userptr: acquire userspace memory for a hardware operation; used for
69 * should return an allocator private per-buffer structure
75 * @attach_dmabuf: attach a shared &struct dma_buf for a hardware operation;
78 * allocator private per-buffer structure on success;
82 * allocator private per-buffer structure previously returned
87 * @unmap_dmabuf: releases access control to the dmabuf - allocator is notified
153 * struct vb2_plane - plane information.
155 * @dbuf: dma_buf - shared buffer object.
159 * valid size is MAX_UINT - PAGE_SIZE.
162 * @length, it is limited to MAX_UINT - PAGE_SIZE.
163 * @m: Union with memtype-specific data.
194 * enum vb2_io_modes - queue access methods.
210 * enum vb2_buffer_state - current video buffer state.
216 * in a hardware operation.
219 * @VB2_BUF_STATE_ERROR: same as above, but the operation on the buffer
236 * struct vb2_buffer - represents a video buffer.
270 * skip_cache_sync_on_prepare: when set buffer's ->prepare() function
272 * skip_cache_sync_on_finish: when set buffer's ->finish() function
278 * vb2_plane: per-plane information; do not change
292 * Counters for how often these buffer-related ops are
325 * struct vb2_ops - driver-specific callbacks.
337 * in \*num_buffers, the required number of planes per
339 * set in the sizes\[\] array and optional per-plane
349 * q->num_buffers. If either \*num_planes or the requested
350 * sizes are invalid callback must return %-EINVAL.
356 * required to continue operation after sleeping while
360 * userspace-provided information; this is required only
364 * perform additional buffer-related initialization;
370 * hardware operation in this callback; drivers can
405 * &vb2_queue->min_queued_buffers. If that is non-zero
419 * hardware operation on this buffer; driver should give
423 * if user pre-queued buffers before calling
456 * struct vb2_buf_ops - driver-specific callbacks.
481 * struct vb2_queue - a videobuf2 queue.
483 * @type: private buffer type whose content is defined by the vb2-core
487 * @alloc_devs: &struct device memory type/allocator-specific per-plane device
516 * @allow_cache_hints: when set user-space can pass cache management hints in
517 * order to skip cache flush/invalidation on ->prepare() or/and
518 * ->finish().
520 * non-coherent memory.
530 * @ops: driver-specific callbacks
533 * between user-space and kernel-space.
537 * @buf_struct_size: size of the driver-specific buffer structure;
539 * structure type. In that case a subsystem-specific struct
542 * driver-specific buffer structure must be the subsystem-specific
582 * @copy_timestamp: set if vb2-core should set timestamps
657 * Counters for how often these queue-related ops are
671 * vb2_queue_allows_cache_hints() - Return true if the queue allows cache
678 return q->allow_cache_hints && q->memory == VB2_MEMORY_MMAP; in vb2_queue_allows_cache_hints()
682 * vb2_plane_vaddr() - Return a kernel virtual address of a given plane.
693 * vb2_plane_cookie() - Return allocator specific cookie for the given plane.
707 * vb2_buffer_done() - inform videobuf2 that an operation on a buffer
711 * Either %VB2_BUF_STATE_DONE if the operation finished
712 * successfully, %VB2_BUF_STATE_ERROR if the operation finished
715 * This function should be called by the driver after a hardware operation on
718 * by the means of &vb2_ops->buf_queue callback. Only buffers previously queued
719 * to the driver by &vb2_ops->buf_queue can be passed to this function.
722 * The &vb2_ops->start_streaming op can also return them in case the DMA engine
729 * vb2_discard_done() - discard all buffers marked as DONE.
743 * vb2_wait_for_all_buffers() - wait until all buffers are given back to vb2.
747 * by &vb2_ops->buf_queue are given back to vb2 with vb2_buffer_done(). It
748 * doesn't call &vb2_ops->wait_prepare/&vb2_ops->wait_finish pair.
750 * &vb2_ops->stop_streaming callback.
755 * vb2_core_querybuf() - query video buffer information.
760 * Videobuf2 core helper to implement VIDIOC_QUERYBUF() operation. It is called
761 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
772 * vb2_core_reqbufs() - Initiate streaming.
779 * Videobuf2 core helper to implement VIDIOC_REQBUF() operation. It is called
780 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
786 * #) negotiates number of buffers and planes per buffer with the driver
793 * If req->count is 0, all the memory will be freed instead.
804 * vb2_core_create_bufs() - Allocate buffers and any required auxiliary structs
812 * Videobuf2 core helper to implement VIDIOC_CREATE_BUFS() operation. It is
813 * called internally by VB2 by an API-specific handler, like
814 * ``videobuf2-v4l2.h``.
819 * #) calls the &vb2_ops->queue_setup queue operation;
830 * vb2_core_prepare_buf() - Pass ownership of a buffer from userspace
835 * &v4l2_ioctl_ops->vidioc_prepare_buf handler in driver.
837 * Videobuf2 core helper to implement VIDIOC_PREPARE_BUF() operation. It is
838 * called internally by VB2 by an API-specific handler, like
839 * ``videobuf2-v4l2.h``.
843 * This function calls vb2_ops->buf_prepare callback in the driver
844 * (if provided), in which driver-specific buffer initialization can
852 * vb2_core_qbuf() - Queue a buffer from userspace
857 * v4l2_ioctl_ops->vidioc_qbuf handler in driver
860 * Videobuf2 core helper to implement VIDIOC_QBUF() operation. It is called
861 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
865 * #) If @req is non-NULL, then the buffer will be bound to this
869 * #) if necessary, calls &vb2_ops->buf_prepare callback in the driver
870 * (if provided), in which driver-specific buffer initialization can
873 * &vb2_ops->buf_queue callback for processing.
881 * vb2_core_dqbuf() - Dequeue a buffer to the userspace
885 * v4l2_ioctl_ops->vidioc_dqbuf handler in driver.
888 * would be passing (file->f_flags & O_NONBLOCK) here.
890 * Videobuf2 core helper to implement VIDIOC_DQBUF() operation. It is called
891 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
907 * vb2_core_streamon() - Implements VB2 stream ON logic
913 * Videobuf2 core helper to implement VIDIOC_STREAMON() operation. It is called
914 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
921 * vb2_core_streamoff() - Implements VB2 stream OFF logic
927 * Videobuf2 core helper to implement VIDIOC_STREAMOFF() operation. It is
928 * called internally by VB2 by an API-specific handler, like
929 * ``videobuf2-v4l2.h``.
936 * vb2_core_expbuf() - Export a buffer as a file descriptor.
944 * include/uapi/asm-generic/fcntl.h.
949 * Videobuf2 core helper to implement VIDIOC_EXPBUF() operation. It is called
950 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
958 * vb2_core_queue_init() - initialize a videobuf2 queue
969 * &vb2_queue->ops, &vb2_queue->mem_ops, &vb2_queue->type.
974 * vb2_core_queue_release() - stop streaming, release the queue and free memory
984 * vb2_queue_error() - signal a fatal error on the queue
989 * buffers will return %-EIO.
999 * vb2_mmap() - map video buffers into application address space.
1002 * to the mmap file operation handler in the driver.
1004 * Should be called from mmap file operation handler of a driver.
1007 * has to be called once per each plane per each buffer previously allocated.
1010 * to it earlier by the means of &v4l2_ioctl_ops->vidioc_querybuf handler.
1015 * by the means of a provided memory operation.
1024 * vb2_get_unmapped_area - map video buffers into application address space.
1033 * &file_operations->get_unmapped_area operation.
1046 * vb2_core_poll() - implements poll syscall() logic.
1049 * file operation handler.
1051 * file operation handler.
1053 * This function implements poll file operation handler for a driver.
1067 * vb2_read() - implements read() syscall logic.
1077 * vb2_write() - implements write() syscall logic.
1088 * typedef vb2_thread_fnc - callback function for use with vb2_thread.
1098 * vb2_thread_start() - start a thread for the given queue.
1102 * @thread_name:the name of the thread. This will be prefixed with "vb2-".
1109 * This function should not be used for anything else but the videobuf2-dvb
1110 * support. If you think you have another good use-case for this, then please
1111 * contact the linux-media mailing list first.
1117 * vb2_thread_stop() - stop the thread for the given queue.
1123 * vb2_is_streaming() - return streaming status of the queue.
1128 return q->streaming; in vb2_is_streaming()
1132 * vb2_fileio_is_active() - return true if fileio is active.
1141 * this in the &vb2_ops->queue_setup op and reject it if this function returns
1146 return q->fileio; in vb2_fileio_is_active()
1150 * vb2_get_num_buffers() - get the number of buffer in a queue
1155 return q->num_buffers; in vb2_get_num_buffers()
1159 * vb2_is_busy() - return busy status of the queue.
1170 * vb2_get_drv_priv() - return driver private data associated with the queue.
1175 return q->drv_priv; in vb2_get_drv_priv()
1179 * vb2_set_plane_payload() - set bytesused for the plane @plane_no.
1192 if (plane_no < vb->num_planes) { in vb2_set_plane_payload()
1193 if (WARN_ON_ONCE(size > vb->planes[plane_no].length)) in vb2_set_plane_payload()
1194 size = vb->planes[plane_no].length; in vb2_set_plane_payload()
1195 vb->planes[plane_no].bytesused = size; in vb2_set_plane_payload()
1200 * vb2_get_plane_payload() - get bytesused for the plane plane_no
1208 if (plane_no < vb->num_planes) in vb2_get_plane_payload()
1209 return vb->planes[plane_no].bytesused; in vb2_get_plane_payload()
1214 * vb2_plane_size() - return plane size in bytes.
1222 if (plane_no < vb->num_planes) in vb2_plane_size()
1223 return vb->planes[plane_no].length; in vb2_plane_size()
1228 * vb2_start_streaming_called() - return streaming status of driver.
1233 return q->start_streaming_called; in vb2_start_streaming_called()
1237 * vb2_clear_last_buffer_dequeued() - clear last buffer dequeued flag of queue.
1242 q->last_buffer_dequeued = false; in vb2_clear_last_buffer_dequeued()
1246 * vb2_get_buffer() - get a buffer from a queue
1252 * operation, so the buffer lifetime should be taken into
1258 if (!q->bufs) in vb2_get_buffer()
1261 if (index >= q->max_num_buffers) in vb2_get_buffer()
1264 if (index < q->num_buffers) in vb2_get_buffer()
1265 return q->bufs[index]; in vb2_get_buffer()
1271 * functions for videobuf2-*.
1275 * vb2_buffer_in_use() - return true if the buffer is in use and
1284 * vb2_verify_memory_type() - Check whether the memory type and buffer type
1285 * passed to a buffer operation are compatible with the queue.
1289 * @type: private buffer type whose content is defined by the vb2-core
1297 * vb2_request_object_is_buffer() - return true if the object is a buffer
1304 * vb2_request_buffer_cnt() - return the number of buffers in the request