[RFC PATCH 5/6] drm/hisilicon: use helper for arming crtc completion event

Andrzej Hajda a.hajda at samsung.com
Tue Sep 27 13:36:18 UTC 2016


Replace custom code with core helper.

Signed-off-by: Andrzej Hajda <a.hajda at samsung.com>
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
index c3707d4..26f8091 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -532,7 +532,6 @@ static void ade_crtc_atomic_flush(struct drm_crtc *crtc,
 {
 	struct ade_crtc *acrtc = to_ade_crtc(crtc);
 	struct ade_hw_ctx *ctx = acrtc->ctx;
-	struct drm_pending_vblank_event *event = crtc->state->event;
 	void __iomem *base = ctx->base;
 
 	/* only crtc is enabled regs take effect */
@@ -542,16 +541,7 @@ static void ade_crtc_atomic_flush(struct drm_crtc *crtc,
 		writel(ADE_ENABLE, base + ADE_EN);
 	}
 
-	if (event) {
-		crtc->state->event = NULL;
-
-		spin_lock_irq(&crtc->dev->event_lock);
-		if (drm_crtc_vblank_get(crtc) == 0)
-			drm_crtc_arm_vblank_event(crtc, event);
-		else
-			drm_crtc_send_vblank_event(crtc, event);
-		spin_unlock_irq(&crtc->dev->event_lock);
-	}
+	drm_crtc_arm_completion_event(crtc);
 }
 
 static const struct drm_crtc_helper_funcs ade_crtc_helper_funcs = {
-- 
2.7.4



More information about the dri-devel mailing list