This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: mtk-vcodec: Remove extra area allocation in an input buffer on 
encoding
Author:  Hirokazu Honda <hi...@chromium.org>
Date:    Sun Nov 10 07:25:34 2019 +0100

MediaTek encoder allocates non pixel data area for an input buffer every
plane. As the input buffer should be read-only, the driver should not write
anything in the buffer. Therefore, the extra data should be unnecessary.

Signed-off-by: Hirokazu Honda <hi...@chromium.org>
Reviewed-by: Tomasz Figa <tf...@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mche...@kernel.org>

 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

---

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
index fd8de027e83e..6aad53d97d74 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
@@ -332,14 +332,12 @@ 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 +
-                               ((ALIGN(pix_fmt_mp->width, 16) * 2) * 16);
+                       pix_fmt_mp->width * pix_fmt_mp->height;
                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 +
-                               (ALIGN(pix_fmt_mp->width, 16) * 16);
+                               (pix_fmt_mp->width * pix_fmt_mp->height) / 2;
                        pix_fmt_mp->plane_fmt[2].sizeimage = 0;
                        pix_fmt_mp->plane_fmt[1].bytesperline =
                                                        pix_fmt_mp->width;
@@ -347,8 +345,7 @@ static int vidioc_try_fmt(struct v4l2_format *f,
                } 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 +
-                               ((ALIGN(pix_fmt_mp->width, 16) / 2) * 16);
+                               (pix_fmt_mp->width * pix_fmt_mp->height) / 4;
                        pix_fmt_mp->plane_fmt[1].bytesperline =
                                pix_fmt_mp->plane_fmt[2].bytesperline =
                                pix_fmt_mp->width / 2;

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to