aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStu Hsieh <stu.hsieh@mediatek.com>2018-08-08 22:15:44 -0400
committerCK Hu <ck.hu@mediatek.com>2018-08-26 23:24:36 -0400
commit650afd49572b56a5c58134d4acfeb77acc69d622 (patch)
tree8a40f71b232f676ece478d49bf99c9ade61ea14f
parent94420a63cf784945061b7b5f38511b7a48f034eb (diff)
drm/mediatek: add function to get layer number for component
This patch add function to get layer number for component Signed-off-by: Stu Hsieh <stu.hsieh@mediatek.com> Signed-off-by: CK Hu <ck.hu@mediatek.com>
-rw-r--r--drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
index 7413ffeb3c9d..8399229e6ad2 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
@@ -78,6 +78,7 @@ struct mtk_ddp_comp_funcs {
78 void (*stop)(struct mtk_ddp_comp *comp); 78 void (*stop)(struct mtk_ddp_comp *comp);
79 void (*enable_vblank)(struct mtk_ddp_comp *comp, struct drm_crtc *crtc); 79 void (*enable_vblank)(struct mtk_ddp_comp *comp, struct drm_crtc *crtc);
80 void (*disable_vblank)(struct mtk_ddp_comp *comp); 80 void (*disable_vblank)(struct mtk_ddp_comp *comp);
81 unsigned int (*layer_nr)(struct mtk_ddp_comp *comp);
81 void (*layer_on)(struct mtk_ddp_comp *comp, unsigned int idx); 82 void (*layer_on)(struct mtk_ddp_comp *comp, unsigned int idx);
82 void (*layer_off)(struct mtk_ddp_comp *comp, unsigned int idx); 83 void (*layer_off)(struct mtk_ddp_comp *comp, unsigned int idx);
83 void (*layer_config)(struct mtk_ddp_comp *comp, unsigned int idx, 84 void (*layer_config)(struct mtk_ddp_comp *comp, unsigned int idx,
@@ -128,6 +129,14 @@ static inline void mtk_ddp_comp_disable_vblank(struct mtk_ddp_comp *comp)
128 comp->funcs->disable_vblank(comp); 129 comp->funcs->disable_vblank(comp);
129} 130}
130 131
132static inline unsigned int mtk_ddp_comp_layer_nr(struct mtk_ddp_comp *comp)
133{
134 if (comp->funcs && comp->funcs->layer_nr)
135 return comp->funcs->layer_nr(comp);
136
137 return 0;
138}
139
131static inline void mtk_ddp_comp_layer_on(struct mtk_ddp_comp *comp, 140static inline void mtk_ddp_comp_layer_on(struct mtk_ddp_comp *comp,
132 unsigned int idx) 141 unsigned int idx)
133{ 142{