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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4154479c-b0cc-dde4-eb73-bc6c65c9beca@collabora.com>
Date:   Thu, 21 Oct 2021 12:44:39 +0200
From:   AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>
To:     "roy-cw.yeh" <roy-cw.yeh@...iatek.com>,
        Rob Herring <robh+dt@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Chun-Kuang Hu <chunkuang.hu@...nel.org>
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Fabien Parent <fparent@...libre.com>,
        "jason-jh . lin" <jason-jh.lin@...iatek.com>,
        daoyuan huang <daoyuan.huang@...iatek.com>,
        Ping-Hsun Wu <ping-hsun.wu@...iatek.com>,
        Moudy Ho <moudy.ho@...iatek.com>,
        "river . cheng" <river.cheng@...iatek.com>,
        Yongqiang Niu <yongqiang.niu@...iatek.com>,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-media@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH v1 4/4] media: platform: mtk-mdp3: Set rdma compression
 reg in each frame

Il 21/10/21 08:34, roy-cw.yeh ha scritto:
> From: "Roy-CW.Yeh" <roy-cw.yeh@...iatek.com>
> 
> Set rdma compression reg in each frame
> 
> Signed-off-by: Roy-CW.Yeh <roy-cw.yeh@...iatek.com>
> ---
>   drivers/media/platform/mtk-mdp3/mtk-mdp3-comp.c | 10 ++++++----
>   drivers/media/platform/mtk-mdp3/mtk-mdp3-core.c |  2 +-
>   2 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/mtk-mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mtk-mdp3/mtk-mdp3-comp.c
> index 12d6c88c68d2..dc0d1b3ff218 100644
> --- a/drivers/media/platform/mtk-mdp3/mtk-mdp3-comp.c
> +++ b/drivers/media/platform/mtk-mdp3/mtk-mdp3-comp.c
> @@ -178,15 +178,17 @@ static int config_rdma_frame(struct mdp_comp_ctx *ctx,
>   			/* Setup Compression Control */
>   			MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_COMP_CON,
>   				     rdma->comp_ctrl, write_mask);
> -		}
> -
> -		if (mdp_cfg->rdma_support_afbc &&
> -		    (MDP_COLOR_IS_COMPRESS(colorformat))) {
> +		} else if (mdp_cfg->rdma_support_afbc &&
> +			   (MDP_COLOR_IS_COMPRESS(colorformat))) {

Looks like you're unconditionally writing to the compression control register,

so you can just...

>   			MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_MF_BKGD_SIZE_IN_PXL,
>   				     ((width + 31) >> 5) << 5, 0x001FFFFF);
>   			MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_MF_BKGD_H_SIZE_IN_PXL,
>   				     ((height + 7) >> 3) << 3, 0x001FFFFF);
>   
		}
		/* Setup Compression Control */

		MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_COMP_CON,

			     rdma->comp_ctrl, write_mask);	

... and avoid repeating the same thing over and over in all of the conditionals.

> +			/* Setup Compression Control */
> +			MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_COMP_CON,
> +				     rdma->comp_ctrl, write_mask);
> +		} else {
>   			/* Setup Compression Control */
>   			MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_COMP_CON,
>   				     rdma->comp_ctrl, write_mask);
> diff --git a/drivers/media/platform/mtk-mdp3/mtk-mdp3-core.c b/drivers/media/platform/mtk-mdp3/mtk-mdp3-core.c
> index 875326afb686..1a15490d45e7 100644
> --- a/drivers/media/platform/mtk-mdp3/mtk-mdp3-core.c
> +++ b/drivers/media/platform/mtk-mdp3/mtk-mdp3-core.c
> @@ -34,7 +34,7 @@ static const struct mdp_platform_config mt8195_plat_cfg = {
>   	.rdma_support_afbc              = true,
>   	.rdma_esl_setting               = true,
>   	.rdma_rsz1_sram_sharing         = false,
> -	.rdma_upsample_repeat_only      = true,
> +	.rdma_upsample_repeat_only      = false,
>   	.rsz_disable_dcm_small_sample   = false,
>   	.rsz_etc_control                = true,
>   	.wrot_filter_constraint         = false,
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ