mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: "roy-cw.yeh" <roy-cw.yeh@mediatek.com>,
	Rob Herring <robh+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Fabien Parent <fparent@baylibre.com>,
	"jason-jh . lin" <jason-jh.lin@mediatek.com>,
	daoyuan huang <daoyuan.huang@mediatek.com>,
	Ping-Hsun Wu <ping-hsun.wu@mediatek.com>,
	Moudy Ho <moudy.ho@mediatek.com>,
	"river . cheng" <river.cheng@mediatek.com>,
	Yongqiang Niu <yongqiang.niu@mediatek.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v1 4/4] media: platform: mtk-mdp3: Set rdma compression reg in each frame
Date: Thu, 21 Oct 2021 12:44:39 +0200	[thread overview]
Message-ID: <4154479c-b0cc-dde4-eb73-bc6c65c9beca@collabora.com> (raw)
In-Reply-To: <20211021063414.23663-5-roy-cw.yeh@mediatek.com>

Il 21/10/21 08:34, roy-cw.yeh ha scritto:
> From: "Roy-CW.Yeh" <roy-cw.yeh@mediatek.com>
> 
> Set rdma compression reg in each frame
> 
> Signed-off-by: Roy-CW.Yeh <roy-cw.yeh@mediatek.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,
> 


      parent reply	other threads:[~2021-10-21 10:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211021063414.23663-1-roy-cw.yeh@mediatek.com>
     [not found] ` <20211021063414.23663-4-roy-cw.yeh@mediatek.com>
2021-10-21 10:28   ` [PATCH v1 3/4] media: platform: mtk-mdp3: Set dma_set_mask_and_coherent AngeloGioacchino Del Regno
     [not found] ` <20211021063414.23663-5-roy-cw.yeh@mediatek.com>
2021-10-21 10:44   ` AngeloGioacchino Del Regno [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4154479c-b0cc-dde4-eb73-bc6c65c9beca@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=daoyuan.huang@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fparent@baylibre.com \
    --cc=jason-jh.lin@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=moudy.ho@mediatek.com \
    --cc=ping-hsun.wu@mediatek.com \
    --cc=river.cheng@mediatek.com \
    --cc=robh+dt@kernel.org \
    --cc=roy-cw.yeh@mediatek.com \
    --cc=yongqiang.niu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®