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 17/20] drm/i915/gt: Add some debug tracing for context pinning
Date: Tue, 25 Jun 2019 14:01:25 +0100	[thread overview]
Message-ID: <20190625130128.11009-17-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20190625130128.11009-1-chris@chris-wilson.co.uk>

Add the context pin/unpin events to the trace for post-mortem debugging.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_lrc.c        | 5 +++++
 drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 2bc25e3f83e6..ce1aba3604b3 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -1509,6 +1509,8 @@ static void execlists_context_destroy(struct kref *kref)
 
 static void execlists_context_unpin(struct intel_context *ce)
 {
+	GEM_TRACE("%s context:%llx unpin\n",
+		  ce->engine->name, ce->ring->timeline->fence_context);
 	i915_gem_context_unpin_hw_id(ce->gem_context);
 	i915_gem_object_unpin_map(ce->state->obj);
 }
@@ -1567,6 +1569,9 @@ __execlists_context_pin(struct intel_context *ce,
 	ce->lrc_desc = lrc_descriptor(ce, engine);
 	ce->lrc_reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE;
 	__execlists_update_reg_state(ce, engine);
+	GEM_TRACE("%s context:%llx pin ring:{head:%04x, tail:%04x}\n",
+		  engine->name, ce->ring->timeline->fence_context,
+		  ce->ring->head, ce->ring->tail);
 
 	return 0;
 
diff --git a/drivers/gpu/drm/i915/gt/intel_ringbuffer.c b/drivers/gpu/drm/i915/gt/intel_ringbuffer.c
index f094406dcc56..81f9b0422e6a 100644
--- a/drivers/gpu/drm/i915/gt/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/gt/intel_ringbuffer.c
@@ -1197,6 +1197,7 @@ int intel_ring_pin(struct intel_ring *ring)
 	GEM_BUG_ON(ring->vaddr);
 	ring->vaddr = addr;
 
+	GEM_TRACE("ring:%llx pin\n", ring->timeline->fence_context);
 	return 0;
 
 err_ring:
@@ -1223,6 +1224,8 @@ void intel_ring_unpin(struct intel_ring *ring)
 	if (!atomic_dec_and_test(&ring->pin_count))
 		return;
 
+	GEM_TRACE("ring:%llx unpin\n", ring->timeline->fence_context);
+
 	/* Discard any unused bytes beyond that submitted to hw. */
 	intel_ring_reset(ring, ring->tail);
 
-- 
2.20.1

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

  parent reply	other threads:[~2019-06-25 13:02 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25 13:01 [PATCH 01/20] drm/i915/execlists: Convert recursive defer_request() into iterative Chris Wilson
2019-06-25 13:01 ` [PATCH 02/20] drm/i915/gt: Pass intel_gt to pm routines Chris Wilson
2019-06-25 18:07   ` Matthew Auld
2019-06-25 13:01 ` [PATCH 03/20] drm/i915/selftests: Serialise nop reset with retirement Chris Wilson
2019-06-25 13:01 ` [PATCH 04/20] drm/i915/selftests: Drop manual request wakerefs around hangcheck Chris Wilson
2019-06-25 13:01 ` [PATCH 05/20] drm/i915/selftests: Fixup atomic reset checking Chris Wilson
2019-06-25 13:01 ` [PATCH 06/20] drm/i915: Rename intel_wakeref_[is]_active Chris Wilson
2019-06-25 13:01 ` [PATCH 07/20] drm/i915: Add a wakeref getter for iff the wakeref is already active Chris Wilson
2019-06-25 13:01 ` [PATCH 08/20] drm/i915: Only recover active engines Chris Wilson
2019-06-25 13:01 ` [PATCH 09/20] drm/i915: Lift intel_engines_resume() to callers Chris Wilson
2019-06-25 13:01 ` [PATCH 10/20] drm/i915: Teach execbuffer to take the engine wakeref not GT Chris Wilson
2019-06-25 13:01 ` [PATCH 11/20] drm/i915/gt: Track timeline activeness in enter/exit Chris Wilson
2019-06-25 13:01 ` [PATCH 12/20] drm/i915/gt: Convert timeline tracking to spinlock Chris Wilson
2019-06-25 13:01 ` [PATCH 13/20] drm/i915/gt: Guard timeline pinning with its own mutex Chris Wilson
2019-06-25 13:01 ` [PATCH 14/20] drm/i915/selftests: Hold ref on request across waits Chris Wilson
2019-06-25 18:39   ` Matthew Auld
2019-06-25 13:01 ` [PATCH 15/20] drm/i915/gt: Always call kref_init for the timeline Chris Wilson
2019-06-25 18:42   ` Matthew Auld
2019-06-25 13:01 ` [PATCH 16/20] drm/i915/gt: Drop stale commentary for timeline density Chris Wilson
2019-06-25 23:28   ` Daniele Ceraolo Spurio
2019-06-25 13:01 ` Chris Wilson [this message]
2019-06-25 18:47   ` [PATCH 17/20] drm/i915/gt: Add some debug tracing for context pinning Matthew Auld
2019-06-25 13:01 ` [PATCH 18/20] drm/i915: Include the breadcrumb when asserting request completion Chris Wilson
2019-06-25 14:42   ` [PATCH] " Chris Wilson
2019-06-25 13:01 ` [PATCH 19/20] drm/i915: Protect request retirement with timeline->mutex Chris Wilson
2019-06-25 13:01 ` [PATCH 20/20] drm/i915: Replace struct_mutex for batch pool serialisation Chris Wilson
2019-06-25 14:09 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/20] drm/i915/execlists: Convert recursive defer_request() into iterative Patchwork
2019-06-25 14:38 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-06-25 15:10 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/20] drm/i915/execlists: Convert recursive defer_request() into iterative (rev2) Patchwork
2019-06-25 15:18 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-06-25 15:45 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-06-25 18:01 ` [PATCH 01/20] drm/i915/execlists: Convert recursive defer_request() into iterative Matthew Auld
2019-06-25 18:19 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/20] drm/i915/execlists: Convert recursive defer_request() into iterative (rev3) Patchwork
2019-06-25 18:28 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-06-25 19:35 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-25 22:10 ` ✓ Fi.CI.IGT: " Patchwork

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=20190625130128.11009-17-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.