[media] vb2: add vb2_fileio_is_active and check it more often
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 7 Apr 2014 12:23:50 +0000 (09:23 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 16 Apr 2014 21:50:27 +0000 (18:50 -0300)
commit74753cffa6fae399aef0f0a1a3315196e6e339cf
tree8f5474cc6ec6c36e974c380c57fd82722853f2f3
parent57394b72ef2b6dcf335999a7aebe69eb52142884
[media] vb2: add vb2_fileio_is_active and check it more often

Added a vb2_fileio_is_active inline function that returns true if fileio
is in progress. Check for this too in mmap() (you don't want apps mmap()ing
buffers used by fileio) and expbuf() (same reason).

In addition drivers should be able to check for this in queue_setup() to
return an error if an attempt is made to read() or write() with
V4L2_FIELD_ALTERNATE being configured. This is illegal (there is no way
to pass the TOP/BOTTOM information around using file I/O).

However, in order to be able to check for this the init_fileio function
needs to set q->fileio early on, before the buffers are allocated. So switch
to using internal functions (__reqbufs, vb2_internal_qbuf and
vb2_internal_streamon) to skip the fileio check. Well, that's why the internal
functions were created...

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/videobuf2-core.c
include/media/videobuf2-core.h
This page took 0.024806 seconds and 5 git commands to generate.