[Intel-gfx] [RFC 5/7] drm/i915: Add flip_done_handler definition

Karthik B S karthik.b.s at intel.com
Fri Mar 6 11:39:25 UTC 2020


Send the flip done event in the handler and disable the interrupt.

Signed-off-by: Karthik B S <karthik.b.s at intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 5955e737a45d..1feda9aecf4a 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1243,6 +1243,24 @@ display_pipe_crc_irq_handler(struct drm_i915_private *dev_priv,
 			     u32 crc4) {}
 #endif
 
+static void flip_done_handler(struct drm_i915_private *dev_priv,
+			      unsigned int pipe)
+{
+	struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
+	struct drm_crtc_state *crtc_state = crtc->base.state;
+	struct drm_device *dev = &dev_priv->drm;
+	unsigned long irqflags;
+
+	spin_lock_irqsave(&dev->event_lock, irqflags);
+
+	if (crtc_state->event->base.event->type == DRM_EVENT_FLIP_COMPLETE) {
+		drm_crtc_send_vblank_event(&crtc->base, crtc_state->event);
+		crtc_state->event = NULL;
+	}
+
+	spin_unlock_irqrestore(&dev->event_lock, irqflags);
+	icl_disable_flip_done(&crtc->base);
+}
 
 static void hsw_pipe_crc_irq_handler(struct drm_i915_private *dev_priv,
 				     enum pipe pipe)
-- 
2.22.0



More information about the Intel-gfx mailing list