media: coda: lock capture queue wakeup against decoder stop command
authorPhilipp Zabel <p.zabel@pengutronix.de>
Wed, 18 Mar 2020 18:35:36 +0000 (19:35 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 14 Apr 2020 09:56:20 +0000 (11:56 +0200)
commit15c3d5aae73ecfe8cad916000cf42b85197e7308
treee096f02ad7910e6ca35ea2dad11bc133ec013dcd
parent1e34e446d79cbc85b14e881a7198ee6617909f13
media: coda: lock capture queue wakeup against decoder stop command

Similar to commit 9ee50a9489f1 ("media: coda: lock capture queue wakeup
against encoder stop command"), make sure that a JPEG decoder stop
command running concurrently with a decoder finish_run always either
flags the last returned buffer or wakes up the capture queue to signal
the end of stream condition afterwards.

This was not necessary for BIT processor contexts because of the need to
release the bitstream buffer with the stream end condition. In contrast,
the JPEG decoder can be finished with decoding the image between the
time the application queues the last output buffer and the time it
issues the decoder stop command.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/coda/coda-common.c
drivers/media/platform/coda/coda-jpeg.c