diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2020-03-18 19:35:36 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-04-14 11:56:20 +0200 |
commit | 15c3d5aae73ecfe8cad916000cf42b85197e7308 (patch) | |
tree | e096f02ad7910e6ca35ea2dad11bc133ec013dcd /drivers/media/platform/coda/coda-common.c | |
parent | 1e34e446d79cbc85b14e881a7198ee6617909f13 (diff) | |
download | linux-15c3d5aae73ecfe8cad916000cf42b85197e7308.tar.gz linux-15c3d5aae73ecfe8cad916000cf42b85197e7308.tar.bz2 linux-15c3d5aae73ecfe8cad916000cf42b85197e7308.zip |
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>
Diffstat (limited to 'drivers/media/platform/coda/coda-common.c')
-rw-r--r-- | drivers/media/platform/coda/coda-common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 55bbd2a4c77f..80ad2db3e9c9 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -1230,6 +1230,8 @@ static int coda_decoder_cmd(struct file *file, void *fh, stream_end = false; wakeup = false; + mutex_lock(&ctx->wakeup_mutex); + buf = v4l2_m2m_last_src_buf(ctx->fh.m2m_ctx); if (buf) { coda_dbg(1, ctx, "marking last pending buffer\n"); @@ -1266,6 +1268,7 @@ static int coda_decoder_cmd(struct file *file, void *fh, coda_wake_up_capture_queue(ctx); } + mutex_unlock(&ctx->wakeup_mutex); break; default: return -EINVAL; |