[media] coda: allocate bitstream ringbuffer only for BIT decoder
authorPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 23 Jan 2015 16:51:34 +0000 (13:51 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 2 Feb 2015 12:37:56 +0000 (10:37 -0200)
The BIT encoder does not use a per-context bitstream ringbuffer as it encodes
directly into the videobuf2 capture queue's buffers. Avoid allocation of the
bitstream ringbuffer for encoder contexts.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/coda/coda-common.c

index 9abb3214de52411a7119e8ac350403233bea422e..8bd1611cbb899bbe83a37f2a687fd556ae72941b 100644 (file)
@@ -1689,7 +1689,8 @@ static int coda_open(struct file *file)
                        v4l2_err(&dev->v4l2_dev, "failed to allocate parabuf");
                        goto err_dma_alloc;
                }
-
+       }
+       if (ctx->use_bit && ctx->inst_type == CODA_INST_DECODER) {
                ctx->bitstream.size = CODA_MAX_FRAME_SIZE;
                ctx->bitstream.vaddr = dma_alloc_writecombine(
                                &dev->plat_dev->dev, ctx->bitstream.size,