Skip to content

Commit

Permalink
media: Revert "media: mtk-vcodec: Remove extra area allocation in an …
Browse files Browse the repository at this point in the history
…input buffer on encoding"

This reverts commit 3192b2c.

There are indications that this patch causes problems on some
platforms due to some hardware prefetch. Reverting this patch
for now until this is better understood.

Reported-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Nov 10, 2019
1 parent a2cbf80 commit dca6b37
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,23 @@ static int vidioc_try_fmt(struct v4l2_format *f,

pix_fmt_mp->num_planes = fmt->num_planes;
pix_fmt_mp->plane_fmt[0].sizeimage =
pix_fmt_mp->width * pix_fmt_mp->height;
pix_fmt_mp->width * pix_fmt_mp->height +
((ALIGN(pix_fmt_mp->width, 16) * 2) * 16);
pix_fmt_mp->plane_fmt[0].bytesperline = pix_fmt_mp->width;

if (pix_fmt_mp->num_planes == 2) {
pix_fmt_mp->plane_fmt[1].sizeimage =
(pix_fmt_mp->width * pix_fmt_mp->height) / 2;
(pix_fmt_mp->width * pix_fmt_mp->height) / 2 +
(ALIGN(pix_fmt_mp->width, 16) * 16);
pix_fmt_mp->plane_fmt[2].sizeimage = 0;
pix_fmt_mp->plane_fmt[1].bytesperline =
pix_fmt_mp->width;
pix_fmt_mp->plane_fmt[2].bytesperline = 0;
} else if (pix_fmt_mp->num_planes == 3) {
pix_fmt_mp->plane_fmt[1].sizeimage =
pix_fmt_mp->plane_fmt[2].sizeimage =
(pix_fmt_mp->width * pix_fmt_mp->height) / 4;
(pix_fmt_mp->width * pix_fmt_mp->height) / 4 +
((ALIGN(pix_fmt_mp->width, 16) / 2) * 16);
pix_fmt_mp->plane_fmt[1].bytesperline =
pix_fmt_mp->plane_fmt[2].bytesperline =
pix_fmt_mp->width / 2;
Expand Down

0 comments on commit dca6b37

Please sign in to comment.