diff options
author | CK Hu <ck.hu@mediatek.com> | 2020-10-12 17:08:10 +0800 |
---|---|---|
committer | Chun-Kuang Hu <chunkuang.hu@kernel.org> | 2021-01-07 06:28:16 +0800 |
commit | 9b0704988b151824a51133dc4c921f4273c5d839 (patch) | |
tree | 26f6f71b32718663a12cc2416fffa560324b28a2 /drivers/gpu/drm/mediatek/mtk_disp_ovl.c | |
parent | 4d510659cf5d2c10f2793b41b02fe4cfdbd0bebe (diff) |
drm/mediatek: Register vblank callback function
Some ddp component exist in both display path and other path, so
sub driver should not directly call crtc function. crtc register
callback function to sub driver to prevent sub driver directly
call crtc function.
Signed-off-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_disp_ovl.c')
-rw-r--r-- | drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index 172d2c9cb988..3c1c1dde6fba 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -76,30 +76,33 @@ struct mtk_disp_ovl { void __iomem *regs; struct cmdq_client_reg cmdq_reg; const struct mtk_disp_ovl_data *data; + void (*vblank_cb)(void *data); + void *vblank_cb_data; }; static irqreturn_t mtk_disp_ovl_irq_handler(int irq, void *dev_id) { struct mtk_disp_ovl *priv = dev_id; - struct mtk_ddp_comp *ovl = &priv->ddp_comp; /* Clear frame completion interrupt */ writel(0x0, priv->regs + DISP_REG_OVL_INTSTA); - if (!priv->crtc) + if (!priv->vblank_cb) return IRQ_NONE; - mtk_crtc_ddp_irq(priv->crtc, ovl); + priv->vblank_cb(priv->vblank_cb_data); return IRQ_HANDLED; } static void mtk_ovl_enable_vblank(struct device *dev, - struct drm_crtc *crtc) + void (*vblank_cb)(void *), + void *vblank_cb_data) { struct mtk_disp_ovl *ovl = dev_get_drvdata(dev); - ovl->crtc = crtc; + ovl->vblank_cb = vblank_cb; + ovl->vblank_cb_data = vblank_cb_data; writel(0x0, ovl->regs + DISP_REG_OVL_INTSTA); writel_relaxed(OVL_FME_CPL_INT, ovl->regs + DISP_REG_OVL_INTEN); } @@ -108,7 +111,8 @@ static void mtk_ovl_disable_vblank(struct device *dev) { struct mtk_disp_ovl *ovl = dev_get_drvdata(dev); - ovl->crtc = NULL; + ovl->vblank_cb = NULL; + ovl->vblank_cb_data = NULL; writel_relaxed(0x0, ovl->regs + DISP_REG_OVL_INTEN); } |