Commit 2039749e authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

[media] coda: do not allocate maximum number of framebuffers for encoder

The encoder only ever needs two buffers, but we'll have to increase
CODA_MAX_FRAMEBUFFERS for the decoder.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent c2d2251a
...@@ -1006,7 +1006,6 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx, struct coda_q_data *q_d ...@@ -1006,7 +1006,6 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx, struct coda_q_data *q_d
ysize = round_up(q_data->width, 8) * height; ysize = round_up(q_data->width, 8) * height;
/* Allocate frame buffers */ /* Allocate frame buffers */
ctx->num_internal_frames = CODA_MAX_FRAMEBUFFERS;
for (i = 0; i < ctx->num_internal_frames; i++) { for (i = 0; i < ctx->num_internal_frames; i++) {
ctx->internal_frames[i].size = q_data->sizeimage; ctx->internal_frames[i].size = q_data->sizeimage;
if (fourcc == V4L2_PIX_FMT_H264 && dev->devtype->product != CODA_DX6) if (fourcc == V4L2_PIX_FMT_H264 && dev->devtype->product != CODA_DX6)
...@@ -1356,6 +1355,7 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count) ...@@ -1356,6 +1355,7 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count)
goto out; goto out;
} }
ctx->num_internal_frames = 2;
ret = coda_alloc_framebuffers(ctx, q_data_src, dst_fourcc); ret = coda_alloc_framebuffers(ctx, q_data_src, dst_fourcc);
if (ret < 0) { if (ret < 0) {
v4l2_err(v4l2_dev, "failed to allocate framebuffers\n"); v4l2_err(v4l2_dev, "failed to allocate framebuffers\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment