summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/coda
diff options
context:
space:
mode:
authorPhilipp Zabel2018-06-28 12:57:53 +0200
committerMauro Carvalho Chehab2018-07-25 14:27:08 +0200
commit9e49ca530eebd6775410317aac8a68f88171f89c (patch)
tree9c51f4d41ce2abe325970171222de85be441a8b2 /drivers/media/platform/coda
parentmedia: coda: move framebuffer size calculation out of loop (diff)
downloadkernel-qcow2-linux-9e49ca530eebd6775410317aac8a68f88171f89c.tar.gz
kernel-qcow2-linux-9e49ca530eebd6775410317aac8a68f88171f89c.tar.xz
kernel-qcow2-linux-9e49ca530eebd6775410317aac8a68f88171f89c.zip
media: coda: streamline framebuffer size calculation a bit
Remove the intermediate width and height variables, the calculation is simple enough. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/coda')
-rw-r--r--drivers/media/platform/coda/coda-bit.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index 033abb03722b..bf8d8489f827 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -390,7 +390,6 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx,
struct coda_q_data *q_data, u32 fourcc)
{
struct coda_dev *dev = ctx->dev;
- int width, height;
unsigned int ysize, ycbcr_size;
int ret;
int i;
@@ -398,14 +397,11 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx,
if (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264 ||
ctx->codec->dst_fourcc == V4L2_PIX_FMT_H264 ||
ctx->codec->src_fourcc == V4L2_PIX_FMT_MPEG4 ||
- ctx->codec->dst_fourcc == V4L2_PIX_FMT_MPEG4) {
- width = round_up(q_data->width, 16);
- height = round_up(q_data->height, 16);
- } else {
- width = round_up(q_data->width, 8);
- height = q_data->height;
- }
- ysize = width * height;
+ ctx->codec->dst_fourcc == V4L2_PIX_FMT_MPEG4)
+ ysize = round_up(q_data->width, 16) *
+ round_up(q_data->height, 16);
+ else
+ ysize = round_up(q_data->width, 8) * q_data->height;
if (ctx->tiled_map_type == GDI_TILED_FRAME_MB_RASTER_MAP)
ycbcr_size = round_up(ysize, 4096) + ysize / 2;