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] [day] [month] [year] [list]
Date:   Wed, 25 Oct 2023 08:03:02 +0000
From:   Jason-JH Lin (林睿祥) 
        <Jason-JH.Lin@...iatek.com>
To:     "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
        "angelogioacchino.delregno@...labora.com" 
        <angelogioacchino.delregno@...labora.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "krzysztof.kozlowski+dt@...aro.org" 
        <krzysztof.kozlowski+dt@...aro.org>,
        "chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>,
        Singo Chang (張興國) 
        <Singo.Chang@...iatek.com>,
        Johnson Wang (王聖鑫) 
        <Johnson.Wang@...iatek.com>,
        "linaro-mm-sig@...ts.linaro.org" <linaro-mm-sig@...ts.linaro.org>,
        "linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        Jason-ch Chen (陳建豪) 
        <Jason-ch.Chen@...iatek.com>,
        Shawn Sung (宋孝謙) 
        <Shawn.Sung@...iatek.com>,
        Nancy Lin (林欣螢) <Nancy.Lin@...iatek.com>,
        "jkardatzke@...gle.com" <jkardatzke@...gle.com>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "conor+dt@...nel.org" <conor+dt@...nel.org>,
        Project_Global_Chrome_Upstream_Group 
        <Project_Global_Chrome_Upstream_Group@...iatek.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 08/11] drm/mediatek: Add secure layer config support
 for ovl_adaptor

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@...iatek.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_reg	cmdq_reg;
> > +	resource_size_t		regs_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 int	y_top;
> >   	int		fmt;
> >   	int		color_encoding;
> > +	unsigned int	source_size;
> > +	unsigned int	is_sec;
> 
> is_secure looks better.
> 

OK, I'll change it.

Regards,
Jason-JH.Lin

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

Powered by blists - more mailing lists