staging: bcm2835-camera: Handle empty EOS buffers whilst streaming
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Sat, 29 Jun 2019 12:48:23 +0000 (14:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Jul 2019 06:11:22 +0000 (08:11 +0200)
commitb46475ecd9304aef278bd12c0731b4955789b698
treed9bbe6b7c9a02016226fd94cf90da576b994d39b
parent0ee144effcc34e36f3d6235090560f630703409d
staging: bcm2835-camera: Handle empty EOS buffers whilst streaming

commit a26be06d6d96c10a9ab005e99d93fbb5d3babd98 upstream.

The change to mapping V4L2 to MMAL buffers 1:1 didn't handle
the condition we get with raw pixel buffers (eg YUV and RGB)
direct from the camera's stills port. That sends the pixel buffer
and then an empty buffer with the EOS flag set. The EOS buffer
wasn't handled and returned an error up the stack.

Handle the condition correctly by returning it to the component
if streaming, or returning with an error if stopping streaming.

Fixes: 938416707071 ("staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
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