Lines Matching +full:queue +full:- +full:sizes
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
69 * should return an allocator private per-buffer structure
82 * allocator private per-buffer structure on success;
86 * allocator private per-buffer structure previously returned
91 * @unmap_dmabuf: releases access control to the dmabuf - allocator is notified
153 * struct vb2_plane - plane information.
155 * @dbuf: dma_buf - shared buffer object.
161 * valid size is MAX_UINT - PAGE_SIZE.
164 * @length, it is limited to MAX_UINT - PAGE_SIZE.
165 * @m: Union with memtype-specific data.
197 * enum vb2_io_modes - queue access methods.
213 * enum vb2_buffer_state - current video buffer state.
239 * struct vb2_buffer - represents a video buffer.
240 * @vb2_queue: pointer to &struct vb2_queue with the queue to
246 * on an internal driver queue.
273 * skip_cache_sync_on_prepare: when set buffer's ->prepare() function
275 * skip_cache_sync_on_finish: when set buffer's ->finish() function
277 * planes: per-plane information; do not change
295 * Counters for how often these buffer-related ops are
328 * struct vb2_ops - driver-specific callbacks.
342 * set in the sizes\[\] array and optional per-plane
346 * determine the plane sizes and \*num_buffers is the total
349 * describes the requested number of planes and sizes\[\]
350 * contains the requested plane sizes. In this case
353 * or the requested sizes are invalid callback must return %-EINVAL.
363 * userspace-provided information; this is required only
367 * perform additional buffer-related initialization;
369 * queue setup from completing successfully; optional.
385 * when the queue has been canceled and all pending
408 * &vb2_queue->min_queued_buffers. If that is non-zero
426 * if user pre-queued buffers before calling
437 unsigned int sizes[], struct device *alloc_devs[]);
459 * struct vb2_buf_ops - driver-specific callbacks.
484 * struct vb2_queue - a videobuf2 queue.
486 * @type: private buffer type whose content is defined by the vb2-core
494 * this queue will be overridden with %DMA_BIDIRECTIONAL direction.
504 * @fileio_write_immediately: queue buffer after each write() call
509 * @supports_requests: this queue supports the Request API.
510 * @requires_requests: this queue requires the Request API. If this is set to 1,
512 * @uses_qbuf: qbuf was used directly for this queue. Set to 1 the first
513 * time this is called. Set to 0 when the queue is canceled.
514 * If this is 1, then you cannot queue buffers from a request.
515 * @uses_requests: requests are used for this queue. Set to 1 the first time
516 * a request is queued. Set to 0 when the queue is canceled.
517 * If this is 1, then you cannot queue buffers directly.
518 * @allow_cache_hints: when set user-space can pass cache management hints in
519 * order to skip cache flush/invalidation on ->prepare() or/and
520 * ->finish().
521 * @non_coherent_mem: when set queue will attempt to allocate buffers using
522 * non-coherent memory.
531 * drivers to easily associate an owner filehandle with the queue.
532 * @ops: driver-specific callbacks
535 * between user-space and kernel-space.
539 * @buf_struct_size: size of the driver-specific buffer structure;
541 * structure type. In that case a subsystem-specific struct
544 * driver-specific buffer structure must be the subsystem-specific
570 * @alloc_devs: &struct device memory type/allocator-specific per-plane device
577 * @bufs: videobuf2 buffer structures. If it is non-NULL then
578 * bufs_bitmap is also non-NULL.
592 * @error: a fatal error occurred on the queue
597 * it has to wait for a buffer to become available with vb2_queue->lock
598 * released. Used to prevent destroying the queue by other threads.
602 * @copy_timestamp: set if vb2-core should set timestamps
608 * @name: queue name, used for logging purpose. Initialized automatically
679 * Counters for how often these queue-related ops are
693 * vb2_queue_allows_cache_hints() - Return true if the queue allows cache
696 * @q: pointer to &struct vb2_queue with videobuf2 queue
700 return q->allow_cache_hints && q->memory == VB2_MEMORY_MMAP; in vb2_queue_allows_cache_hints()
704 * vb2_plane_vaddr() - Return a kernel virtual address of a given plane.
715 * vb2_plane_cookie() - Return allocator specific cookie for the given plane.
729 * vb2_buffer_done() - inform videobuf2 that an operation on a buffer
740 * by the means of &vb2_ops->buf_queue callback. Only buffers previously queued
741 * to the driver by &vb2_ops->buf_queue can be passed to this function.
744 * The &vb2_ops->start_streaming op can also return them in case the DMA engine
746 * returned with state QUEUED to put them back into the queue.
751 * vb2_discard_done() - discard all buffers marked as DONE.
752 * @q: pointer to &struct vb2_queue with videobuf2 queue.
765 * vb2_wait_for_all_buffers() - wait until all buffers are given back to vb2.
766 * @q: pointer to &struct vb2_queue with videobuf2 queue.
769 * by &vb2_ops->buf_queue are given back to vb2 with vb2_buffer_done(). It
770 * doesn't call &vb2_ops->wait_prepare/&vb2_ops->wait_finish pair.
772 * &vb2_ops->stop_streaming callback.
777 * vb2_core_querybuf() - query video buffer information.
778 * @q: pointer to &struct vb2_queue with videobuf2 queue.
783 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
794 * vb2_core_reqbufs() - Initiate streaming.
795 * @q: pointer to &struct vb2_queue with videobuf2 queue.
797 * @flags: auxiliary queue/buffer management flags. Currently, the only
802 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
807 * #) sets up the queue;
813 * memory handling/allocation routines provided during queue initialization.
815 * If req->count is 0, all the memory will be freed instead.
817 * If the queue has been allocated previously by a previous vb2_core_reqbufs()
818 * call and the queue is not busy, memory will be reallocated.
826 * vb2_core_create_bufs() - Allocate buffers and any required auxiliary structs
827 * @q: pointer to &struct vb2_queue with videobuf2 queue.
829 * @flags: auxiliary queue/buffer management flags.
834 * indices in the range [first_index..first_index+count-1]
837 * called internally by VB2 by an API-specific handler, like
838 * ``videobuf2-v4l2.h``.
843 * #) calls the &vb2_ops->queue_setup queue operation;
855 * vb2_core_prepare_buf() - Pass ownership of a buffer from userspace
857 * @q: pointer to &struct vb2_queue with videobuf2 queue.
860 * &v4l2_ioctl_ops->vidioc_prepare_buf handler in driver.
863 * called internally by VB2 by an API-specific handler, like
864 * ``videobuf2-v4l2.h``.
868 * This function calls vb2_ops->buf_prepare callback in the driver
869 * (if provided), in which driver-specific buffer initialization can
877 * vb2_core_remove_bufs() -
878 * @q: pointer to &struct vb2_queue with videobuf2 queue.
887 * vb2_core_qbuf() - Queue a buffer from userspace
889 * @q: pointer to &struct vb2_queue with videobuf2 queue.
892 * v4l2_ioctl_ops->vidioc_qbuf handler in driver
896 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
900 * #) If @req is non-NULL, then the buffer will be bound to this
904 * #) if necessary, calls &vb2_ops->buf_prepare callback in the driver
905 * (if provided), in which driver-specific buffer initialization can
908 * &vb2_ops->buf_queue callback for processing.
916 * vb2_core_dqbuf() - Dequeue a buffer to the userspace
917 * @q: pointer to &struct vb2_queue with videobuf2 queue
920 * v4l2_ioctl_ops->vidioc_dqbuf handler in driver.
923 * would be passing (file->f_flags & O_NONBLOCK) here.
926 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
942 * vb2_core_streamon() - Implements VB2 stream ON logic
944 * @q: pointer to &struct vb2_queue with videobuf2 queue
945 * @type: type of the queue to be started.
949 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
956 * vb2_core_streamoff() - Implements VB2 stream OFF logic
958 * @q: pointer to &struct vb2_queue with videobuf2 queue
959 * @type: type of the queue to be started.
963 * called internally by VB2 by an API-specific handler, like
964 * ``videobuf2-v4l2.h``.
971 * vb2_core_expbuf() - Export a buffer as a file descriptor.
972 * @q: pointer to &struct vb2_queue with videobuf2 queue.
979 * include/uapi/asm-generic/fcntl.h.
985 * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
993 * vb2_core_queue_init() - initialize a videobuf2 queue
994 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1004 * &vb2_queue->ops, &vb2_queue->mem_ops, &vb2_queue->type.
1009 * vb2_core_queue_release() - stop streaming, release the queue and free memory
1010 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1019 * vb2_queue_error() - signal a fatal error on the queue
1020 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1023 * waiting on the queue. Polling will now set %EPOLLERR and queuing and dequeuing
1024 * buffers will return %-EIO.
1026 * The error flag will be cleared when canceling the queue, either from
1029 * until the queue is released when closing the device node.
1034 * vb2_mmap() - map video buffers into application address space.
1035 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1045 * to it earlier by the means of &v4l2_ioctl_ops->vidioc_querybuf handler.
1059 * vb2_get_unmapped_area - map video buffers into application address space.
1060 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1068 * &file_operations->get_unmapped_area operation.
1081 * vb2_core_poll() - implements poll syscall() logic.
1082 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1102 * vb2_read() - implements read() syscall logic.
1103 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1112 * vb2_write() - implements write() syscall logic.
1113 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1123 * typedef vb2_thread_fnc - callback function for use with vb2_thread.
1133 * vb2_thread_start() - start a thread for the given queue.
1134 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1137 * @thread_name:the name of the thread. This will be prefixed with "vb2-".
1139 * This starts a thread that will queue and dequeue until an error occurs
1144 * This function should not be used for anything else but the videobuf2-dvb
1145 * support. If you think you have another good use-case for this, then please
1146 * contact the linux-media mailing list first.
1152 * vb2_thread_stop() - stop the thread for the given queue.
1153 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1158 * vb2_is_streaming() - return streaming status of the queue.
1159 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1163 return q->streaming; in vb2_is_streaming()
1167 * vb2_fileio_is_active() - return true if fileio is active.
1168 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1176 * this in the &vb2_ops->queue_setup op and reject it if this function returns
1181 return q->fileio; in vb2_fileio_is_active()
1185 * vb2_get_num_buffers() - get the number of buffer in a queue
1186 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1190 if (q->bufs_bitmap) in vb2_get_num_buffers()
1191 return bitmap_weight(q->bufs_bitmap, q->max_num_buffers); in vb2_get_num_buffers()
1197 * vb2_is_busy() - return busy status of the queue.
1198 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1200 * This function checks if queue has any buffers allocated.
1204 return !!q->is_busy; in vb2_is_busy()
1208 * vb2_get_drv_priv() - return driver private data associated with the queue.
1209 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1213 return q->drv_priv; in vb2_get_drv_priv()
1217 * vb2_set_plane_payload() - set bytesused for the plane @plane_no.
1230 if (plane_no < vb->num_planes) { in vb2_set_plane_payload()
1231 if (WARN_ON_ONCE(size > vb->planes[plane_no].length)) in vb2_set_plane_payload()
1232 size = vb->planes[plane_no].length; in vb2_set_plane_payload()
1233 vb->planes[plane_no].bytesused = size; in vb2_set_plane_payload()
1238 * vb2_get_plane_payload() - get bytesused for the plane plane_no
1246 if (plane_no < vb->num_planes) in vb2_get_plane_payload()
1247 return vb->planes[plane_no].bytesused; in vb2_get_plane_payload()
1252 * vb2_plane_size() - return plane size in bytes.
1260 if (plane_no < vb->num_planes) in vb2_plane_size()
1261 return vb->planes[plane_no].length; in vb2_plane_size()
1266 * vb2_start_streaming_called() - return streaming status of driver.
1267 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1271 return q->start_streaming_called; in vb2_start_streaming_called()
1275 * vb2_clear_last_buffer_dequeued() - clear last buffer dequeued flag of queue.
1276 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1280 q->last_buffer_dequeued = false; in vb2_clear_last_buffer_dequeued()
1284 * vb2_get_buffer() - get a buffer from a queue
1285 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1288 * This function obtains a buffer from a queue, by its index.
1296 if (!q->bufs) in vb2_get_buffer()
1299 if (index >= q->max_num_buffers) in vb2_get_buffer()
1302 if (test_bit(index, q->bufs_bitmap)) in vb2_get_buffer()
1303 return q->bufs[index]; in vb2_get_buffer()
1309 * functions for videobuf2-*.
1313 * vb2_buffer_in_use() - return true if the buffer is in use and
1314 * the queue cannot be freed (by the means of VIDIOC_REQBUFS(0)) call.
1317 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1322 * vb2_verify_memory_type() - Check whether the memory type and buffer type
1323 * passed to a buffer operation are compatible with the queue.
1325 * @q: pointer to &struct vb2_queue with videobuf2 queue.
1327 * @type: private buffer type whose content is defined by the vb2-core
1335 * vb2_request_object_is_buffer() - return true if the object is a buffer
1342 * vb2_request_buffer_cnt() - return the number of buffers in the request