[media] videobuf2-core: move plane verification out of __fill_v4l2/vb_buffer
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 28 Sep 2012 09:12:53 +0000 (06:12 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 6 Oct 2012 01:21:40 +0000 (22:21 -0300)
commit32a772603173f9e1bf675c01e4649e3fe3b794bc
tree090dec95f087913c5e74c52ee76a65d9e7b5efb0
parent626d533f8cb63b6c0cd6b83e1ce7e7656ccaba84
[media] videobuf2-core: move plane verification out of __fill_v4l2/vb_buffer

The plane verification should be done before actually queuing or
dequeuing buffers, so move it out of __fill_v4l2_buffer and __fill_vb_buffer
and call it as a separate step.
This also makes it possible to change the return type of __fill_v4l2/vb_buffer
to void.
The dqbuf case took some special care: before removing a buffer from the
done_list you have to verify that the receiving v4l2_buffer has enough room
for all the planes. The number of planes can differ between buffers due to the
fact that buffers for other formats can be prepared using VIDIOC_PREPARE_BUF.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/v4l2-core/videobuf2-core.c