Skip to content

Commit ccf58cb

Browse files
Hans Verkuilmchehab
authored andcommitted
[media] vb2: fix videobuf2-core.h comments
A lot of work was done in vb2 to regulate how drivers and the vb2 core handle buffer ownership, but inexplicably the videobuf2-core.h comments were never updated. Do so now. The same was true for the replacement of the -ENOBUFS mechanism by the min_buffers_needed field. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
1 parent 5d0360a commit ccf58cb

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

‎include/media/videobuf2-core.h‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,19 @@ struct vb2_buffer {
294294
* of already queued buffers in count parameter; driver
295295
* can return an error if hardware fails, in that case all
296296
* buffers that have been already given by the @buf_queue
297-
* callback are invalidated.
298-
* If there were not enough queued buffers to start
299-
* streaming, then this callback returns -ENOBUFS, and the
300-
* vb2 core will retry calling @start_streaming when a new
301-
* buffer is queued.
297+
* callback are to be returned by the driver by calling
298+
* @vb2_buffer_done(VB2_BUF_STATE_DEQUEUED).
299+
* If you need a minimum number of buffers before you can
300+
* start streaming, then set @min_buffers_needed in the
301+
* vb2_queue structure. If that is non-zero then
302+
* start_streaming won't be called until at least that
303+
* many buffers have been queued up by userspace.
302304
* @stop_streaming: called when 'streaming' state must be disabled; driver
303305
* should stop any DMA transactions or wait until they
304306
* finish and give back all buffers it got from buf_queue()
305-
* callback; may use vb2_wait_for_all_buffers() function
307+
* callback by calling @vb2_buffer_done() with either
308+
* VB2_BUF_STATE_DONE or VB2_BUF_STATE_ERROR; may use
309+
* vb2_wait_for_all_buffers() function
306310
* @buf_queue: passes buffer vb to the driver; driver may start
307311
* hardware operation on this buffer; driver should give
308312
* the buffer back by calling vb2_buffer_done() function;

0 commit comments

Comments
 (0)