staging: bcm2835-camera: Match MMAL buffer count to V4L2.
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Thu, 10 May 2018 19:42:10 +0000 (12:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 May 2018 10:02:05 +0000 (12:02 +0200)
commit7cc31d57f399b00f96ce295d5b86426b95d9076f
treee2bc0a90ae2851d3486dee5d65b66048f145fef0
parent71fcbc4740ab24c5208a24cf48a8190dc8f5d9ae
staging: bcm2835-camera: Match MMAL buffer count to V4L2.

For historical reasons, the number of buffers passed to the VPU over
MMAL did not match that passed from V4L2.  That is a silly situation
as the driver has to duplicate serialisation and other functions that
have already been implemented in V4L2/videobuf2.

As we had more V4L2 buffers than MMAL ones, the MMAL buffer headers
were returned to the VPU immediately on being filled, which is now
invalid.

Match the number of buffers notified in queue_setup with that used in
MMAL.  Return buffers only when we get them from V4L2.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h