diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2019-01-08 20:20:43 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-01-21 20:47:50 +0300 |
commit | cd9f125cfaa5047899e1d39d6fc0a9ed5e40afa7 (patch) | |
tree | 2e93cf25043fa7b94f27b3ac4b690d8f0975adac /drivers/media/platform/coda/coda-bit.c | |
parent | fbf9aa6aeaebb10afb9d4fca013c4823ae0b5101 (diff) | |
download | linux-cd9f125cfaa5047899e1d39d6fc0a9ed5e40afa7.tar.xz |
media: coda: fix decoder capture buffer payload
It is not correct to calculate decoder capture payload dynamically from
the decoded frame width and height reported by the firmware. These tell
us what the decoder wrote into the internal framebuffers. The rotator or
VDOA always write the full sizeimage when copying the previously decoded
frame from the internal framebuffers into the capture queue.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/coda/coda-bit.c')
-rw-r--r-- | drivers/media/platform/coda/coda-bit.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index 88065b07149c..b4f396c2e72c 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c @@ -2024,7 +2024,6 @@ static void coda_finish_decode(struct coda_ctx *ctx) struct coda_q_data *q_data_dst; struct vb2_v4l2_buffer *dst_buf; struct coda_buffer_meta *meta; - unsigned long payload; int width, height; int decoded_idx; int display_idx; @@ -2230,21 +2229,8 @@ static void coda_finish_decode(struct coda_ctx *ctx) trace_coda_dec_rot_done(ctx, dst_buf, meta); - switch (q_data_dst->fourcc) { - case V4L2_PIX_FMT_YUYV: - payload = width * height * 2; - break; - case V4L2_PIX_FMT_YUV420: - case V4L2_PIX_FMT_YVU420: - case V4L2_PIX_FMT_NV12: - default: - payload = width * height * 3 / 2; - break; - case V4L2_PIX_FMT_YUV422P: - payload = width * height * 2; - break; - } - vb2_set_plane_payload(&dst_buf->vb2_buf, 0, payload); + vb2_set_plane_payload(&dst_buf->vb2_buf, 0, + q_data_dst->sizeimage); if (ctx->frame_errors[ctx->display_idx] || err_vdoa) coda_m2m_buf_done(ctx, dst_buf, VB2_BUF_STATE_ERROR); |