Skip to content

Commit

Permalink
hantro: postproc: Fix motion vector space allocation
Browse files Browse the repository at this point in the history
When the post-processor is enabled, the driver allocates
"shadow buffers" which are used for the decoder core,
and exposes the post-processed buffers to userspace.

For this reason, extra motion vector space has to
be allocated on the shadow buffers, which the driver
wasn't doing. Fix it.

This fix should address artifacts on high profile bitstreams.

Fixes: 8c2d66b ("media: hantro: Support color conversion via post-processing")
Signed-off-by: Ezequiel Garcia <[email protected]>
  • Loading branch information
ezequielgarcia authored and sigmaris committed Aug 8, 2020
1 parent 416562b commit 721b0a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/staging/media/hantro/hantro_postproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ int hantro_postproc_alloc(struct hantro_ctx *ctx)
unsigned int num_buffers = cap_queue->num_buffers;
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,
ctx->dst_fmt.height);

for (i = 0; i < num_buffers; ++i) {
struct hantro_aux_buf *priv = &ctx->postproc.dec_q[i];
Expand Down

0 comments on commit 721b0a6

Please sign in to comment.