<pre>
Hi Angelo,

Thanks for the reviews.

On Tue, 2023-10-24 at 10:37 +0200, AngeloGioacchino Del Regno wrote:
> Il 23/10/23 06:45, Jason-JH.Lin ha scritto:
> > Add secure layer config support for ovl_adaptor and sub driver
> > mdp_rdma.
> >
> > Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> > ---
> > drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 3 +++
> > drivers/gpu/drm/mediatek/mtk_mdp_rdma.c | 11 ++++++++---
> > drivers/gpu/drm/mediatek/mtk_mdp_rdma.h | 2 ++
> > 3 files changed, 13 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> > b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> > index 28a0bccfb0b9..274961222672 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> > @@ -153,6 +153,9 @@ void mtk_ovl_adaptor_layer_config(struct device
> > *dev, unsigned int idx,
> > rdma_config.pitch = pending->pitch;
> > rdma_config.fmt = pending->format;
> > rdma_config.color_encoding = pending->color_encoding;
> > +rdma_config.source_size = (pending->height - 1) * pending-
> > >pitch +
> > + pending->width * fmt_info->cpp[0];
> > +rdma_config.is_sec = state->pending.is_sec;
> > mtk_mdp_rdma_config(rdma_l, &rdma_config, cmdq_pkt);
> >
> > if (use_dual_pipe) {
> > diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> > b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> > index c3adaeefd551..1c4798e3bbc3 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> > @@ -94,6 +94,7 @@ struct mtk_mdp_rdma {
> > void __iomem*regs;
> > struct clk*clk;
> > struct cmdq_client_regcmdq_reg;
> > +resource_size_tregs_pa;
> > };
> >
> > static unsigned int rdma_fmt_convert(unsigned int fmt)
> > @@ -198,9 +199,12 @@ void mtk_mdp_rdma_config(struct device *dev,
> > struct mtk_mdp_rdma_cfg *cfg,
> > else
> > mtk_ddp_write_mask(cmdq_pkt, 0, &priv->cmdq_reg, priv-
> > >regs,
> > MDP_RDMA_SRC_CON, FLD_OUTPUT_ARGB);
> > -
> > -mtk_ddp_write_mask(cmdq_pkt, cfg->addr0, &priv->cmdq_reg, priv-
> > >regs,
> > - MDP_RDMA_SRC_BASE_0, FLD_SRC_BASE_0);
> > +if (cfg->is_sec)
> > +mtk_ddp_sec_write(cmdq_pkt, priv->regs_pa +
> > MDP_RDMA_SRC_BASE_0,
> > + cfg->addr0, CMDQ_IWC_H_2_MVA, 0, cfg-
> > >source_size, 0);
> > +else
> > +mtk_ddp_write_mask(cmdq_pkt, cfg->addr0, &priv-
> > >cmdq_reg, priv->regs,
> > + MDP_RDMA_SRC_BASE_0,
> > FLD_SRC_BASE_0);
> >
> > mtk_ddp_write_mask(cmdq_pkt, src_pitch_y, &priv->cmdq_reg,
> > priv->regs,
> > MDP_RDMA_MF_BKGD_SIZE_IN_BYTE,
> > FLD_MF_BKGD_WB);
> > @@ -285,6 +289,7 @@ static int mtk_mdp_rdma_probe(struct
> > platform_device *pdev)
> > return -ENOMEM;
> >
> > res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +priv->regs_pa = res->start;
> > priv->regs = devm_ioremap_resource(dev, res);
> > if (IS_ERR(priv->regs)) {
> > dev_err(dev, "failed to ioremap rdma\n");
> > diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.h
> > b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.h
> > index 9943ee3aac31..9add18e96319 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.h
> > +++ b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.h
> > @@ -15,6 +15,8 @@ struct mtk_mdp_rdma_cfg {
> > unsigned inty_top;
> > intfmt;
> > intcolor_encoding;
> > +unsigned intsource_size;
> > +unsigned intis_sec;
>
> is_secure looks better.
>

OK, I'll change it.

Regards,
Jason-JH.Lin

> Regards,
> Angelo
>
> > };
> >
> > #endif // __MTK_MDP_RDMA_H__
>
>

</pre><!--type:text--><!--{--><pre>************* MEDIATEK Confidentiality Notice ********************
The information contained in this e-mail message (including any 
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be 
conveyed only to the designated recipient(s). Any use, dissemination, 
distribution, printing, retaining or copying of this e-mail (including its 
attachments) by unintended recipient(s) is strictly prohibited and may 
be unlawful. If you are not an intended recipient of this e-mail, or believe 
that you have received this e-mail in error, please notify the sender 
immediately (by replying to this e-mail), delete any and all copies of 
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
</pre><!--}-->