summaryrefslogtreecommitdiff
path: root/drivers/media/video/videobuf-dma-sg.c
diff options
context:
space:
mode:
authorBrandon Philips <brandon@ifup.org>2008-04-03 01:10:59 +0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 21:07:57 +0400
commit137d1cb19d9da163ce6cb57a6fa1e6a3468af6a4 (patch)
tree197f2548c82390d9c0a730c26d548752fdca12ad /drivers/media/video/videobuf-dma-sg.c
parent78718e5d44cd450431d5b16ee36d3a7de1db6dfa (diff)
downloadlinux-137d1cb19d9da163ce6cb57a6fa1e6a3468af6a4.tar.xz
V4L/DVB (7493): videobuf: Avoid deadlock with QBUF and bring up to spec for empty queue
Add a waitqueue to wait on when there are no buffers in the buffer queue. DQBUF waits on this queue without holding vb_lock to allow a QBUF to happen. Once a buffer has been queued we recheck that the queue is still streaming and wait on the new buffer's waitqueue while holding the vb_lock. The driver should come along in a timely manner and put the buffer into its next state finishing the DQBUF. By implementing this waitqueue it also brings the videobuf DQBUF up to spec and it now blocks on O_NONBLOCK even when no buffers have been queued via QBUF: "By default VIDIOC_DQBUF blocks when no buffer is in the outgoing queue." - V4L2 spec Signed-off-by: Brandon Philips <bphilips@suse.de> CC: Trent Piepho <xyzzy@speakeasy.org> CC: Carl Karsten <carl@personnelware.com> CC: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/videobuf-dma-sg.c')
0 files changed, 0 insertions, 0 deletions