diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2019-06-18 19:45:31 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-06-24 21:45:06 +0300 |
commit | d09ed310142af3e87359620d12f256969f8de439 (patch) | |
tree | f74f25a897b8a8238b8a979b1ba39815978e5ca2 /drivers/media/platform/coda/coda-bit.c | |
parent | 9ee50a9489f16048a82c94139f5436f4bb2620d9 (diff) | |
download | linux-d09ed310142af3e87359620d12f256969f8de439.tar.xz |
media: coda: mark last pending buffer or last meta on decoder stop command
If there is still a buffer pending, mark it as the last buffer. It will
create a meta that is flagged as last when the buffer is copied into the
bitstream ring buffer. If there are no more buffers pending, find the
last bitstream meta and mark it as last. If there is no bitstream meta
either, wake up the capture queue as there will be no more decoded
frames.
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>
Diffstat (limited to 'drivers/media/platform/coda/coda-bit.c')
-rw-r--r-- | drivers/media/platform/coda/coda-bit.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index 44085e3d43d5..1157454e3bc8 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c @@ -402,6 +402,9 @@ void coda_fill_bitstream(struct coda_ctx *ctx, struct list_head *buffer_list) meta->timestamp = src_buf->vb2_buf.timestamp; meta->start = start; meta->end = ctx->bitstream_fifo.kfifo.in; + meta->last = src_buf->flags & V4L2_BUF_FLAG_LAST; + if (meta->last) + coda_dbg(1, ctx, "marking last meta"); spin_lock(&ctx->buffer_meta_lock); list_add_tail(&meta->list, &ctx->buffer_meta_list); @@ -2334,6 +2337,7 @@ static void coda_finish_decode(struct coda_ctx *ctx) memset(&decoded_frame->meta, 0, sizeof(struct coda_buffer_meta)); decoded_frame->meta.sequence = val; + decoded_frame->meta.last = false; ctx->sequence_offset++; } |