From: Philipp Zabel
Date: Fri, 23 Jan 2015 16:51:34 +0000 (-0300)
Subject: [media] coda: allocate bitstream ringbuffer only for BIT decoder
X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e55317e7080e6d746c2d8e323216a7091e25111b;p=openwrt%2Fstaging%2Fblogic.git
[media] coda: allocate bitstream ringbuffer only for BIT decoder
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
Signed-off-by: Kamil Debski
Signed-off-by: Mauro Carvalho Chehab
---
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 9abb3214de52..8bd1611cbb89 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -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,