diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2018-11-05 10:25:00 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-11-23 05:21:37 -0500 |
commit | 6c0f5d236fd0205a8dca24b82cfad1b1c6c0a1e0 (patch) | |
tree | b410639494a6aba022d5b6a83622c87c10682608 /drivers/media/platform/coda/coda-bit.c | |
parent | 649cfc2bdfeeb98ff7d8fdff0af3f8fb9c8da50f (diff) |
media: coda: store unmasked fifo position in meta
Storing the unmasked kfifo->in position as meta->start and ->end allows
to more easily compare a point past meta->end with the current
kfifo->in.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
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 | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index d26c2d85a009..e5ce0bec8ec3 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c @@ -299,8 +299,7 @@ void coda_fill_bitstream(struct coda_ctx *ctx, struct list_head *buffer_list) } /* Buffer start position */ - start = ctx->bitstream_fifo.kfifo.in & - ctx->bitstream_fifo.kfifo.mask; + start = ctx->bitstream_fifo.kfifo.in; if (coda_bitstream_try_queue(ctx, src_buf)) { /* @@ -315,8 +314,7 @@ void coda_fill_bitstream(struct coda_ctx *ctx, struct list_head *buffer_list) meta->timecode = src_buf->timecode; meta->timestamp = src_buf->vb2_buf.timestamp; meta->start = start; - meta->end = ctx->bitstream_fifo.kfifo.in & - ctx->bitstream_fifo.kfifo.mask; + meta->end = ctx->bitstream_fifo.kfifo.in; spin_lock_irqsave(&ctx->buffer_meta_lock, flags); list_add_tail(&meta->list, @@ -1980,8 +1978,7 @@ static int coda_prepare_decode(struct coda_ctx *ctx) if (meta && ctx->codec->src_fourcc == V4L2_PIX_FMT_JPEG) { /* If this is the last buffer in the bitstream, add padding */ - if (meta->end == (ctx->bitstream_fifo.kfifo.in & - ctx->bitstream_fifo.kfifo.mask)) { + if (meta->end == ctx->bitstream_fifo.kfifo.in) { static unsigned char buf[512]; unsigned int pad; |