lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1593574231.1533.0.camel@mtksdaap41>
Date:   Wed, 1 Jul 2020 11:30:31 +0800
From:   Tiffany Lin <tiffany.lin@...iatek.com>
To:     Alexandre Courbot <acourbot@...omium.org>
CC:     Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
        Rui Wang <gtk_ruiwang@...iatek.com>,
        Yunfei Dong <yunfei.dong@...iatek.com>,
        "Pi-Hsun Shih" <pihsun@...omium.org>,
        Maoguang Meng <maoguang.meng@...iatek.com>,
        <linux-media@...r.kernel.org>,
        <linux-mediatek@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 10/18] Revert "media: mtk-vcodec: Remove extra area
 allocation in an input buffer on encoding"

On Fri, 2020-06-26 at 17:04 +0900, Alexandre Courbot wrote:
> This reverts commit 81735ecb62f882853a37a8c157407ec4aed44fd0.
> 
> The hardware needs data to follow the previous alignment, so this extra
> space was not superfluous after all. Besides, this also made
> v4l2-compliance's G_FMT and S_FMT tests regress.
> 
Acked-by: Tiffany Lin <tiffany.lin@...iatek.com>

> Signed-off-by: Alexandre Courbot <acourbot@...omium.org>
> ---
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> index 05743a745a11..f2ba19c32400 100644
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> @@ -299,12 +299,14 @@ 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;
> @@ -312,7 +314,8 @@ 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;
> +				(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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ