[PATCHv2 41/45] drm: omapdrm: remove omap_crtc_wait_page_flip

Tomi Valkeinen tomi.valkeinen at ti.com
Thu Jun 4 02:02:58 PDT 2015


omap_crtc_disable() waits for pending page flips to finish. However,
omap_crtc_disable() is always called via omap_atomic_complete() and we
never have page flips going on at that time.

So remove the omap_crtc_wait_page_flip() and related code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ti.com>
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index abfafd1600b8..2c0d91a67418 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -51,7 +51,6 @@ struct omap_crtc {
 
 	/* pending event */
 	struct drm_pending_vblank_event *event;
-	wait_queue_head_t flip_wait;
 
 	struct completion completion;
 
@@ -277,41 +276,12 @@ static void omap_crtc_complete_page_flip(struct drm_crtc *crtc)
 		else
 			event->base.destroy(&event->base);
 
-		wake_up(&omap_crtc->flip_wait);
 		drm_crtc_vblank_put(crtc);
 	}
 
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 }
 
-static bool omap_crtc_page_flip_pending(struct drm_crtc *crtc)
-{
-	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
-	struct drm_device *dev = crtc->dev;
-	unsigned long flags;
-	bool pending;
-
-	spin_lock_irqsave(&dev->event_lock, flags);
-	pending = omap_crtc->event != NULL;
-	spin_unlock_irqrestore(&dev->event_lock, flags);
-
-	return pending;
-}
-
-static void omap_crtc_wait_page_flip(struct drm_crtc *crtc)
-{
-	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
-
-	if (wait_event_timeout(omap_crtc->flip_wait,
-			       !omap_crtc_page_flip_pending(crtc),
-			       msecs_to_jiffies(50)))
-		return;
-
-	dev_warn(crtc->dev->dev, "page flip timeout!\n");
-
-	omap_crtc_complete_page_flip(crtc);
-}
-
 static void omap_crtc_error_irq(struct omap_drm_irq *irq, uint32_t irqstatus)
 {
 	struct omap_crtc *omap_crtc =
@@ -404,7 +374,6 @@ static void omap_crtc_disable(struct drm_crtc *crtc)
 
 	DBG("%s", omap_crtc->name);
 
-	omap_crtc_wait_page_flip(crtc);
 	drm_crtc_vblank_off(crtc);
 }
 
@@ -541,7 +510,6 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
 
 	crtc = &omap_crtc->base;
 
-	init_waitqueue_head(&omap_crtc->flip_wait);
 	init_completion(&omap_crtc->completion);
 
 	omap_crtc->channel = channel;
-- 
2.1.4



More information about the dri-devel mailing list