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: [CI 03/32] drm/i915: Store the active context object on all engines upon error
Date: Mon, 15 Aug 2016 10:48:42 +0100	[thread overview]
Message-ID: <1471254551-25805-3-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1471254551-25805-1-git-send-email-chris@chris-wilson.co.uk>

With execlists, we have context objects everywhere, not just RCS. So
store them for post-mortem debugging. This also has a secondary effect
of removing one more unsafe list iteration with using preserved state
from the hanging request. And now we can cross-reference the request's
context state with that loaded by the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 1c098fa65fbe..d11630bac188 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1043,28 +1043,6 @@ static void error_record_engine_registers(struct drm_i915_error_state *error,
 	}
 }
 
-static void i915_gem_record_active_context(struct intel_engine_cs *engine,
-					   struct drm_i915_error_state *error,
-					   struct drm_i915_error_engine *ee)
-{
-	struct drm_i915_private *dev_priv = engine->i915;
-	struct drm_i915_gem_object *obj;
-
-	/* Currently render ring is the only HW context user */
-	if (engine->id != RCS || !error->ccid)
-		return;
-
-	list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
-		if (!i915_gem_obj_ggtt_bound(obj))
-			continue;
-
-		if ((error->ccid & PAGE_MASK) == i915_gem_obj_ggtt_offset(obj)) {
-			ee->ctx = i915_error_ggtt_object_create(dev_priv, obj);
-			break;
-		}
-	}
-}
-
 static void i915_gem_record_rings(struct drm_i915_private *dev_priv,
 				  struct drm_i915_error_state *error)
 {
@@ -1114,6 +1092,10 @@ static void i915_gem_record_rings(struct drm_i915_private *dev_priv,
 					i915_error_ggtt_object_create(dev_priv,
 								      engine->scratch.obj);
 
+			ee->ctx =
+				i915_error_ggtt_object_create(dev_priv,
+							      request->ctx->engine[i].state);
+
 			if (request->pid) {
 				struct task_struct *task;
 
@@ -1144,8 +1126,6 @@ static void i915_gem_record_rings(struct drm_i915_private *dev_priv,
 		ee->wa_ctx = i915_error_ggtt_object_create(dev_priv,
 							   engine->wa_ctx.obj);
 
-		i915_gem_record_active_context(engine, error, ee);
-
 		count = 0;
 		list_for_each_entry(request, &engine->request_list, link)
 			count++;
-- 
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-15  9:49 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15  9:48 [CI 01/32] drm/i915: Record the position of the start of the request Chris Wilson
2016-08-15  9:48 ` [CI 02/32] drm/i915: Reduce amount of duplicate buffer information captured on error Chris Wilson
2016-08-15  9:48 ` Chris Wilson [this message]
2016-08-15  9:48 ` [CI 04/32] drm/i915: Remove inactive/active list from debugfs Chris Wilson
2016-08-15  9:48 ` [CI 05/32] drm/i915: Focus debugfs/i915_gem_pinned to show only display pins Chris Wilson
2016-08-15  9:48 ` [CI 06/32] drm/i915: Reduce i915_gem_objects to only show object information Chris Wilson
2016-08-15  9:48 ` [CI 07/32] drm/i915: Remove redundant WARN_ON from __i915_add_request() Chris Wilson
2016-08-15  9:48 ` [CI 08/32] drm/i915: Always set the vma->pages Chris Wilson
2016-08-15  9:48 ` [CI 09/32] drm/i915: Create a VMA for an object Chris Wilson
2016-08-15  9:48 ` [CI 10/32] drm/i915: Add fetch_and_zero() macro Chris Wilson
2016-08-15  9:48 ` [CI 11/32] drm/i915: Add convenience wrappers for vma's object get/put Chris Wilson
2016-08-15  9:48 ` [CI 12/32] drm/i915: Track pinned vma inside guc Chris Wilson
2016-08-15  9:48 ` [CI 13/32] drm/i915: Convert fence computations to use vma directly Chris Wilson
2016-08-15  9:48 ` [CI 14/32] drm/i915: Use VMA directly for checking tiling parameters Chris Wilson
2016-08-15  9:48 ` [CI 15/32] drm/i915: Use VMA as the primary object for context state Chris Wilson
2016-08-15  9:48 ` [CI 16/32] drm/i915: Only change the context object's domain when binding Chris Wilson
2016-08-15  9:48 ` [CI 17/32] drm/i915: Move assertion for iomap access to i915_vma_pin_iomap Chris Wilson
2016-08-15  9:48 ` [CI 18/32] drm/i915: Use VMA for ringbuffer tracking Chris Wilson
2016-08-15  9:48 ` [CI 19/32] drm/i915: Use VMA for scratch page tracking Chris Wilson
2016-08-15  9:48 ` [CI 20/32] drm/i915: Move common scratch allocation/destroy to intel_engine_cs.c Chris Wilson
2016-08-15  9:49 ` [CI 21/32] drm/i915: Move common seqno reset " Chris Wilson
2016-08-15  9:49 ` [CI 22/32] drm/i915/overlay: Use VMA as the primary tracker for images Chris Wilson
2016-08-15  9:49 ` [CI 23/32] drm/i915: Use VMA as the primary tracker for semaphore page Chris Wilson
2016-08-15  9:49 ` [CI 24/32] drm/i915: Use VMA for render state page tracking Chris Wilson
2016-08-15  9:49 ` [CI 25/32] drm/i915: Use VMA for wa_ctx tracking Chris Wilson
2016-08-15  9:49 ` [CI 26/32] drm/i915: Consolidate i915_vma_unpin_and_release() Chris Wilson
2016-08-15  9:49 ` [CI 27/32] drm/i915: Track pinned VMA Chris Wilson
2016-08-15  9:49 ` [CI 28/32] drm/i915: Introduce i915_ggtt_offset() Chris Wilson
2016-08-15  9:49 ` [CI 29/32] drm/i915: Move debug only per-request pid tracking from request to ctx Chris Wilson
2016-08-15  9:49 ` [CI 30/32] drm/i915: Print the batchbuffer offset next to BBADDR in error state Chris Wilson
2016-08-15  9:49 ` [CI 31/32] drm/i915: Only record active and pending requests upon a GPU hang Chris Wilson
2016-08-15  9:49 ` [CI 32/32] drm/i915: Record the RING_MODE register for post-mortem debugging Chris Wilson
2016-08-15 10:12 ` ✗ Ro.CI.BAT: failure for series starting with [CI,01/32] drm/i915: Record the position of the start of the request 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=1471254551-25805-3-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.