All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 23/37] drm/i915: Move common seqno reset to intel_engine_cs.c
Date: Fri, 12 Aug 2016 07:54:13 +0100	[thread overview]
Message-ID: <1470984867-7132-23-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1470984867-7132-1-git-send-email-chris@chris-wilson.co.uk>

Since the intel_engine_init_seqno() is shared by all engine submission
backends, move it out of the legacy intel_ringbuffer.c and
into the new home for common routines, intel_engine_cs.c

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/intel_engine_cs.c  | 42 +++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_ringbuffer.c | 42 ---------------------------------
 2 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index 7104dec5e893..829624571ca4 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -161,6 +161,48 @@ cleanup:
 	return ret;
 }
 
+void intel_engine_init_seqno(struct intel_engine_cs *engine, u32 seqno)
+{
+	struct drm_i915_private *dev_priv = engine->i915;
+
+	/* Our semaphore implementation is strictly monotonic (i.e. we proceed
+	 * so long as the semaphore value in the register/page is greater
+	 * than the sync value), so whenever we reset the seqno,
+	 * so long as we reset the tracking semaphore value to 0, it will
+	 * always be before the next request's seqno. If we don't reset
+	 * the semaphore value, then when the seqno moves backwards all
+	 * future waits will complete instantly (causing rendering corruption).
+	 */
+	if (IS_GEN6(dev_priv) || IS_GEN7(dev_priv)) {
+		I915_WRITE(RING_SYNC_0(engine->mmio_base), 0);
+		I915_WRITE(RING_SYNC_1(engine->mmio_base), 0);
+		if (HAS_VEBOX(dev_priv))
+			I915_WRITE(RING_SYNC_2(engine->mmio_base), 0);
+	}
+	if (dev_priv->semaphore_obj) {
+		struct drm_i915_gem_object *obj = dev_priv->semaphore_obj;
+		struct page *page = i915_gem_object_get_dirty_page(obj, 0);
+		void *semaphores = kmap(page);
+		memset(semaphores + GEN8_SEMAPHORE_OFFSET(engine->id, 0),
+		       0, I915_NUM_ENGINES * gen8_semaphore_seqno_size);
+		kunmap(page);
+	}
+	memset(engine->semaphore.sync_seqno, 0,
+	       sizeof(engine->semaphore.sync_seqno));
+
+	intel_write_status_page(engine, I915_GEM_HWS_INDEX, seqno);
+	if (engine->irq_seqno_barrier)
+		engine->irq_seqno_barrier(engine);
+	engine->last_submitted_seqno = seqno;
+
+	engine->hangcheck.seqno = seqno;
+
+	/* After manually advancing the seqno, fake the interrupt in case
+	 * there are any waiters for that seqno.
+	 */
+	intel_engine_wakeup(engine);
+}
+
 void intel_engine_init_hangcheck(struct intel_engine_cs *engine)
 {
 	memset(&engine->hangcheck, 0, sizeof(engine->hangcheck));
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 0ecdd452a7f7..469059fc9f15 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -2313,48 +2313,6 @@ int intel_ring_cacheline_align(struct drm_i915_gem_request *req)
 	return 0;
 }
 
-void intel_engine_init_seqno(struct intel_engine_cs *engine, u32 seqno)
-{
-	struct drm_i915_private *dev_priv = engine->i915;
-
-	/* Our semaphore implementation is strictly monotonic (i.e. we proceed
-	 * so long as the semaphore value in the register/page is greater
-	 * than the sync value), so whenever we reset the seqno,
-	 * so long as we reset the tracking semaphore value to 0, it will
-	 * always be before the next request's seqno. If we don't reset
-	 * the semaphore value, then when the seqno moves backwards all
-	 * future waits will complete instantly (causing rendering corruption).
-	 */
-	if (IS_GEN6(dev_priv) || IS_GEN7(dev_priv)) {
-		I915_WRITE(RING_SYNC_0(engine->mmio_base), 0);
-		I915_WRITE(RING_SYNC_1(engine->mmio_base), 0);
-		if (HAS_VEBOX(dev_priv))
-			I915_WRITE(RING_SYNC_2(engine->mmio_base), 0);
-	}
-	if (dev_priv->semaphore_obj) {
-		struct drm_i915_gem_object *obj = dev_priv->semaphore_obj;
-		struct page *page = i915_gem_object_get_dirty_page(obj, 0);
-		void *semaphores = kmap(page);
-		memset(semaphores + GEN8_SEMAPHORE_OFFSET(engine->id, 0),
-		       0, I915_NUM_ENGINES * gen8_semaphore_seqno_size);
-		kunmap(page);
-	}
-	memset(engine->semaphore.sync_seqno, 0,
-	       sizeof(engine->semaphore.sync_seqno));
-
-	intel_write_status_page(engine, I915_GEM_HWS_INDEX, seqno);
-	if (engine->irq_seqno_barrier)
-		engine->irq_seqno_barrier(engine);
-	engine->last_submitted_seqno = seqno;
-
-	engine->hangcheck.seqno = seqno;
-
-	/* After manually advancing the seqno, fake the interrupt in case
-	 * there are any waiters for that seqno.
-	 */
-	intel_engine_wakeup(engine);
-}
-
 static void gen6_bsd_submit_request(struct drm_i915_gem_request *request)
 {
 	struct drm_i915_private *dev_priv = request->i915;
-- 
2.8.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-08-12  6:55 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12  6:53 [PATCH 01/37] drm/i915: Record the position of the start of the request Chris Wilson
2016-08-12  6:53 ` [PATCH 02/37] drm/i915: Reduce amount of duplicate buffer information captured on error Chris Wilson
2016-08-12  6:53 ` [PATCH 03/37] drm/i915: Stop the machine whilst capturing the GPU crash dump Chris Wilson
2016-08-12  6:53 ` [PATCH 04/37] drm/i915: Store the active context object on all engines upon error Chris Wilson
2016-08-12  6:53 ` [PATCH 05/37] drm/i915: Remove inactive/active list from debugfs Chris Wilson
2016-08-12  6:53 ` [PATCH 06/37] drm/i915: Focus debugfs/i915_gem_pinned to show only display pins Chris Wilson
2016-08-12  6:53 ` [PATCH 07/37] drm/i915: Reduce i915_gem_objects to only show object information Chris Wilson
2016-08-12  7:21   ` Joonas Lahtinen
2016-08-12  6:53 ` [PATCH 08/37] drm/i915: Record the device capabilities at the time of a hang Chris Wilson
2016-08-12  7:42   ` Joonas Lahtinen
2016-08-12  6:53 ` [PATCH 09/37] drm/i915: Remove redundant WARN_ON from __i915_add_request() Chris Wilson
2016-08-12  6:54 ` [PATCH 10/37] drm/i915: Always set the vma->pages Chris Wilson
2016-08-12  7:48   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 11/37] drm/i915: Create a VMA for an object Chris Wilson
2016-08-12  6:54 ` [PATCH 12/37] drm/i915: Add fetch_and_zero() macro Chris Wilson
2016-08-12  7:55   ` Joonas Lahtinen
2016-08-12  8:05     ` Chris Wilson
2016-08-12  6:54 ` [PATCH 13/37] drm/i915: Add convenience wrappers for vma's object get/put Chris Wilson
2016-08-12  8:03   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 14/37] drm/i915: Track pinned vma inside guc Chris Wilson
2016-08-12  9:42   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 15/37] drm/i915: Convert fence computations to use vma directly Chris Wilson
2016-08-12  6:54 ` [PATCH 16/37] drm/i915: Use VMA directly for checking tiling parameters Chris Wilson
2016-08-12  8:16   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 17/37] drm/i915: Use VMA as the primary object for context state Chris Wilson
2016-08-12  6:54 ` [PATCH 18/37] drm/i915: Only clflush the context object when binding Chris Wilson
2016-08-12  8:19   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 19/37] drm/i915: Move assertion for iomap access to i915_vma_pin_iomap Chris Wilson
2016-08-12  8:21   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 20/37] drm/i915: Use VMA for ringbuffer tracking Chris Wilson
2016-08-12  8:34   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 21/37] drm/i915: Use VMA for scratch page tracking Chris Wilson
2016-08-12  6:54 ` [PATCH 22/37] drm/i915: Move common scratch allocation/destroy to intel_engine_cs.c Chris Wilson
2016-08-12  8:40   ` Joonas Lahtinen
2016-08-12  6:54 ` Chris Wilson [this message]
2016-08-12  8:42   ` [PATCH 23/37] drm/i915: Move common seqno reset " Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 24/37] drm/i915/overlay: Use VMA as the primary tracker for images Chris Wilson
2016-08-12  6:54 ` [PATCH 25/37] drm/i915: Use VMA as the primary tracker for semaphore page Chris Wilson
2016-08-12  6:54 ` [PATCH 26/37] drm/i915: Use VMA for render state page tracking Chris Wilson
2016-08-12  6:54 ` [PATCH 27/37] drm/i915: Use VMA for wa_ctx tracking Chris Wilson
2016-08-12  6:54 ` [PATCH 28/37] drm/i915: Consolidate i915_vma_unpin_and_release() Chris Wilson
2016-08-12  8:45   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 29/37] drm/i915: Track pinned VMA Chris Wilson
2016-08-12  8:53   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 30/37] drm/i915: Introduce i915_ggtt_offset() Chris Wilson
2016-08-12  9:01   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 31/37] drm/i915: Print the batchbuffer offset next to BBADDR in error state Chris Wilson
2016-08-12  6:54 ` [PATCH 32/37] drm/i915: Move debug only per-request pid tracking from request to ctx Chris Wilson
2016-08-12  9:03   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 33/37] drm/i915: Only record active and pending requests upon a GPU hang Chris Wilson
2016-08-12 12:39   ` Matthew Auld
2016-08-12 12:49     ` Chris Wilson
2016-08-12  6:54 ` [PATCH 34/37] drm/i915: Record the RING_MODE register for post-mortem debugging Chris Wilson
2016-08-12  9:07   ` Joonas Lahtinen
2016-08-12  6:54 ` [PATCH 35/37] drm/i915: Always use the GTT for error capture Chris Wilson
2016-08-12  6:54 ` [PATCH 36/37] drm/i915: Consolidate error object printing Chris Wilson
2016-08-12  6:54 ` [PATCH 37/37] drm/i915: Compress GPU objects in error state Chris Wilson
2016-08-12  7:27 ` ✗ Ro.CI.BAT: failure for series starting with [01/37] drm/i915: Record the position of the start of the request Patchwork
2016-08-12  9:45 ` [PATCH 01/37] " Joonas Lahtinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1470984867-7132-23-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.