diff options
author | Kieran Bingham | 2017-03-16 14:33:05 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab | 2018-12-05 09:12:09 +0100 |
commit | 01e90464e42e51b118a95ebb0fb002af1e2e79af (patch) | |
tree | c00d06140b85cb18df9306ce1fba265a3f106ff3 /drivers/media/usb/uvc/uvcvideo.h | |
parent | media: uvcvideo: queue: Simplify spin-lock usage (diff) | |
download | kernel-qcow2-linux-01e90464e42e51b118a95ebb0fb002af1e2e79af.tar.gz kernel-qcow2-linux-01e90464e42e51b118a95ebb0fb002af1e2e79af.tar.xz kernel-qcow2-linux-01e90464e42e51b118a95ebb0fb002af1e2e79af.zip |
media: uvcvideo: queue: Support asynchronous buffer handling
The buffer queue interface currently operates sequentially, processing
buffers after they have fully completed.
In preparation for supporting parallel tasks operating on the buffers,
we will need to support buffers being processed on multiple CPUs.
Adapt the uvc_queue_next_buffer() such that a reference count tracks the
active use of the buffer, returning the buffer to the VB2 stack at
completion.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/usb/uvc/uvcvideo.h')
-rw-r--r-- | drivers/media/usb/uvc/uvcvideo.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index f6109a4dde5b..92a17f011bf2 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -413,6 +413,9 @@ struct uvc_buffer { unsigned int bytesused; u32 pts; + + /* Asynchronous buffer handling. */ + struct kref ref; }; #define UVC_QUEUE_DISCONNECTED (1 << 0) @@ -729,6 +732,7 @@ void uvc_queue_cancel(struct uvc_video_queue *queue, int disconnect); struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf); struct uvc_buffer *uvc_queue_get_current_buffer(struct uvc_video_queue *queue); +void uvc_queue_buffer_release(struct uvc_buffer *buf); int uvc_queue_mmap(struct uvc_video_queue *queue, struct vm_area_struct *vma); __poll_t uvc_queue_poll(struct uvc_video_queue *queue, struct file *file, |