summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/coda/coda-bit.c
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2014-10-02 14:08:35 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-10-28 15:39:30 -0200
commitd4c6a416b9d57af6ff8a2dc71f81dad70dbefb2b (patch)
treeb6a1ab642da0d83025aef4cc4aaef92a186b7132 /drivers/media/platform/coda/coda-bit.c
parent619165628d8f0e296c66a2f37bcea50769b7873d (diff)
[media] coda: allow userspace to set compressed buffer size in a certain range
For small frame sizes, allocating 1 MiB per compressed buffer is a waste of space. On the other hand, incompressible 1080p data can produce JPEGs larger than 1 MiB at higher quality settings. Allow userspace to set the compressed buffer size and clamp the value to a sensible range. Also set the initial sizeimage to a value inside the range allowed by try_fmt. While at it, reduce the default image size to a maximum of 1920*1088 (otherwise JPEG will default to 8k*8k and 96 MiB buffers). 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>
Diffstat (limited to 'drivers/media/platform/coda/coda-bit.c')
-rw-r--r--drivers/media/platform/coda/coda-bit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index 2a6810e47a5..0c67cfd23c1 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -1129,7 +1129,7 @@ static int coda_prepare_encode(struct coda_ctx *ctx)
ctx->vpu_header_size[0] +
ctx->vpu_header_size[1] +
ctx->vpu_header_size[2];
- pic_stream_buffer_size = CODA_MAX_FRAME_SIZE -
+ pic_stream_buffer_size = q_data_dst->sizeimage -
ctx->vpu_header_size[0] -
ctx->vpu_header_size[1] -
ctx->vpu_header_size[2];
@@ -1143,7 +1143,7 @@ static int coda_prepare_encode(struct coda_ctx *ctx)
} else {
pic_stream_buffer_addr =
vb2_dma_contig_plane_dma_addr(dst_buf, 0);
- pic_stream_buffer_size = CODA_MAX_FRAME_SIZE;
+ pic_stream_buffer_size = q_data_dst->sizeimage;
}
if (src_buf->v4l2_buf.flags & V4L2_BUF_FLAG_KEYFRAME) {