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>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
5c9072e845
commit
9e49ca530e
@@ -390,7 +390,6 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx,
|
|||||||
struct coda_q_data *q_data, u32 fourcc)
|
struct coda_q_data *q_data, u32 fourcc)
|
||||||
{
|
{
|
||||||
struct coda_dev *dev = ctx->dev;
|
struct coda_dev *dev = ctx->dev;
|
||||||
int width, height;
|
|
||||||
unsigned int ysize, ycbcr_size;
|
unsigned int ysize, ycbcr_size;
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
@@ -398,14 +397,11 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx,
|
|||||||
if (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264 ||
|
if (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264 ||
|
||||||
ctx->codec->dst_fourcc == V4L2_PIX_FMT_H264 ||
|
ctx->codec->dst_fourcc == V4L2_PIX_FMT_H264 ||
|
||||||
ctx->codec->src_fourcc == V4L2_PIX_FMT_MPEG4 ||
|
ctx->codec->src_fourcc == V4L2_PIX_FMT_MPEG4 ||
|
||||||
ctx->codec->dst_fourcc == V4L2_PIX_FMT_MPEG4) {
|
ctx->codec->dst_fourcc == V4L2_PIX_FMT_MPEG4)
|
||||||
width = round_up(q_data->width, 16);
|
ysize = round_up(q_data->width, 16) *
|
||||||
height = round_up(q_data->height, 16);
|
round_up(q_data->height, 16);
|
||||||
} else {
|
else
|
||||||
width = round_up(q_data->width, 8);
|
ysize = round_up(q_data->width, 8) * q_data->height;
|
||||||
height = q_data->height;
|
|
||||||
}
|
|
||||||
ysize = width * height;
|
|
||||||
|
|
||||||
if (ctx->tiled_map_type == GDI_TILED_FRAME_MB_RASTER_MAP)
|
if (ctx->tiled_map_type == GDI_TILED_FRAME_MB_RASTER_MAP)
|
||||||
ycbcr_size = round_up(ysize, 4096) + ysize / 2;
|
ycbcr_size = round_up(ysize, 4096) + ysize / 2;
|
||||||
|
Reference in New Issue
Block a user