diff mbox

[14/29] drm/i915: Convert mmio_flip::seqno to struct request

Message ID 1414694481-15724-15-git-send-email-John.C.Harrison@Intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

John Harrison Oct. 30, 2014, 6:41 p.m. UTC
From: John Harrison <John.C.Harrison@Intel.com>

Converted the mmio_flip 'seqno' value to be a request structure as part of the
on going seqno to request changes. This includes reference counting the request
being saved away to ensure it can not be retired and freed while the flip code
is still waiting on it.

For: VIZ-4377
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |   11 ++++++-----
 drivers/gpu/drm/i915/intel_drv.h     |    2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index fd488d2..2b4c2bc 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9374,15 +9374,15 @@  void intel_notify_mmio_flip(struct intel_engine_cs *ring)
 		struct intel_mmio_flip *mmio_flip;
 
 		mmio_flip = &intel_crtc->mmio_flip;
-		if (mmio_flip->seqno == 0)
+		if (mmio_flip->req == NULL)
 			continue;
 
 		if (ring->id != mmio_flip->ring_id)
 			continue;
 
-		if (i915_seqno_passed(seqno, mmio_flip->seqno)) {
+		if (i915_seqno_passed(seqno, i915_gem_request_get_seqno(mmio_flip->req))) {
 			intel_do_mmio_flip(intel_crtc);
-			mmio_flip->seqno = 0;
+			i915_gem_request_assign(&mmio_flip->req, NULL);
 			ring->irq_put(ring);
 		}
 	}
@@ -9400,7 +9400,7 @@  static int intel_queue_mmio_flip(struct drm_device *dev,
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	int ret;
 
-	if (WARN_ON(intel_crtc->mmio_flip.seqno))
+	if (WARN_ON(intel_crtc->mmio_flip.req))
 		return -EBUSY;
 
 	ret = intel_postpone_flip(obj);
@@ -9412,7 +9412,8 @@  static int intel_queue_mmio_flip(struct drm_device *dev,
 	}
 
 	spin_lock_irq(&dev_priv->mmio_flip_lock);
-	intel_crtc->mmio_flip.seqno = i915_gem_request_get_seqno(obj->last_write_req);
+	i915_gem_request_assign(&intel_crtc->mmio_flip.req,
+				obj->last_write_req);
 	intel_crtc->mmio_flip.ring_id = obj->ring->id;
 	spin_unlock_irq(&dev_priv->mmio_flip_lock);
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index d53ac23..296b1a0 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -400,7 +400,7 @@  struct intel_pipe_wm {
 };
 
 struct intel_mmio_flip {
-	u32 seqno;
+	struct drm_i915_gem_request *req;
 	u32 ring_id;
 };