diff mbox series

[v3,06/11] drm/mediatek: Add get_sec_port interface to mtk_ddp_comp

Message ID 20231223182932.27683-7-jason-jh.lin@mediatek.com
State New
Headers show
Series Add mediate-drm secure flow for SVP | expand

Commit Message

Jason-JH.Lin Dec. 23, 2023, 6:29 p.m. UTC
Add get_sec_port interface to ddp_comp to get the secure port settings
from ovl and ovl_adaptor.
Then mediatek-drm will use secure cmdq driver to configure DRAM access
permission in secure world by their secure port settings.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

CK Hu (胡俊光) Dec. 26, 2023, 5:24 a.m. UTC | #1
On Sun, 2023-12-24 at 02:29 +0800, Jason-JH.Lin wrote:
> Add get_sec_port interface to ddp_comp to get the secure port
> settings
> from ovl and ovl_adaptor.
> Then mediatek-drm will use secure cmdq driver to configure DRAM
> access
> permission in secure world by their secure port settings.
> 
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> ---

TODO: drop this patch.


Regards,
CK

>  drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
> b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
> index b5a05ca3a385..1e6a120a103d 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
> @@ -84,6 +84,7 @@ struct mtk_ddp_comp_funcs {
>  	void (*add)(struct device *dev, struct mtk_mutex *mutex);
>  	void (*remove)(struct device *dev, struct mtk_mutex *mutex);
>  	unsigned int (*encoder_index)(struct device *dev);
> +	u64 (*get_sec_port)(struct mtk_ddp_comp *comp, unsigned int
> idx);
>  };
>  
>  struct mtk_ddp_comp {
> @@ -199,6 +200,14 @@ static inline unsigned int
> mtk_ddp_gamma_get_lut_size(struct mtk_ddp_comp *comp)
>  	return 0;
>  }
>  
> +static inline u64 mtk_ddp_comp_layer_get_sec_port(struct
> mtk_ddp_comp *comp,
> +						  unsigned int idx)
> +{
> +	if (comp->funcs && comp->funcs->get_sec_port)
> +		return comp->funcs->get_sec_port(comp, idx);
> +	return 0;
> +}
> +
>  static inline void mtk_ddp_gamma_set(struct mtk_ddp_comp *comp,
>  				     struct drm_crtc_state *state)
>  {
Jason-JH.Lin Dec. 27, 2023, 3:19 a.m. UTC | #2
Hi CK,

Thanks for the reviews.

On Tue, 2023-12-26 at 05:24 +0000, CK Hu (胡俊光) wrote:
> On Sun, 2023-12-24 at 02:29 +0800, Jason-JH.Lin wrote:
> > Add get_sec_port interface to ddp_comp to get the secure port
> > settings
> > from ovl and ovl_adaptor.
> > Then mediatek-drm will use secure cmdq driver to configure DRAM
> > access
> > permission in secure world by their secure port settings.
> > 
> > Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> > ---
> 
> TODO: drop this patch.
> 
> 
> Regards,
> CK
> 
OK, I'll drop this.

Regards,
Jason-JH.Lin
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
index b5a05ca3a385..1e6a120a103d 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
@@ -84,6 +84,7 @@  struct mtk_ddp_comp_funcs {
 	void (*add)(struct device *dev, struct mtk_mutex *mutex);
 	void (*remove)(struct device *dev, struct mtk_mutex *mutex);
 	unsigned int (*encoder_index)(struct device *dev);
+	u64 (*get_sec_port)(struct mtk_ddp_comp *comp, unsigned int idx);
 };
 
 struct mtk_ddp_comp {
@@ -199,6 +200,14 @@  static inline unsigned int mtk_ddp_gamma_get_lut_size(struct mtk_ddp_comp *comp)
 	return 0;
 }
 
+static inline u64 mtk_ddp_comp_layer_get_sec_port(struct mtk_ddp_comp *comp,
+						  unsigned int idx)
+{
+	if (comp->funcs && comp->funcs->get_sec_port)
+		return comp->funcs->get_sec_port(comp, idx);
+	return 0;
+}
+
 static inline void mtk_ddp_gamma_set(struct mtk_ddp_comp *comp,
 				     struct drm_crtc_state *state)
 {