Commit 9393761a authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Mauro Carvalho Chehab

media: hantro: postproc: Fix motion vector space size

When the post-processor hardware block is enabled, the driver
allocates an internal queue of buffers for the decoder enginer,
and uses the vb2 queue for the post-processor engine.

For instance, on a G1 core, the decoder engine produces NV12 buffers
and the post-processor engine can produce YUY2 buffers. The decoder
engine expects motion vectors to be appended to the NV12 buffers,
but this is only required for CODECs that need motion vectors,
such as H.264.

Fix the post-processor logic accordingly.
Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent e594cda5
...@@ -132,9 +132,10 @@ int hantro_postproc_alloc(struct hantro_ctx *ctx) ...@@ -132,9 +132,10 @@ int hantro_postproc_alloc(struct hantro_ctx *ctx)
unsigned int num_buffers = cap_queue->num_buffers; unsigned int num_buffers = cap_queue->num_buffers;
unsigned int i, buf_size; unsigned int i, buf_size;
buf_size = ctx->dst_fmt.plane_fmt[0].sizeimage + buf_size = ctx->dst_fmt.plane_fmt[0].sizeimage;
hantro_h264_mv_size(ctx->dst_fmt.width, if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_H264_SLICE)
ctx->dst_fmt.height); buf_size += hantro_h264_mv_size(ctx->dst_fmt.width,
ctx->dst_fmt.height);
for (i = 0; i < num_buffers; ++i) { for (i = 0; i < num_buffers; ++i) {
struct hantro_aux_buf *priv = &ctx->postproc.dec_q[i]; struct hantro_aux_buf *priv = &ctx->postproc.dec_q[i];
......
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