summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2019-06-18 12:45:22 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-26 09:10:33 +0200
commit9a9ff8f128445688f43b9afc1b837a3de4548586 (patch)
tree8f9637364ea6e4b0b40f80a535178409552711f9 /drivers
parent0c4616125cc28c908107da6888079c546e93c104 (diff)
downloadlinux-stable-9a9ff8f128445688f43b9afc1b837a3de4548586.tar.gz
linux-stable-9a9ff8f128445688f43b9afc1b837a3de4548586.tar.bz2
linux-stable-9a9ff8f128445688f43b9afc1b837a3de4548586.zip
media: coda: increment sequence offset for the last returned frame
[ Upstream commit b3b7d96817cdb8b6fc353867705275dce8f41ccc ] If no more frames are decoded in bitstream end mode, and a previously decoded frame has been returned, the firmware still increments the frame number. To avoid a sequence number mismatch after decoder restart, increment the sequence_offset correction parameter. 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+samsung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/coda/coda-bit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index 1eeed34f300d..8c9743e067cf 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -2147,6 +2147,9 @@ static void coda_finish_decode(struct coda_ctx *ctx)
else if (ctx->display_idx < 0)
ctx->hold = true;
} else if (decoded_idx == -2) {
+ if (ctx->display_idx >= 0 &&
+ ctx->display_idx < ctx->num_internal_frames)
+ ctx->sequence_offset++;
/* no frame was decoded, we still return remaining buffers */
} else if (decoded_idx < 0 || decoded_idx >= ctx->num_internal_frames) {
v4l2_err(&dev->v4l2_dev,