All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/9] Capture more useful details in error state
@ 2016-02-10 15:50 Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 1/9] drm/i915/error: capture execlist state on error Arun Siluvery
                   ` (11 more replies)
  0 siblings, 12 replies; 18+ messages in thread
From: Arun Siluvery @ 2016-02-10 15:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

Few patches to capture more useful details in error state - these details
include execlist state, csb events and their decoded form, GuC firmware
fetch and load status, submission stats, WA ctx batch buffer.

GuC details are only captured if GuC submission is enabled.

Except WA ctx batch all other patches are already sent as part of preemption
patch series but these are independent patches; it may take a while before
preemption patches are reviewed, merged but these patches can be useful now so
extracted them from that series.

Example output looks like this,

  EXECLIST_STATUS: 0x00000301
  EXECLIST_CTX_ID: 0x00000000
  EXECLIST_CSBPTR: 0x00000505
  EXECLIST_CSB_WR: 5
  EXECLIST_CSB_RD: 5
  EXECLIST_CTX/CSB[0]: 0x000.00000 / 0x00000001 | I->A |      |      |      |      |      |     
  EXECLIST_CTX/CSB[1]: 0x000.00a33 / 0x00000018 |      |      |      | A->I | DONE |      |     
  EXECLIST_CTX/CSB[2]: 0x000.00000 / 0x00000001 | I->A |      |      |      |      |      |     
  EXECLIST_CTX/CSB[3]: 0x000.00a33 / 0x00000018 |      |      |      | A->I | DONE |      |     
  EXECLIST_CTX/CSB[4]: 0x000.00000 / 0x00000001 | I->A |      |      |      |      |      |     
  EXECLIST_CTX/CSB[5]: 0x000.00a33 / 0x00000018 |      |      |      | A->I | DONE |      |     

v1: http://www.spinics.net/lists/intel-gfx/msg86671.html


Arun Siluvery (1):
  drm/i915/error: Capture WA ctx batch in error state

Dave Gordon (8):
  drm/i915/error: capture execlist state on error
  drm/i915/error: capture ringbuffer pointed to by START
  drm/i915/error: report ctx id & desc for each request in the queue
  drm/i915/error: improve CSB reporting
  drm/i915/error: capture errored context based on request context-id
  drm/i915/error: enhanced error capture of requests
  drm/i915/guc: Improve action error reporting
  drm/i915/error: add GuC state error capture & decode

 drivers/gpu/drm/i915/i915_debugfs.c        |  17 +-
 drivers/gpu/drm/i915/i915_drv.h            |  24 ++-
 drivers/gpu/drm/i915/i915_gpu_error.c      | 299 ++++++++++++++++++++++++++---
 drivers/gpu/drm/i915/i915_guc_submission.c |  20 +-
 drivers/gpu/drm/i915/intel_guc.h           |   9 +-
 5 files changed, 324 insertions(+), 45 deletions(-)

-- 
1.9.1

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v2 1/9] drm/i915/error: capture execlist state on error
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
@ 2016-02-10 15:50 ` Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 2/9] drm/i915/error: capture ringbuffer pointed to by START Arun Siluvery
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Arun Siluvery @ 2016-02-10 15:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From: Dave Gordon <david.s.gordon@intel.com>

At present, execlist status/ctx_id and CSBs, not the submission queue

v2: dump execlist details only when they are enabled (Mika)

For: VIZ-2021
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h       |  9 +++++++++
 drivers/gpu/drm/i915/i915_gpu_error.c | 36 +++++++++++++++++++++++++++++++++--
 2 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8216665..6cca108 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -552,6 +552,15 @@ struct drm_i915_error_state {
 		u32 rc_psmi; /* sleep state */
 		u32 semaphore_mboxes[I915_NUM_RINGS - 1];
 
+		/* Execlists */
+		u32 execlist_status;
+		u32 execlist_ctx_id;
+		u32 execlist_csb_raw_pointer;
+		u32 execlist_csb_write_pointer;
+		u32 execlist_csb_read_pointer;
+		u32 execlist_csb[6];
+		u32 execlist_ctx[6];
+
 		struct drm_i915_error_object {
 			int page_count;
 			u64 gtt_offset;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 978c026..8efc8f9a 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -247,6 +247,7 @@ static void i915_ring_error_state(struct drm_i915_error_state_buf *m,
 				  int ring_idx)
 {
 	struct drm_i915_error_ring *ring = &error->ring[ring_idx];
+	int i;
 
 	if (!ring->valid)
 		return;
@@ -288,7 +289,6 @@ static void i915_ring_error_state(struct drm_i915_error_state_buf *m,
 		err_printf(m, "  GFX_MODE: 0x%08x\n", ring->vm_info.gfx_mode);
 
 		if (INTEL_INFO(dev)->gen >= 8) {
-			int i;
 			for (i = 0; i < 4; i++)
 				err_printf(m, "  PDP%d: 0x%016llx\n",
 					   i, ring->vm_info.pdp[i]);
@@ -304,6 +304,19 @@ static void i915_ring_error_state(struct drm_i915_error_state_buf *m,
 	err_printf(m, "  hangcheck: %s [%d]\n",
 		   hangcheck_action_to_str(ring->hangcheck_action),
 		   ring->hangcheck_score);
+
+	if (i915.enable_execlists) {
+		err_printf(m, "  EXECLIST_STATUS: 0x%08x\n", ring->execlist_status);
+		err_printf(m, "  EXECLIST_CTX_ID: 0x%08x\n", ring->execlist_ctx_id);
+		err_printf(m, "  EXECLIST_CSBPTR: 0x%08x\n", ring->execlist_csb_raw_pointer);
+		err_printf(m, "  EXECLIST_CSB_WR: 0x%08x\n", ring->execlist_csb_write_pointer);
+		err_printf(m, "  EXECLIST_CSB_RD: 0x%08x\n", ring->execlist_csb_read_pointer);
+
+		for (i = 0; i < 6; i++) {
+			err_printf(m, "  EXECLIST_CSB[%d]: 0x%08x\n", i, ring->execlist_csb[i]);
+			err_printf(m, "  EXECLIST_CTX[%d]: 0x%08x\n", i, ring->execlist_ctx[i]);
+		}
+	}
 }
 
 void i915_error_printf(struct drm_i915_error_state_buf *e, const char *f, ...)
@@ -965,8 +978,27 @@ static void i915_record_ring_state(struct drm_device *dev,
 					I915_READ(GEN8_RING_PDP_LDW(ring, i));
 			}
 	}
-}
 
+	if (i915.enable_execlists) {
+		int i;
+		u32 status_pointer = I915_READ(RING_CONTEXT_STATUS_PTR(ring));
+		u8 write_pointer = GEN8_CSB_WRITE_PTR(status_pointer);
+		u8 read_pointer = ring->next_context_status_buffer;
+		if (read_pointer > write_pointer)
+			write_pointer += GEN8_CSB_ENTRIES;
+
+		ering->execlist_status = I915_READ(RING_EXECLIST_STATUS_LO(ring));
+		ering->execlist_ctx_id = I915_READ(RING_EXECLIST_STATUS_HI(ring));
+		ering->execlist_csb_raw_pointer = status_pointer;
+		ering->execlist_csb_write_pointer = write_pointer;
+		ering->execlist_csb_read_pointer = read_pointer;
+
+		for (i = 0; i < GEN8_CSB_ENTRIES; i++) {
+			ering->execlist_csb[i] = I915_READ(RING_CONTEXT_STATUS_BUF_LO(ring, i));
+			ering->execlist_ctx[i] = I915_READ(RING_CONTEXT_STATUS_BUF_HI(ring, i));
+		}
+	}
+}
 
 static void i915_gem_record_active_context(struct intel_engine_cs *ring,
 					   struct drm_i915_error_state *error,
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 2/9] drm/i915/error: capture ringbuffer pointed to by START
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 1/9] drm/i915/error: capture execlist state on error Arun Siluvery
@ 2016-02-10 15:50 ` Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 3/9] drm/i915/error: report ctx id & desc for each request in the queue Arun Siluvery
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Arun Siluvery @ 2016-02-10 15:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From: Dave Gordon <david.s.gordon@intel.com>

For: VIZ-2021
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h       |  2 +-
 drivers/gpu/drm/i915/i915_gpu_error.c | 36 +++++++++++++++++++++++++----------
 2 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 6cca108..84bbd98 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -565,7 +565,7 @@ struct drm_i915_error_state {
 			int page_count;
 			u64 gtt_offset;
 			u32 *pages[0];
-		} *ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page;
+		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page;
 
 		struct drm_i915_error_request {
 			long jiffies;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 8efc8f9a..d4d46ac 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -477,13 +477,20 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 			}
 		}
 
-		if ((obj = error->ring[i].ringbuffer)) {
+		if ((obj = error->ring[i].req_ringbuffer)) {
 			err_printf(m, "%s --- ringbuffer = 0x%08x\n",
 				   dev_priv->ring[i].name,
 				   lower_32_bits(obj->gtt_offset));
 			print_error_obj(m, obj);
 		}
 
+		if ((obj = error->ring[i].hw_ringbuffer)) {
+			err_printf(m, "%s --- HW ringbuffer = 0x%08x\n",
+				   dev_priv->ring[i].name,
+				   lower_32_bits(obj->gtt_offset));
+			print_error_obj(m, obj);
+		}
+
 		if ((obj = error->ring[i].hws_page)) {
 			u64 hws_offset = obj->gtt_offset;
 			u32 *hws_page = &obj->pages[0][0];
@@ -594,7 +601,8 @@ static void i915_error_state_free(struct kref *error_ref)
 	for (i = 0; i < ARRAY_SIZE(error->ring); i++) {
 		i915_error_object_free(error->ring[i].batchbuffer);
 		i915_error_object_free(error->ring[i].wa_batchbuffer);
-		i915_error_object_free(error->ring[i].ringbuffer);
+		i915_error_object_free(error->ring[i].req_ringbuffer);
+		i915_error_object_free(error->ring[i].hw_ringbuffer);
 		i915_error_object_free(error->ring[i].hws_page);
 		i915_error_object_free(error->ring[i].ctx);
 		kfree(error->ring[i].requests);
@@ -1006,19 +1014,27 @@ static void i915_gem_record_active_context(struct intel_engine_cs *ring,
 {
 	struct drm_i915_private *dev_priv = ring->dev->dev_private;
 	struct drm_i915_gem_object *obj;
-
-	/* Currently render ring is the only HW context user */
-	if (ring->id != RCS || !error->ccid)
-		return;
+	u64 base;
 
 	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)) {
-			ering->ctx = i915_error_ggtt_object_create(dev_priv, obj);
-			break;
+		base = i915_gem_obj_ggtt_offset(obj);
+
+		if (base == ering->start) {
+			ering->hw_ringbuffer = i915_error_ggtt_object_create(dev_priv, obj);
+			continue;
 		}
+
+		if (!error->ccid)
+			continue;
+
+		if (i915.enable_execlists)
+			base += LRC_PPHWSP_PN * PAGE_SIZE;
+
+		if (base == (error->ccid & PAGE_MASK))
+			ering->ctx = i915_error_ggtt_object_create(dev_priv, obj);
 	}
 }
 
@@ -1093,7 +1109,7 @@ static void i915_gem_record_rings(struct drm_device *dev,
 		error->ring[i].cpu_ring_head = rbuf->head;
 		error->ring[i].cpu_ring_tail = rbuf->tail;
 
-		error->ring[i].ringbuffer =
+		error->ring[i].req_ringbuffer =
 			i915_error_ggtt_object_create(dev_priv, rbuf->obj);
 
 		error->ring[i].hws_page =
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 3/9] drm/i915/error: report ctx id & desc for each request in the queue
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 1/9] drm/i915/error: capture execlist state on error Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 2/9] drm/i915/error: capture ringbuffer pointed to by START Arun Siluvery
@ 2016-02-10 15:50 ` Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 4/9] drm/i915/error: improve CSB reporting Arun Siluvery
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Arun Siluvery @ 2016-02-10 15:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From: Dave Gordon <david.s.gordon@intel.com>

Also decode and output CSB entries, in time order

For: VIZ-2021
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h       |  1 +
 drivers/gpu/drm/i915/i915_gpu_error.c | 37 +++++++++++++++++++++++++++--------
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 84bbd98..cb8de49 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -568,6 +568,7 @@ struct drm_i915_error_state {
 		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page;
 
 		struct drm_i915_error_request {
+			uint64_t ctx_desc;
 			long jiffies;
 			u32 seqno;
 			u32 tail;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index d4d46ac..ac83f91 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -312,9 +312,25 @@ static void i915_ring_error_state(struct drm_i915_error_state_buf *m,
 		err_printf(m, "  EXECLIST_CSB_WR: 0x%08x\n", ring->execlist_csb_write_pointer);
 		err_printf(m, "  EXECLIST_CSB_RD: 0x%08x\n", ring->execlist_csb_read_pointer);
 
-		for (i = 0; i < 6; i++) {
-			err_printf(m, "  EXECLIST_CSB[%d]: 0x%08x\n", i, ring->execlist_csb[i]);
-			err_printf(m, "  EXECLIST_CTX[%d]: 0x%08x\n", i, ring->execlist_ctx[i]);
+#define GEN8_CTX_STATUS_IDLE_ACTIVE	(1 << 0)
+#define GEN8_CTX_STATUS_PREEMPTED	(1 << 1)
+#define GEN8_CTX_STATUS_ELEMENT_SWITCH	(1 << 2)
+#define GEN8_CTX_STATUS_ACTIVE_IDLE	(1 << 3)
+#define GEN8_CTX_STATUS_COMPLETE	(1 << 4)
+#define GEN8_CTX_STATUS_LITE_RESTORE	(1 << 15)
+
+		for (i = 1; i <= GEN8_CSB_ENTRIES; ++i) {
+			int n = (ring->execlist_csb_write_pointer + i) % GEN8_CSB_ENTRIES;
+			u32 csb = ring->execlist_csb[n];
+			err_printf(m, "  EXECLIST_CTX/CSB[%d]:  0x%08x  0x%08x  ",
+				   n, ring->execlist_ctx[n], csb);
+			err_printf(m, "%s %s %s %s %s %s\n",
+				   csb & GEN8_CTX_STATUS_IDLE_ACTIVE	? "I->A" : "    ",
+				   csb & GEN8_CTX_STATUS_PREEMPTED		? "PRMT" : "    ",
+				   csb & GEN8_CTX_STATUS_ELEMENT_SWITCH	? "ELSW" : "    ",
+				   csb & GEN8_CTX_STATUS_ACTIVE_IDLE	? "A->I" : "    ",
+				   csb & GEN8_CTX_STATUS_COMPLETE		? "DONE" : "    ",
+				   csb & GEN8_CTX_STATUS_LITE_RESTORE	? "LITE" : "    ");
 		}
 	}
 }
@@ -470,10 +486,13 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 				   dev_priv->ring[i].name,
 				   error->ring[i].num_requests);
 			for (j = 0; j < error->ring[i].num_requests; j++) {
-				err_printf(m, "  seqno 0x%08x, emitted %ld, tail 0x%08x\n",
-					   error->ring[i].requests[j].seqno,
-					   error->ring[i].requests[j].jiffies,
-					   error->ring[i].requests[j].tail);
+				struct drm_i915_error_request *erq;
+				erq = &error->ring[i].requests[j];
+				err_printf(m, "  seqno 0x%08x, tail 0x%08x, "
+					"emitted %ld, ctx_desc 0x%08x_%08x\n",
+					erq->seqno, erq->tail, erq->jiffies,
+					upper_32_bits(erq->ctx_desc),
+					lower_32_bits(erq->ctx_desc));
 			}
 		}
 
@@ -1132,6 +1151,7 @@ static void i915_gem_record_rings(struct drm_device *dev,
 
 		count = 0;
 		list_for_each_entry(request, &ring->request_list, list) {
+			struct intel_context *ctx = request->ctx;
 			struct drm_i915_error_request *erq;
 
 			if (count >= error->ring[i].num_requests) {
@@ -1154,8 +1174,9 @@ static void i915_gem_record_rings(struct drm_device *dev,
 			}
 
 			erq = &error->ring[i].requests[count++];
-			erq->seqno = request->seqno;
+			erq->ctx_desc = intel_lr_context_descriptor(ctx, ring);
 			erq->jiffies = request->emitted_jiffies;
+			erq->seqno = request->seqno;
 			erq->tail = request->postfix;
 		}
 	}
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 4/9] drm/i915/error: improve CSB reporting
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
                   ` (2 preceding siblings ...)
  2016-02-10 15:50 ` [PATCH v2 3/9] drm/i915/error: report ctx id & desc for each request in the queue Arun Siluvery
@ 2016-02-10 15:50 ` Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 5/9] drm/i915/error: capture errored context based on request context-id Arun Siluvery
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Arun Siluvery @ 2016-02-10 15:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From: Dave Gordon <david.s.gordon@intel.com>

v2: add separators for readability

For: VIZ-2021
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com> (v2)
---
 drivers/gpu/drm/i915/i915_drv.h       |  4 +-
 drivers/gpu/drm/i915/i915_gpu_error.c | 77 +++++++++++++++++++++++++----------
 2 files changed, 58 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index cb8de49..549478f 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -561,6 +561,8 @@ struct drm_i915_error_state {
 		u32 execlist_csb[6];
 		u32 execlist_ctx[6];
 
+		u64 ctx_desc;
+
 		struct drm_i915_error_object {
 			int page_count;
 			u64 gtt_offset;
@@ -568,7 +570,7 @@ struct drm_i915_error_state {
 		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page;
 
 		struct drm_i915_error_request {
-			uint64_t ctx_desc;
+			u64 ctx_desc;
 			long jiffies;
 			u32 seqno;
 			u32 tail;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index ac83f91..bdbc7ed 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -306,31 +306,57 @@ static void i915_ring_error_state(struct drm_i915_error_state_buf *m,
 		   ring->hangcheck_score);
 
 	if (i915.enable_execlists) {
+		u32 csb_rd = GEN8_CSB_READ_PTR(ring->execlist_csb_raw_pointer);
+
 		err_printf(m, "  EXECLIST_STATUS: 0x%08x\n", ring->execlist_status);
 		err_printf(m, "  EXECLIST_CTX_ID: 0x%08x\n", ring->execlist_ctx_id);
 		err_printf(m, "  EXECLIST_CSBPTR: 0x%08x\n", ring->execlist_csb_raw_pointer);
-		err_printf(m, "  EXECLIST_CSB_WR: 0x%08x\n", ring->execlist_csb_write_pointer);
-		err_printf(m, "  EXECLIST_CSB_RD: 0x%08x\n", ring->execlist_csb_read_pointer);
+		err_printf(m, "  EXECLIST_CSB_WR: %d\n", ring->execlist_csb_write_pointer);
+		err_printf(m, "  EXECLIST_CSB_RD: %d\n", csb_rd);
+
+		for (i = 1; i <= GEN8_CSB_ENTRIES; ++i) {
+			int n = (ring->execlist_csb_write_pointer + i) % GEN8_CSB_ENTRIES;
+			u32 ctxid = ring->execlist_ctx[n];
+			u32 csb = ring->execlist_csb[n];
+			u32 tag = 0;
+			char dot = '.';
+			err_printf(m, "  EXECLIST_CTX/CSB[%d]: ", n);
+
+			if (ctxid && i915.enable_guc_submission) {
+				/* GuC CtxID is ring + flags + (lrca >> 12) */
+				tag = ((ring_idx << 9) | 1);
+			}
+			if ((ctxid >> 20) != tag)
+				dot = '?';		/* flag unexpected value */
+			err_printf(m, "0x%03x%c%05x / ",
+				ctxid >> 20, dot, ctxid & 0x000fffff);
 
+/* CSB status bits */
 #define GEN8_CTX_STATUS_IDLE_ACTIVE	(1 << 0)
 #define GEN8_CTX_STATUS_PREEMPTED	(1 << 1)
 #define GEN8_CTX_STATUS_ELEMENT_SWITCH	(1 << 2)
 #define GEN8_CTX_STATUS_ACTIVE_IDLE	(1 << 3)
 #define GEN8_CTX_STATUS_COMPLETE	(1 << 4)
 #define GEN8_CTX_STATUS_LITE_RESTORE	(1 << 15)
-
-		for (i = 1; i <= GEN8_CSB_ENTRIES; ++i) {
-			int n = (ring->execlist_csb_write_pointer + i) % GEN8_CSB_ENTRIES;
-			u32 csb = ring->execlist_csb[n];
-			err_printf(m, "  EXECLIST_CTX/CSB[%d]:  0x%08x  0x%08x  ",
-				   n, ring->execlist_ctx[n], csb);
-			err_printf(m, "%s %s %s %s %s %s\n",
-				   csb & GEN8_CTX_STATUS_IDLE_ACTIVE	? "I->A" : "    ",
-				   csb & GEN8_CTX_STATUS_PREEMPTED		? "PRMT" : "    ",
-				   csb & GEN8_CTX_STATUS_ELEMENT_SWITCH	? "ELSW" : "    ",
-				   csb & GEN8_CTX_STATUS_ACTIVE_IDLE	? "A->I" : "    ",
-				   csb & GEN8_CTX_STATUS_COMPLETE		? "DONE" : "    ",
-				   csb & GEN8_CTX_STATUS_LITE_RESTORE	? "LITE" : "    ");
+#define GEN8_CTX_STATUS_UNKNOWN		(~0x0000801f)	/* any other */
+
+			err_printf(m, "0x%08x | %s | %s | %s | %s | %s | %s | %s\n",
+				csb,
+				csb & GEN8_CTX_STATUS_IDLE_ACTIVE	? "I->A" : "    ",
+				csb & GEN8_CTX_STATUS_PREEMPTED		? "PRMT" : "    ",
+				csb & GEN8_CTX_STATUS_ELEMENT_SWITCH	? "ELSW" : "    ",
+				csb & GEN8_CTX_STATUS_ACTIVE_IDLE	? "A->I" : "    ",
+				csb & GEN8_CTX_STATUS_COMPLETE		? "DONE" : "    ",
+				csb & GEN8_CTX_STATUS_LITE_RESTORE	? "LITE" : "    ",
+				csb & GEN8_CTX_STATUS_UNKNOWN		? " +? " : "    ");
+
+			if (i != 6) {
+				if (n == csb_rd)
+					err_printf(m, "                  *RD*\n");
+				else if (n == ring->execlist_csb_read_pointer &&
+					 !i915.enable_guc_submission)
+					err_printf(m, "                  *SW*\n");
+			}
 		}
 	}
 }
@@ -497,9 +523,11 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 		}
 
 		if ((obj = error->ring[i].req_ringbuffer)) {
-			err_printf(m, "%s --- ringbuffer = 0x%08x\n",
+			err_printf(m, "%s --- ringbuffer = 0x%08x (ctx_desc 0x%08x_%08x)\n",
 				   dev_priv->ring[i].name,
-				   lower_32_bits(obj->gtt_offset));
+				   lower_32_bits(obj->gtt_offset),
+				   upper_32_bits(error->ring[i].ctx_desc),
+				   lower_32_bits(error->ring[i].ctx_desc));
 			print_error_obj(m, obj);
 		}
 
@@ -1011,6 +1039,7 @@ static void i915_record_ring_state(struct drm_device *dev,
 		u32 status_pointer = I915_READ(RING_CONTEXT_STATUS_PTR(ring));
 		u8 write_pointer = GEN8_CSB_WRITE_PTR(status_pointer);
 		u8 read_pointer = ring->next_context_status_buffer;
+
 		if (read_pointer > write_pointer)
 			write_pointer += GEN8_CSB_ENTRIES;
 
@@ -1062,6 +1091,7 @@ static void i915_gem_record_rings(struct drm_device *dev,
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_i915_gem_request *request;
+	u64 ctx_desc;
 	int i, count;
 
 	for (i = 0; i < I915_NUM_RINGS; i++) {
@@ -1118,16 +1148,19 @@ static void i915_gem_record_rings(struct drm_device *dev,
 			 * for it to be useful (e.g. dump the context being
 			 * executed).
 			 */
-			if (request)
-				rbuf = request->ctx->engine[ring->id].ringbuf;
-			else
-				rbuf = dev_priv->kernel_context->engine[ring->id].ringbuf;
-		} else
+			struct intel_context *ctx = (request ? request->ctx :
+						     dev_priv->kernel_context);
+			ctx_desc = intel_lr_context_descriptor(ctx, ring);
+			rbuf = ctx->engine[ring->id].ringbuf;
+		} else {
+			ctx_desc = 0;
 			rbuf = ring->buffer;
+		}
 
 		error->ring[i].cpu_ring_head = rbuf->head;
 		error->ring[i].cpu_ring_tail = rbuf->tail;
 
+		error->ring[i].ctx_desc = ctx_desc;
 		error->ring[i].req_ringbuffer =
 			i915_error_ggtt_object_create(dev_priv, rbuf->obj);
 
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 5/9] drm/i915/error: capture errored context based on request context-id
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
                   ` (3 preceding siblings ...)
  2016-02-10 15:50 ` [PATCH v2 4/9] drm/i915/error: improve CSB reporting Arun Siluvery
@ 2016-02-10 15:50 ` Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 6/9] drm/i915/error: enhanced error capture of requests Arun Siluvery
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Arun Siluvery @ 2016-02-10 15:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From: Dave Gordon <david.s.gordon@intel.com>

Context capture hasn't worked for a while now, probably since the
introduction of execlists; this patch makes it work again by using
a different way of identifying the context of interest.

For: VIZ-2021
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index bdbc7ed..c599df6 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1075,13 +1075,12 @@ static void i915_gem_record_active_context(struct intel_engine_cs *ring,
 			continue;
 		}
 
-		if (!error->ccid)
-			continue;
-
 		if (i915.enable_execlists)
 			base += LRC_PPHWSP_PN * PAGE_SIZE;
 
-		if (base == (error->ccid & PAGE_MASK))
+		if (error->ccid && base == (error->ccid & PAGE_MASK))
+			ering->ctx = i915_error_ggtt_object_create(dev_priv, obj);
+		else if (((base ^ ering->ctx_desc) & 0x00000000FFFFF000ULL) == 0)
 			ering->ctx = i915_error_ggtt_object_create(dev_priv, obj);
 	}
 }
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 6/9] drm/i915/error: enhanced error capture of requests
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
                   ` (4 preceding siblings ...)
  2016-02-10 15:50 ` [PATCH v2 5/9] drm/i915/error: capture errored context based on request context-id Arun Siluvery
@ 2016-02-10 15:50 ` Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 7/9] drm/i915/guc: Improve action error reporting Arun Siluvery
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Arun Siluvery @ 2016-02-10 15:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From: Dave Gordon <david.s.gordon@intel.com>

Record a few more things about the requests outstanding at the time of
capture ...

For: VIZ-2021
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h       |  6 +++++-
 drivers/gpu/drm/i915/i915_gpu_error.c | 23 +++++++++++++++++------
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 549478f..ed991bf 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -564,8 +564,9 @@ struct drm_i915_error_state {
 		u64 ctx_desc;
 
 		struct drm_i915_error_object {
-			int page_count;
 			u64 gtt_offset;
+			bool is_ppgtt;
+			int page_count;
 			u32 *pages[0];
 		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page;
 
@@ -573,7 +574,10 @@ struct drm_i915_error_state {
 			u64 ctx_desc;
 			long jiffies;
 			u32 seqno;
+			u32 head;
 			u32 tail;
+			u32 submission_count;
+			u64 ringbuffer_gtt;
 		} *requests;
 
 		struct {
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index c599df6..03485ca 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -493,9 +493,11 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 				err_printf(m, " (submitted by %s [%d])",
 					   error->ring[i].comm,
 					   error->ring[i].pid);
-			err_printf(m, " --- gtt_offset = 0x%08x %08x\n",
+			err_printf(m, " --- %sgtt_offset = 0x%08x %08x; %d pages\n",
+				   obj->is_ppgtt ? "pp" : "g",
 				   upper_32_bits(obj->gtt_offset),
-				   lower_32_bits(obj->gtt_offset));
+				   lower_32_bits(obj->gtt_offset),
+				   obj->page_count);
 			print_error_obj(m, obj);
 		}
 
@@ -514,9 +516,13 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 			for (j = 0; j < error->ring[i].num_requests; j++) {
 				struct drm_i915_error_request *erq;
 				erq = &error->ring[i].requests[j];
-				err_printf(m, "  seqno 0x%08x, tail 0x%08x, "
-					"emitted %ld, ctx_desc 0x%08x_%08x\n",
-					erq->seqno, erq->tail, erq->jiffies,
+				err_printf(m, "  seqno 0x%08x, ringbuf 0x%llx "
+					      "head 0x%08x tail 0x%08x, "
+					      "emitted %ld, %d submissions, "
+					      "ctx_desc 0x%08x_%08x\n",
+					erq->seqno, erq->ringbuffer_gtt,
+					erq->head, erq->tail,
+					erq->jiffies, erq->submission_count,
 					upper_32_bits(erq->ctx_desc),
 					lower_32_bits(erq->ctx_desc));
 			}
@@ -698,6 +704,8 @@ i915_error_object_create(struct drm_i915_private *dev_priv,
 	reloc_offset = dst->gtt_offset;
 	if (i915_is_ggtt(vm))
 		vma = i915_gem_obj_to_ggtt(src);
+	else
+		dst->is_ppgtt = true;
 	use_ggtt = (src->cache_level == I915_CACHE_NONE &&
 		   vma && (vma->bound & GLOBAL_BIND) &&
 		   reloc_offset + num_pages * PAGE_SIZE <= dev_priv->gtt.mappable_end);
@@ -1209,7 +1217,10 @@ static void i915_gem_record_rings(struct drm_device *dev,
 			erq->ctx_desc = intel_lr_context_descriptor(ctx, ring);
 			erq->jiffies = request->emitted_jiffies;
 			erq->seqno = request->seqno;
-			erq->tail = request->postfix;
+			erq->tail = request->tail;
+			erq->head = request->head;
+			erq->submission_count = request->elsp_submitted;
+			erq->ringbuffer_gtt = i915_gem_obj_ggtt_offset(request->ringbuf->obj);
 		}
 	}
 }
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 7/9] drm/i915/guc: Improve action error reporting
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
                   ` (5 preceding siblings ...)
  2016-02-10 15:50 ` [PATCH v2 6/9] drm/i915/error: enhanced error capture of requests Arun Siluvery
@ 2016-02-10 15:50 ` Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 8/9] drm/i915/error: add GuC state error capture & decode Arun Siluvery
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Arun Siluvery @ 2016-02-10 15:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From: Dave Gordon <david.s.gordon@intel.com>

For: VIZ-2021
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c        | 17 ++++++++++-------
 drivers/gpu/drm/i915/i915_guc_submission.c | 20 ++++++++++++--------
 drivers/gpu/drm/i915/intel_guc.h           |  9 +++++++--
 3 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index ec0c2a05e..2a326ad 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2495,19 +2495,22 @@ static int i915_guc_info(struct seq_file *m, void *data)
 	mutex_unlock(&dev->struct_mutex);
 
 	seq_printf(m, "GuC total action count: %llu\n", guc.action_count);
-	seq_printf(m, "GuC action failure count: %u\n", guc.action_fail);
 	seq_printf(m, "GuC last action command: 0x%x\n", guc.action_cmd);
 	seq_printf(m, "GuC last action status: 0x%x\n", guc.action_status);
-	seq_printf(m, "GuC last action error code: %d\n", guc.action_err);
+
+	seq_printf(m, "GuC action failure count: %u\n", guc.action_fail_count);
+	seq_printf(m, "GuC last failed action: 0x%x\n", guc.action_fail_cmd);
+	seq_printf(m, "GuC last failed status: 0x%x\n", guc.action_fail_status);
+	seq_printf(m, "GuC last error code: %d\n", guc.action_err);
 
 	seq_printf(m, "\nGuC submissions:\n");
 	for_each_ring(ring, dev_priv, i) {
-		seq_printf(m, "\t%-24s: %10llu, last seqno 0x%08x\n",
-			ring->name, guc.submissions[ring->guc_id],
-			guc.last_seqno[ring->guc_id]);
-		total += guc.submissions[ring->guc_id];
+		seq_printf(m, "\t%-24s: %10llu, last %-8s 0x%08x %9d\n",
+			   ring->name, guc.submissions[i], "seqno",
+			   guc.last_seqno[i], guc.last_seqno[i]);
+		total += guc.submissions[i];
 	}
-	seq_printf(m, "\t%s: %llu\n", "Total", total);
+	seq_printf(m, "\t%s: %10llu\n", "Total regular", total);
 
 	seq_printf(m, "\nGuC execbuf client @ %p:\n", guc.execbuf_client);
 	i915_guc_client_info(m, dev_priv, &client);
diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
index d7543ef..8b0a34d 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -78,9 +78,8 @@ static inline bool host2guc_action_response(struct drm_i915_private *dev_priv,
 static int host2guc_action(struct intel_guc *guc, u32 *data, u32 len)
 {
 	struct drm_i915_private *dev_priv = guc_to_i915(guc);
-	u32 status;
-	int i;
-	int ret;
+	u32 status, response;
+	int ret, i;
 
 	if (WARN_ON(len < 1 || len > 15))
 		return -EINVAL;
@@ -99,6 +98,8 @@ static int host2guc_action(struct intel_guc *guc, u32 *data, u32 len)
 
 	/* No HOST2GUC command should take longer than 10ms */
 	ret = wait_for_atomic(host2guc_action_response(dev_priv, &status), 10);
+	response = I915_READ(SOFT_SCRATCH(15));
+	dev_priv->guc.action_status = status;
 	if (status != GUC2HOST_STATUS_SUCCESS) {
 		/*
 		 * Either the GuC explicitly returned an error (which
@@ -108,15 +109,15 @@ static int host2guc_action(struct intel_guc *guc, u32 *data, u32 len)
 		if (ret != -ETIMEDOUT)
 			ret = -EIO;
 
-		DRM_ERROR("GUC: host2guc action 0x%X failed. ret=%d "
+		DRM_ERROR("GuC: host2guc action 0x%X failed. ret=%d "
 				"status=0x%08X response=0x%08X\n",
-				data[0], ret, status,
-				I915_READ(SOFT_SCRATCH(15)));
+				data[0], ret, status, response);
 
-		dev_priv->guc.action_fail += 1;
+		dev_priv->guc.action_fail_count += 1;
+		dev_priv->guc.action_fail_cmd = data[0];
+		dev_priv->guc.action_fail_status = status;
 		dev_priv->guc.action_err = ret;
 	}
-	dev_priv->guc.action_status = status;
 
 	intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
 
@@ -589,6 +590,9 @@ int i915_guc_submit(struct i915_guc_client *client,
 	guc->submissions[engine_id] += 1;
 	guc->last_seqno[engine_id] = rq->seqno;
 
+	if (q_ret)
+		guc->failures[engine_id] += 1;
+
 	return q_ret;
 }
 
diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h
index 73002e9..c3281e7 100644
--- a/drivers/gpu/drm/i915/intel_guc.h
+++ b/drivers/gpu/drm/i915/intel_guc.h
@@ -103,11 +103,16 @@ struct intel_guc {
 	uint64_t action_count;		/* Total commands issued	*/
 	uint32_t action_cmd;		/* Last command word		*/
 	uint32_t action_status;		/* Last return status		*/
-	uint32_t action_fail;		/* Total number of failures	*/
-	int32_t action_err;		/* Last error code		*/
 
+	uint32_t action_fail_count;	/* Total number of failures	*/
+	uint32_t action_fail_cmd;	/* Last failed command		*/
+	uint32_t action_fail_status;	/* Last bad return status	*/
+	int32_t action_err;		/* Last (nonzero) error code	*/
+
+	/* Submission status & statistics */
 	uint64_t submissions[GUC_MAX_ENGINES_NUM];
 	uint32_t last_seqno[GUC_MAX_ENGINES_NUM];
+	uint32_t failures[I915_NUM_RINGS];
 };
 
 /* intel_guc_loader.c */
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 8/9] drm/i915/error: add GuC state error capture & decode
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
                   ` (6 preceding siblings ...)
  2016-02-10 15:50 ` [PATCH v2 7/9] drm/i915/guc: Improve action error reporting Arun Siluvery
@ 2016-02-10 15:50 ` Arun Siluvery
  2016-02-10 15:50 ` [PATCH v2 9/9] drm/i915/error: Capture WA ctx batch in error state Arun Siluvery
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Arun Siluvery @ 2016-02-10 15:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From: Dave Gordon <david.s.gordon@intel.com>

For: VIZ-2021
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h       |   4 ++
 drivers/gpu/drm/i915/i915_gpu_error.c | 107 ++++++++++++++++++++++++++++++++++
 2 files changed, 111 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ed991bf..f7808d3 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -611,6 +611,10 @@ struct drm_i915_error_state {
 
 	u32 *active_bo_count, *pinned_bo_count;
 	u32 vm_count;
+
+	struct intel_guc guc;
+	struct i915_guc_client execbuf_client;
+	struct i915_guc_client preempt_client;
 };
 
 struct intel_connector;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 03485ca..f426538 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -361,6 +361,96 @@ static void i915_ring_error_state(struct drm_i915_error_state_buf *m,
 	}
 }
 
+static void i915_guc_firmware_info(struct drm_i915_error_state_buf *m,
+				   struct drm_i915_private *dev_priv,
+				   struct intel_guc_fw *guc_fw)
+{
+	err_printf(m, "GuC firmware status:\n");
+	err_printf(m, "\tpath: %s\n",
+		guc_fw->guc_fw_path);
+	err_printf(m, "\tfetch: %s\n",
+		intel_guc_fw_status_repr(guc_fw->guc_fw_fetch_status));
+	err_printf(m, "\tload: %s\n",
+		intel_guc_fw_status_repr(guc_fw->guc_fw_load_status));
+	err_printf(m, "\tversion wanted: %d.%d\n",
+		guc_fw->guc_fw_major_wanted, guc_fw->guc_fw_minor_wanted);
+	err_printf(m, "\tversion found: %d.%d\n",
+		guc_fw->guc_fw_major_found, guc_fw->guc_fw_minor_found);
+}
+
+static void i915_guc_action_info(struct drm_i915_error_state_buf *m,
+				 struct drm_i915_private *dev_priv,
+				 struct intel_guc *guc)
+{
+	struct intel_engine_cs *ring;
+	u64 total = 0;
+	int i;
+
+	err_printf(m, "GuC action status:\n");
+	err_printf(m, "\ttotal action count: %llu\n", guc->action_count);
+	err_printf(m, "\tlast action command: 0x%x\n", guc->action_cmd);
+	err_printf(m, "\tlast action status: 0x%x\n", guc->action_status);
+
+	err_printf(m, "\taction failure count: %u\n", guc->action_fail_count);
+	err_printf(m, "\tlast failed action: 0x%x\n", guc->action_fail_cmd);
+	err_printf(m, "\tlast failed status: 0x%x\n", guc->action_fail_status);
+	err_printf(m, "\tlast error code: %d\n", guc->action_err);
+
+	err_printf(m, "GuC submissions:\n");
+	for_each_ring(ring, dev_priv, i) {
+		err_printf(m, "\t%-24s: %10llu, last %-8s 0x%08x %9d\n",
+			ring->name, guc->submissions[i], "seqno",
+			guc->last_seqno[i], guc->last_seqno[i]);
+		total += guc->submissions[i];
+	}
+	err_printf(m, "\t%s: %10llu\n", "Total regular", total);
+}
+
+static void i915_guc_client_info(struct drm_i915_error_state_buf *m,
+				 struct drm_i915_private *dev_priv,
+				 struct i915_guc_client *client)
+{
+	struct intel_engine_cs *ring;
+	uint64_t tot = 0;
+	uint32_t i;
+
+	err_printf(m, "\tPriority %d, GuC ctx index: %u, PD offset 0x%x\n",
+		client->priority, client->ctx_index, client->proc_desc_offset);
+	err_printf(m, "\tDoorbell id %d, offset: 0x%x, cookie 0x%x\n",
+		client->doorbell_id, client->doorbell_offset, client->cookie);
+	err_printf(m, "\tWQ size %d, offset: 0x%x, tail %d\n",
+		client->wq_size, client->wq_offset, client->wq_tail);
+
+	err_printf(m, "\tFailed to queue: %u\n", client->q_fail);
+	err_printf(m, "\tFailed doorbell: %u\n", client->b_fail);
+	err_printf(m, "\tLast submission result: %d\n", client->retcode);
+
+	for_each_ring(ring, dev_priv, i) {
+		err_printf(m, "\tSubmissions: %llu %s\n",
+				client->submissions[i],
+				ring->name);
+		tot += client->submissions[i];
+	}
+	err_printf(m, "\tTotal: %llu\n", tot);
+}
+
+static void i915_guc_error_state(struct drm_i915_error_state_buf *m,
+				 struct drm_i915_private *dev_priv,
+				 struct drm_i915_error_state *error)
+{
+	struct intel_guc *guc;
+
+	if (!i915.enable_guc_submission)
+		return;
+
+	guc = &error->guc;
+	i915_guc_firmware_info(m, dev_priv, &guc->guc_fw);
+	i915_guc_action_info(m, dev_priv, guc);
+
+	err_printf(m, "GuC execbuf client @ %p:\n", guc->execbuf_client);
+	i915_guc_client_info(m, dev_priv, &error->execbuf_client);
+}
+
 void i915_error_printf(struct drm_i915_error_state_buf *e, const char *f, ...)
 {
 	va_list args;
@@ -470,6 +560,9 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 	if (INTEL_INFO(dev)->gen == 7)
 		err_printf(m, "ERR_INT: 0x%08x\n", error->err_int);
 
+	if (HAS_GUC_UCODE(dev) || HAS_GUC_SCHED(dev))
+		i915_guc_error_state(m, dev_priv, error);
+
 	for (i = 0; i < ARRAY_SIZE(error->ring); i++)
 		i915_ring_error_state(m, dev, error, i);
 
@@ -1382,6 +1475,19 @@ static void i915_capture_reg_state(struct drm_i915_private *dev_priv,
 	i915_get_extra_instdone(dev, error->extra_instdone);
 }
 
+/* Capture information about GuC loading and submission, where enabled */
+static void i915_capture_guc_state(struct drm_i915_private *dev_priv,
+				   struct drm_i915_error_state *error)
+{
+	if (!i915.enable_guc_submission)
+		return;
+
+	/* Just copy the state of the device for now */
+	error->guc = dev_priv->guc;
+	if (error->guc.execbuf_client)
+		error->execbuf_client = *error->guc.execbuf_client;
+}
+
 static void i915_error_capture_msg(struct drm_device *dev,
 				   struct drm_i915_error_state *error,
 				   bool wedged,
@@ -1449,6 +1555,7 @@ void i915_capture_error_state(struct drm_device *dev, bool wedged,
 
 	i915_capture_gen_state(dev_priv, error);
 	i915_capture_reg_state(dev_priv, error);
+	i915_capture_guc_state(dev_priv, error);
 	i915_gem_capture_buffers(dev_priv, error);
 	i915_gem_record_fences(dev, error);
 	i915_gem_record_rings(dev, error);
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 9/9] drm/i915/error: Capture WA ctx batch in error state
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
                   ` (7 preceding siblings ...)
  2016-02-10 15:50 ` [PATCH v2 8/9] drm/i915/error: add GuC state error capture & decode Arun Siluvery
@ 2016-02-10 15:50 ` Arun Siluvery
  2016-02-26 14:53   ` Mika Kuoppala
  2016-02-26 16:06   ` [PATCH v3 " Arun Siluvery
  2016-02-15 13:52 ` ✗ Fi.CI.BAT: failure for Capture more useful details in error state (rev2) Patchwork
                   ` (2 subsequent siblings)
  11 siblings, 2 replies; 18+ messages in thread
From: Arun Siluvery @ 2016-02-10 15:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From Gen8 onwards we apply ctx workarounds using special batch buffers that
execute during save/restore, good to have them in error state.

v2: use wa_ctx->size and print only size values (Mika)

Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h       |  2 +-
 drivers/gpu/drm/i915/i915_gpu_error.c | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index f7808d3..7ad0b47 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -568,7 +568,7 @@ struct drm_i915_error_state {
 			bool is_ppgtt;
 			int page_count;
 			u32 *pages[0];
-		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page;
+		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page, *wa_ctx;
 
 		struct drm_i915_error_request {
 			u64 ctx_desc;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index f426538..b62edbb 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -659,6 +659,27 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 			}
 		}
 
+		if ((obj = error->ring[i].wa_ctx)) {
+			u64 wa_ctx_offset = obj->gtt_offset;
+			u32 *wa_ctx_page = &obj->pages[0][0];
+			struct intel_engine_cs *ring = &dev_priv->ring[RCS];
+			u32 wa_ctx_size = (ring->wa_ctx.indirect_ctx.size +
+					   ring->wa_ctx.per_ctx.size);
+
+			err_printf(m, "%s --- WA Ctx batch buffer = 0x%08llx\n",
+				   dev_priv->ring[i].name, wa_ctx_offset);
+			offset = 0;
+			for (elt = 0; elt < wa_ctx_size; elt += 4) {
+				err_printf(m, "[%04x] %08x %08x %08x %08x\n",
+					   offset,
+					   wa_ctx_page[elt],
+					   wa_ctx_page[elt+1],
+					   wa_ctx_page[elt+2],
+					   wa_ctx_page[elt+3]);
+				offset += 16;
+			}
+		}
+
 		if ((obj = error->ring[i].ctx)) {
 			err_printf(m, "%s --- HW Context = 0x%08x\n",
 				   dev_priv->ring[i].name,
@@ -752,6 +773,8 @@ static void i915_error_state_free(struct kref *error_ref)
 		i915_error_object_free(error->ring[i].hws_page);
 		i915_error_object_free(error->ring[i].ctx);
 		kfree(error->ring[i].requests);
+		if (i == RCS)
+			i915_error_object_free(error->ring[i].wa_ctx);
 	}
 
 	i915_error_object_free(error->semaphore_obj);
@@ -1267,6 +1290,11 @@ static void i915_gem_record_rings(struct drm_device *dev,
 		error->ring[i].hws_page =
 			i915_error_ggtt_object_create(dev_priv, ring->status_page.obj);
 
+		if (INTEL_INFO(dev)->gen >= 8 && ring->id == RCS) {
+			error->ring[i].wa_ctx =
+				i915_error_ggtt_object_create(dev_priv, ring->wa_ctx.obj);
+		}
+
 		i915_gem_record_active_context(ring, error, &error->ring[i]);
 
 		count = 0;
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* ✗ Fi.CI.BAT: failure for Capture more useful details in error state (rev2)
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
                   ` (8 preceding siblings ...)
  2016-02-10 15:50 ` [PATCH v2 9/9] drm/i915/error: Capture WA ctx batch in error state Arun Siluvery
@ 2016-02-15 13:52 ` Patchwork
  2016-02-26 16:27 ` ✗ Fi.CI.BAT: warning for Capture more useful details in error state (rev3) Patchwork
  2016-02-26 17:01 ` ✗ Fi.CI.BAT: failure " Patchwork
  11 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2016-02-15 13:52 UTC (permalink / raw)
  To: arun.siluvery; +Cc: intel-gfx

== Summary ==

Series 2906v2 Capture more useful details in error state
http://patchwork.freedesktop.org/api/1.0/series/2906/revisions/2/mbox/

Test gem_sync:
        Subgroup basic-bsd:
                pass       -> DMESG-FAIL (hsw-brixbox)
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                pass       -> DMESG-WARN (ilk-hp8440p) UNSTABLE
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> PASS       (skl-i5k-2)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                pass       -> DMESG-WARN (bsw-nuc-2)
                fail       -> PASS       (bdw-nuci7)
                pass       -> DMESG-WARN (byt-nuc)
        Subgroup basic-rte:
                dmesg-warn -> PASS       (bsw-nuc-2)

bdw-nuci7        total:162  pass:152  dwarn:0   dfail:0   fail:0   skip:10 
bdw-ultra        total:165  pass:152  dwarn:0   dfail:0   fail:0   skip:13 
bsw-nuc-2        total:165  pass:134  dwarn:2   dfail:0   fail:0   skip:29 
byt-nuc          total:165  pass:140  dwarn:1   dfail:0   fail:0   skip:24 
hsw-brixbox      total:165  pass:150  dwarn:0   dfail:1   fail:0   skip:14 
hsw-gt2          total:165  pass:154  dwarn:0   dfail:0   fail:1   skip:10 
ilk-hp8440p      total:165  pass:115  dwarn:1   dfail:0   fail:1   skip:48 
ivb-t430s        total:165  pass:150  dwarn:0   dfail:0   fail:1   skip:14 
skl-i5k-2        total:165  pass:149  dwarn:1   dfail:0   fail:0   skip:15 
snb-dellxps      total:165  pass:142  dwarn:0   dfail:0   fail:1   skip:22 

Results at /archive/results/CI_IGT_test/Patchwork_1390/

f2110d8eac120416f8f5669f2aa561d9ab330a77 drm-intel-nightly: 2016y-02m-15d-09h-53m-04s UTC integration manifest
10ba39cb2b21edfb52e3a6a908765027ae335515 drm/i915/error: Capture WA ctx batch in error state
f81f205a6e31efb4cb8b238849533339e0387358 drm/i915/error: add GuC state error capture & decode
8c03e0b8a6665e0300574a83ade7a010cb1d2a17 drm/i915/guc: Improve action error reporting
83b9556d95e0ad3a00be792e1301e8b9279051dd drm/i915/error: enhanced error capture of requests
5bea04449494651ed718a6b6c46dbe7d5bd7514b drm/i915/error: capture errored context based on request context-id
9a7ae94eca4f9bb8ed9398efb771cf763999dfdf drm/i915/error: improve CSB reporting
103fb92fc496252de85d0687399bfc62c6989aa0 drm/i915/error: report ctx id & desc for each request in the queue
ba175d618bbd5266ff567b9c2cebcf60dd794195 drm/i915/error: capture ringbuffer pointed to by START
1a021f92fd3065dd2e8dffa52e6d2951d542b414 drm/i915/error: capture execlist state on error

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 9/9] drm/i915/error: Capture WA ctx batch in error state
  2016-02-10 15:50 ` [PATCH v2 9/9] drm/i915/error: Capture WA ctx batch in error state Arun Siluvery
@ 2016-02-26 14:53   ` Mika Kuoppala
  2016-02-26 15:35     ` Chris Wilson
  2016-02-26 16:06   ` [PATCH v3 " Arun Siluvery
  1 sibling, 1 reply; 18+ messages in thread
From: Mika Kuoppala @ 2016-02-26 14:53 UTC (permalink / raw)
  To: Arun Siluvery, intel-gfx

Arun Siluvery <arun.siluvery@linux.intel.com> writes:

> From Gen8 onwards we apply ctx workarounds using special batch buffers that
> execute during save/restore, good to have them in error state.
>
> v2: use wa_ctx->size and print only size values (Mika)
>
> Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_drv.h       |  2 +-
>  drivers/gpu/drm/i915/i915_gpu_error.c | 28 ++++++++++++++++++++++++++++
>  2 files changed, 29 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index f7808d3..7ad0b47 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -568,7 +568,7 @@ struct drm_i915_error_state {
>  			bool is_ppgtt;
>  			int page_count;
>  			u32 *pages[0];
> -		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page;
> +		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page, *wa_ctx;
>  
>  		struct drm_i915_error_request {
>  			u64 ctx_desc;
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index f426538..b62edbb 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -659,6 +659,27 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>  			}
>  		}
>  
> +		if ((obj = error->ring[i].wa_ctx)) {
> +			u64 wa_ctx_offset = obj->gtt_offset;
> +			u32 *wa_ctx_page = &obj->pages[0][0];
> +			struct intel_engine_cs *ring = &dev_priv->ring[RCS];
> +			u32 wa_ctx_size = (ring->wa_ctx.indirect_ctx.size +
> +					   ring->wa_ctx.per_ctx.size);
> +
> +			err_printf(m, "%s --- WA Ctx batch buffer = 0x%08llx\n",
> +				   dev_priv->ring[i].name, wa_ctx_offset);
> +			offset = 0;
> +			for (elt = 0; elt < wa_ctx_size; elt += 4) {
> +				err_printf(m, "[%04x] %08x %08x %08x %08x\n",
> +					   offset,
> +					   wa_ctx_page[elt],
> +					   wa_ctx_page[elt+1],
> +					   wa_ctx_page[elt+2],
> +					   wa_ctx_page[elt+3]);
> +				offset += 16;
> +			}
> +		}
> +
>  		if ((obj = error->ring[i].ctx)) {
>  			err_printf(m, "%s --- HW Context = 0x%08x\n",
>  				   dev_priv->ring[i].name,
> @@ -752,6 +773,8 @@ static void i915_error_state_free(struct kref *error_ref)
>  		i915_error_object_free(error->ring[i].hws_page);
>  		i915_error_object_free(error->ring[i].ctx);
>  		kfree(error->ring[i].requests);
> +		if (i == RCS)
> +			i915_error_object_free(error->ring[i].wa_ctx);
>  	}
>  
>  	i915_error_object_free(error->semaphore_obj);
> @@ -1267,6 +1290,11 @@ static void i915_gem_record_rings(struct drm_device *dev,
>  		error->ring[i].hws_page =
>  			i915_error_ggtt_object_create(dev_priv, ring->status_page.obj);
>  
> +		if (INTEL_INFO(dev)->gen >= 8 && ring->id == RCS) {
> +			error->ring[i].wa_ctx =
> +				i915_error_ggtt_object_create(dev_priv, ring->wa_ctx.obj);
> +		}
> +
>  		i915_gem_record_active_context(ring, error, &error->ring[i]);
>  
>  		count = 0;
> -- 
> 1.9.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 9/9] drm/i915/error: Capture WA ctx batch in error state
  2016-02-26 14:53   ` Mika Kuoppala
@ 2016-02-26 15:35     ` Chris Wilson
  0 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2016-02-26 15:35 UTC (permalink / raw)
  To: Mika Kuoppala; +Cc: intel-gfx

On Fri, Feb 26, 2016 at 04:53:03PM +0200, Mika Kuoppala wrote:
> Arun Siluvery <arun.siluvery@linux.intel.com> writes:
> 
> > From Gen8 onwards we apply ctx workarounds using special batch buffers that
> > execute during save/restore, good to have them in error state.
> >
> > v2: use wa_ctx->size and print only size values (Mika)
> >
> > Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
> 
> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
> 
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h       |  2 +-
> >  drivers/gpu/drm/i915/i915_gpu_error.c | 28 ++++++++++++++++++++++++++++
> >  2 files changed, 29 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index f7808d3..7ad0b47 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -568,7 +568,7 @@ struct drm_i915_error_state {
> >  			bool is_ppgtt;
> >  			int page_count;
> >  			u32 *pages[0];
> > -		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page;
> > +		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page, *wa_ctx;
> >  
> >  		struct drm_i915_error_request {
> >  			u64 ctx_desc;
> > diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> > index f426538..b62edbb 100644
> > --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> > +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> > @@ -659,6 +659,27 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
> >  			}
> >  		}
> >  
> > +		if ((obj = error->ring[i].wa_ctx)) {
> > +			u64 wa_ctx_offset = obj->gtt_offset;
> > +			u32 *wa_ctx_page = &obj->pages[0][0];
> > +			struct intel_engine_cs *ring = &dev_priv->ring[RCS];
> > +			u32 wa_ctx_size = (ring->wa_ctx.indirect_ctx.size +
> > +					   ring->wa_ctx.per_ctx.size);
> > +
> > +			err_printf(m, "%s --- WA Ctx batch buffer = 0x%08llx\n",
> > +				   dev_priv->ring[i].name, wa_ctx_offset);
> > +			offset = 0;
> > +			for (elt = 0; elt < wa_ctx_size; elt += 4) {
> > +				err_printf(m, "[%04x] %08x %08x %08x %08x\n",
> > +					   offset,
> > +					   wa_ctx_page[elt],
> > +					   wa_ctx_page[elt+1],
> > +					   wa_ctx_page[elt+2],
> > +					   wa_ctx_page[elt+3]);
> > +				offset += 16;
> > +			}
> > +		}
> > +
> >  		if ((obj = error->ring[i].ctx)) {
> >  			err_printf(m, "%s --- HW Context = 0x%08x\n",
> >  				   dev_priv->ring[i].name,
> > @@ -752,6 +773,8 @@ static void i915_error_state_free(struct kref *error_ref)
> >  		i915_error_object_free(error->ring[i].hws_page);
> >  		i915_error_object_free(error->ring[i].ctx);
> >  		kfree(error->ring[i].requests);
> > +		if (i == RCS)
> > +			i915_error_object_free(error->ring[i].wa_ctx);

Just always free it, it is a no-op if NULL.

> > +		if (INTEL_INFO(dev)->gen >= 8 && ring->id == RCS) {
> > +			error->ring[i].wa_ctx =
> > +				i915_error_ggtt_object_create(dev_priv, ring->wa_ctx.obj);

Just always record it if wa_ctx.obj exists.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v3 9/9] drm/i915/error: Capture WA ctx batch in error state
  2016-02-10 15:50 ` [PATCH v2 9/9] drm/i915/error: Capture WA ctx batch in error state Arun Siluvery
  2016-02-26 14:53   ` Mika Kuoppala
@ 2016-02-26 16:06   ` Arun Siluvery
  2016-03-01 10:34     ` Tvrtko Ursulin
  1 sibling, 1 reply; 18+ messages in thread
From: Arun Siluvery @ 2016-02-26 16:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From Gen8 onwards we apply ctx workarounds using special batch buffers that
execute during save/restore, good to have them in error state.

v2: use wa_ctx->size and print only size values (Mika)

v3: simplify conditions when recording and freeing object (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
---

Applied r-b received for v2, this version just simplifies conditions so I
am assuming it still holds.

 drivers/gpu/drm/i915/i915_drv.h       |  2 +-
 drivers/gpu/drm/i915/i915_gpu_error.c | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index e8a47af..b1ba039 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -568,7 +568,7 @@ struct drm_i915_error_state {
 			bool is_ppgtt;
 			int page_count;
 			u32 *pages[0];
-		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page;
+		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page, *wa_ctx;
 
 		struct drm_i915_error_request {
 			u64 ctx_desc;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index f426538..f48788e 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -659,6 +659,27 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 			}
 		}
 
+		if ((obj = error->ring[i].wa_ctx)) {
+			u64 wa_ctx_offset = obj->gtt_offset;
+			u32 *wa_ctx_page = &obj->pages[0][0];
+			struct intel_engine_cs *ring = &dev_priv->ring[RCS];
+			u32 wa_ctx_size = (ring->wa_ctx.indirect_ctx.size +
+					   ring->wa_ctx.per_ctx.size);
+
+			err_printf(m, "%s --- WA Ctx batch buffer = 0x%08llx\n",
+				   dev_priv->ring[i].name, wa_ctx_offset);
+			offset = 0;
+			for (elt = 0; elt < wa_ctx_size; elt += 4) {
+				err_printf(m, "[%04x] %08x %08x %08x %08x\n",
+					   offset,
+					   wa_ctx_page[elt],
+					   wa_ctx_page[elt+1],
+					   wa_ctx_page[elt+2],
+					   wa_ctx_page[elt+3]);
+				offset += 16;
+			}
+		}
+
 		if ((obj = error->ring[i].ctx)) {
 			err_printf(m, "%s --- HW Context = 0x%08x\n",
 				   dev_priv->ring[i].name,
@@ -752,6 +773,7 @@ static void i915_error_state_free(struct kref *error_ref)
 		i915_error_object_free(error->ring[i].hws_page);
 		i915_error_object_free(error->ring[i].ctx);
 		kfree(error->ring[i].requests);
+		i915_error_object_free(error->ring[i].wa_ctx);
 	}
 
 	i915_error_object_free(error->semaphore_obj);
@@ -1267,6 +1289,11 @@ static void i915_gem_record_rings(struct drm_device *dev,
 		error->ring[i].hws_page =
 			i915_error_ggtt_object_create(dev_priv, ring->status_page.obj);
 
+		if (ring->wa_ctx.obj) {
+			error->ring[i].wa_ctx =
+				i915_error_ggtt_object_create(dev_priv, ring->wa_ctx.obj);
+		}
+
 		i915_gem_record_active_context(ring, error, &error->ring[i]);
 
 		count = 0;
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* ✗ Fi.CI.BAT: warning for Capture more useful details in error state (rev3)
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
                   ` (9 preceding siblings ...)
  2016-02-15 13:52 ` ✗ Fi.CI.BAT: failure for Capture more useful details in error state (rev2) Patchwork
@ 2016-02-26 16:27 ` Patchwork
  2016-02-26 17:01 ` ✗ Fi.CI.BAT: failure " Patchwork
  11 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2016-02-26 16:27 UTC (permalink / raw)
  To: arun.siluvery; +Cc: intel-gfx

== Series Details ==

Series: Capture more useful details in error state (rev3)
URL   : https://patchwork.freedesktop.org/series/2906/
State : warning

== Summary ==

Series 2906v3 Capture more useful details in error state
http://patchwork.freedesktop.org/api/1.0/series/2906/revisions/3/mbox/

Test kms_flip:
        Subgroup basic-flip-vs-dpms:
                dmesg-warn -> PASS       (ilk-hp8440p) UNSTABLE
        Subgroup basic-flip-vs-modeset:
                incomplete -> PASS       (ilk-hp8440p) UNSTABLE
Test kms_force_connector_basic:
        Subgroup force-load-detect:
                fail       -> DMESG-FAIL (snb-x220t)
                dmesg-fail -> FAIL       (ilk-hp8440p)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                pass       -> DMESG-WARN (skl-i7k-2) UNSTABLE
                pass       -> DMESG-WARN (ivb-t430s)
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (hsw-gt2)
        Subgroup suspend-read-crc-pipe-c:
                dmesg-warn -> PASS       (skl-i7k-2) UNSTABLE

bdw-nuci7        total:166  pass:155  dwarn:0   dfail:0   fail:0   skip:11 
bdw-ultra        total:169  pass:155  dwarn:0   dfail:0   fail:0   skip:14 
byt-nuc          total:169  pass:144  dwarn:0   dfail:0   fail:0   skip:25 
hsw-brixbox      total:169  pass:155  dwarn:0   dfail:0   fail:0   skip:14 
hsw-gt2          total:169  pass:158  dwarn:0   dfail:1   fail:0   skip:10 
ilk-hp8440p      total:169  pass:119  dwarn:0   dfail:0   fail:1   skip:49 
ivb-t430s        total:169  pass:153  dwarn:1   dfail:0   fail:1   skip:14 
skl-i7k-2        total:169  pass:152  dwarn:1   dfail:0   fail:0   skip:16 
snb-dellxps      total:169  pass:146  dwarn:0   dfail:0   fail:1   skip:22 
snb-x220t        total:169  pass:146  dwarn:0   dfail:1   fail:1   skip:21 

Results at /archive/results/CI_IGT_test/Patchwork_1485/

e511a05b4b3bb4d1dbca99b00af6d0dc0a65d295 drm-intel-nightly: 2016y-02m-26d-13h-42m-46s UTC integration manifest
c5b5716e7321f44ce2c0d9994e6d1ab9dc735e4a drm/i915/error: Capture WA ctx batch in error state
d0d6a51d514a16bd3bfa623e54878212b9b450f6 drm/i915/error: add GuC state error capture & decode
f81fa1909e5c88e4060de69a7475404464ccd5ef drm/i915/guc: Improve action error reporting
e0a249a8b775364dd7a15c397a0abcef3248ce54 drm/i915/error: enhanced error capture of requests
6d3ceff2dfcc5e61280e977d6513d474239e252a drm/i915/error: capture errored context based on request context-id
93faa0817f6256aabd62a002cce06eff78c4151b drm/i915/error: improve CSB reporting
68a66e19b0ebf2fd86322fa33630d907665f8dd0 drm/i915/error: report ctx id & desc for each request in the queue
ca600addec12762fed301a7edc87f52de2b21604 drm/i915/error: capture ringbuffer pointed to by START
1b4670325fee8d046050608ea70b88d2c98def3a drm/i915/error: capture execlist state on error

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* ✗ Fi.CI.BAT: failure for Capture more useful details in error state (rev3)
  2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
                   ` (10 preceding siblings ...)
  2016-02-26 16:27 ` ✗ Fi.CI.BAT: warning for Capture more useful details in error state (rev3) Patchwork
@ 2016-02-26 17:01 ` Patchwork
  2016-02-29 10:32   ` Arun Siluvery
  11 siblings, 1 reply; 18+ messages in thread
From: Patchwork @ 2016-02-26 17:01 UTC (permalink / raw)
  To: arun.siluvery; +Cc: intel-gfx

== Series Details ==

Series: Capture more useful details in error state (rev3)
URL   : https://patchwork.freedesktop.org/series/2906/
State : failure

== Summary ==

Series 2906v3 Capture more useful details in error state
http://patchwork.freedesktop.org/api/1.0/series/2906/revisions/3/mbox/

Test drv_hangman:
        Subgroup error-state-basic:
                pass       -> INCOMPLETE (snb-dellxps)
                pass       -> FAIL       (ilk-hp8440p)
Test kms_flip:
        Subgroup basic-flip-vs-dpms:
                dmesg-warn -> PASS       (ilk-hp8440p) UNSTABLE
        Subgroup basic-flip-vs-modeset:
                incomplete -> PASS       (ilk-hp8440p) UNSTABLE
        Subgroup basic-flip-vs-wf_vblank:
                pass       -> FAIL       (snb-x220t)
Test kms_force_connector_basic:
        Subgroup force-load-detect:
                fail       -> DMESG-FAIL (snb-x220t)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (hsw-gt2)
                pass       -> DMESG-WARN (ivb-t430s)
        Subgroup suspend-read-crc-pipe-c:
                pass       -> DMESG-WARN (bsw-nuc-2)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                pass       -> DMESG-WARN (bsw-nuc-2)

bdw-nuci7        total:166  pass:155  dwarn:0   dfail:0   fail:0   skip:11 
bdw-ultra        total:169  pass:155  dwarn:0   dfail:0   fail:0   skip:14 
bsw-nuc-2        total:169  pass:136  dwarn:2   dfail:0   fail:1   skip:30 
byt-nuc          total:169  pass:144  dwarn:0   dfail:0   fail:0   skip:25 
hsw-brixbox      total:169  pass:155  dwarn:0   dfail:0   fail:0   skip:14 
hsw-gt2          total:169  pass:158  dwarn:0   dfail:1   fail:0   skip:10 
ilk-hp8440p      total:169  pass:118  dwarn:0   dfail:1   fail:1   skip:49 
ivb-t430s        total:169  pass:153  dwarn:1   dfail:0   fail:1   skip:14 
skl-i7k-2        total:169  pass:152  dwarn:1   dfail:0   fail:0   skip:16 
snb-dellxps      total:20   pass:18   dwarn:0   dfail:0   fail:0   skip:1  
snb-x220t        total:169  pass:145  dwarn:0   dfail:1   fail:2   skip:21 

Results at /archive/results/CI_IGT_test/Patchwork_1486/

e511a05b4b3bb4d1dbca99b00af6d0dc0a65d295 drm-intel-nightly: 2016y-02m-26d-13h-42m-46s UTC integration manifest
c072adf745e744b6d20d1fdcdc2979235430599e drm/i915/error: Capture WA ctx batch in error state
d187fe59fc41065bf02447604c2df9fbcc20a337 drm/i915/error: add GuC state error capture & decode
42341a5325b0b2dde27ecd09f4a536ecb1036c2b drm/i915/guc: Improve action error reporting
6dfb136e296a5906cde48fe578d7a9f5fc53cf3b drm/i915/error: enhanced error capture of requests
57b7c25ac7e9595d29cc4e7be4b5890069d249bb drm/i915/error: capture errored context based on request context-id
01bc355da54332af17ea674c606de5924f117189 drm/i915/error: improve CSB reporting
7c5e4382756f0fc89ca8b7209861ac73f2059eef drm/i915/error: report ctx id & desc for each request in the queue
64d800fceb8ddc6f1e431ea09c674077db359c9b drm/i915/error: capture ringbuffer pointed to by START
8398e7f4626cc0353d2d9d57c5fe2accf734612f drm/i915/error: capture execlist state on error

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ✗ Fi.CI.BAT: failure for Capture more useful details in error state (rev3)
  2016-02-26 17:01 ` ✗ Fi.CI.BAT: failure " Patchwork
@ 2016-02-29 10:32   ` Arun Siluvery
  0 siblings, 0 replies; 18+ messages in thread
From: Arun Siluvery @ 2016-02-29 10:32 UTC (permalink / raw)
  To: intel-gfx

On 26/02/2016 17:01, Patchwork wrote:
> == Series Details ==
>
> Series: Capture more useful details in error state (rev3)
> URL   : https://patchwork.freedesktop.org/series/2906/
> State : failure
>
> == Summary ==
>
> Series 2906v3 Capture more useful details in error state
> http://patchwork.freedesktop.org/api/1.0/series/2906/revisions/3/mbox/
>
> Test drv_hangman:
>          Subgroup error-state-basic:
>                  pass       -> INCOMPLETE (snb-dellxps)
>                  pass       -> FAIL       (ilk-hp8440p)

No log available for INCOMPLETE case.

For FAIL case below commit is the suspect which replaces stop_ring with 
a real gpu hang. I tried this subtest on SKL and it works fine, possibly 
affecting old gen (also successful on BAT)

https://bugs.freedesktop.org/show_bug.cgi?id=94305

commit 0753057446da0c74843c8a1000f589797da9388d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Dec 11 13:27:49 2015 +0000

     igt/drv_hangman: Inject a true hang

     Wean drv_hangman off the atrocious stop_rings and use a real GPU 
hang instead.


> Test kms_flip:
>          Subgroup basic-flip-vs-dpms:
>                  dmesg-warn -> PASS       (ilk-hp8440p) UNSTABLE
>          Subgroup basic-flip-vs-modeset:
>                  incomplete -> PASS       (ilk-hp8440p) UNSTABLE
>          Subgroup basic-flip-vs-wf_vblank:
>                  pass       -> FAIL       (snb-x220t)
known issue, https://bugs.freedesktop.org/show_bug.cgi?id=94294

> Test kms_force_connector_basic:
>          Subgroup force-load-detect:
>                  fail       -> DMESG-FAIL (snb-x220t)

unrelated to this patch, looks like it has been like this for a while: 
/archive/results/CI_IGT_test/igt@kms_force_connector_basic@force-load-detect.html

> Test kms_pipe_crc_basic:
>          Subgroup suspend-read-crc-pipe-b:
>                  incomplete -> PASS       (hsw-gt2)
>                  pass       -> DMESG-WARN (ivb-t430s)
could be related to this?
https://bugs.freedesktop.org/show_bug.cgi?id=93787

>          Subgroup suspend-read-crc-pipe-c:
>                  pass       -> DMESG-WARN (bsw-nuc-2)
https://bugs.freedesktop.org/show_bug.cgi?id=93294

> Test pm_rpm:
>          Subgroup basic-pci-d3-state:
>                  pass       -> DMESG-WARN (bsw-nuc-2)
unrelated, failed couple of times on previous BAT runs

regards
Arun

>
> bdw-nuci7        total:166  pass:155  dwarn:0   dfail:0   fail:0   skip:11
> bdw-ultra        total:169  pass:155  dwarn:0   dfail:0   fail:0   skip:14
> bsw-nuc-2        total:169  pass:136  dwarn:2   dfail:0   fail:1   skip:30
> byt-nuc          total:169  pass:144  dwarn:0   dfail:0   fail:0   skip:25
> hsw-brixbox      total:169  pass:155  dwarn:0   dfail:0   fail:0   skip:14
> hsw-gt2          total:169  pass:158  dwarn:0   dfail:1   fail:0   skip:10
> ilk-hp8440p      total:169  pass:118  dwarn:0   dfail:1   fail:1   skip:49
> ivb-t430s        total:169  pass:153  dwarn:1   dfail:0   fail:1   skip:14
> skl-i7k-2        total:169  pass:152  dwarn:1   dfail:0   fail:0   skip:16
> snb-dellxps      total:20   pass:18   dwarn:0   dfail:0   fail:0   skip:1
> snb-x220t        total:169  pass:145  dwarn:0   dfail:1   fail:2   skip:21
>
> Results at /archive/results/CI_IGT_test/Patchwork_1486/
>
> e511a05b4b3bb4d1dbca99b00af6d0dc0a65d295 drm-intel-nightly: 2016y-02m-26d-13h-42m-46s UTC integration manifest
> c072adf745e744b6d20d1fdcdc2979235430599e drm/i915/error: Capture WA ctx batch in error state
> d187fe59fc41065bf02447604c2df9fbcc20a337 drm/i915/error: add GuC state error capture & decode
> 42341a5325b0b2dde27ecd09f4a536ecb1036c2b drm/i915/guc: Improve action error reporting
> 6dfb136e296a5906cde48fe578d7a9f5fc53cf3b drm/i915/error: enhanced error capture of requests
> 57b7c25ac7e9595d29cc4e7be4b5890069d249bb drm/i915/error: capture errored context based on request context-id
> 01bc355da54332af17ea674c606de5924f117189 drm/i915/error: improve CSB reporting
> 7c5e4382756f0fc89ca8b7209861ac73f2059eef drm/i915/error: report ctx id & desc for each request in the queue
> 64d800fceb8ddc6f1e431ea09c674077db359c9b drm/i915/error: capture ringbuffer pointed to by START
> 8398e7f4626cc0353d2d9d57c5fe2accf734612f drm/i915/error: capture execlist state on error
>
>

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 9/9] drm/i915/error: Capture WA ctx batch in error state
  2016-02-26 16:06   ` [PATCH v3 " Arun Siluvery
@ 2016-03-01 10:34     ` Tvrtko Ursulin
  0 siblings, 0 replies; 18+ messages in thread
From: Tvrtko Ursulin @ 2016-03-01 10:34 UTC (permalink / raw)
  To: Arun Siluvery, intel-gfx; +Cc: Mika Kuoppala



On 26/02/16 16:06, Arun Siluvery wrote:
>  From Gen8 onwards we apply ctx workarounds using special batch buffers that
> execute during save/restore, good to have them in error state.
>
> v2: use wa_ctx->size and print only size values (Mika)
>
> v3: simplify conditions when recording and freeing object (Chris)

Tried to merge it but it doesn't apply. I think you need to rebase and 
resend.

Plus checkpatch is not fully happy so please consider the below as well:

> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
> ---
>
> Applied r-b received for v2, this version just simplifies conditions so I
> am assuming it still holds.
>
>   drivers/gpu/drm/i915/i915_drv.h       |  2 +-
>   drivers/gpu/drm/i915/i915_gpu_error.c | 27 +++++++++++++++++++++++++++
>   2 files changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index e8a47af..b1ba039 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -568,7 +568,7 @@ struct drm_i915_error_state {
>   			bool is_ppgtt;
>   			int page_count;
>   			u32 *pages[0];
> -		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page;
> +		} *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page, *wa_ctx;

Line over 80 chars, not sure how much we care.

>
>   		struct drm_i915_error_request {
>   			u64 ctx_desc;
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index f426538..f48788e 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -659,6 +659,27 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>   			}
>   		}
>
> +		if ((obj = error->ring[i].wa_ctx)) {

Assignment in if condition is a check patch error.

> +			u64 wa_ctx_offset = obj->gtt_offset;
> +			u32 *wa_ctx_page = &obj->pages[0][0];
> +			struct intel_engine_cs *ring = &dev_priv->ring[RCS];
> +			u32 wa_ctx_size = (ring->wa_ctx.indirect_ctx.size +
> +					   ring->wa_ctx.per_ctx.size);
> +
> +			err_printf(m, "%s --- WA Ctx batch buffer = 0x%08llx\n",
> +				   dev_priv->ring[i].name, wa_ctx_offset);
> +			offset = 0;
> +			for (elt = 0; elt < wa_ctx_size; elt += 4) {
> +				err_printf(m, "[%04x] %08x %08x %08x %08x\n",
> +					   offset,
> +					   wa_ctx_page[elt],
> +					   wa_ctx_page[elt+1],
> +					   wa_ctx_page[elt+2],
> +					   wa_ctx_page[elt+3]);

Here it suggests spaces around '+'.

> +				offset += 16;
> +			}
> +		}
> +
>   		if ((obj = error->ring[i].ctx)) {
>   			err_printf(m, "%s --- HW Context = 0x%08x\n",
>   				   dev_priv->ring[i].name,
> @@ -752,6 +773,7 @@ static void i915_error_state_free(struct kref *error_ref)
>   		i915_error_object_free(error->ring[i].hws_page);
>   		i915_error_object_free(error->ring[i].ctx);
>   		kfree(error->ring[i].requests);
> +		i915_error_object_free(error->ring[i].wa_ctx);
>   	}
>
>   	i915_error_object_free(error->semaphore_obj);
> @@ -1267,6 +1289,11 @@ static void i915_gem_record_rings(struct drm_device *dev,
>   		error->ring[i].hws_page =
>   			i915_error_ggtt_object_create(dev_priv, ring->status_page.obj);
>
> +		if (ring->wa_ctx.obj) {
> +			error->ring[i].wa_ctx =
> +				i915_error_ggtt_object_create(dev_priv, ring->wa_ctx.obj);

And this is another line over 80-char warning.

> +		}
> +
>   		i915_gem_record_active_context(ring, error, &error->ring[i]);
>
>   		count = 0;
>

Regards,

Tvrtko

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-03-01 10:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-10 15:50 [PATCH v2 0/9] Capture more useful details in error state Arun Siluvery
2016-02-10 15:50 ` [PATCH v2 1/9] drm/i915/error: capture execlist state on error Arun Siluvery
2016-02-10 15:50 ` [PATCH v2 2/9] drm/i915/error: capture ringbuffer pointed to by START Arun Siluvery
2016-02-10 15:50 ` [PATCH v2 3/9] drm/i915/error: report ctx id & desc for each request in the queue Arun Siluvery
2016-02-10 15:50 ` [PATCH v2 4/9] drm/i915/error: improve CSB reporting Arun Siluvery
2016-02-10 15:50 ` [PATCH v2 5/9] drm/i915/error: capture errored context based on request context-id Arun Siluvery
2016-02-10 15:50 ` [PATCH v2 6/9] drm/i915/error: enhanced error capture of requests Arun Siluvery
2016-02-10 15:50 ` [PATCH v2 7/9] drm/i915/guc: Improve action error reporting Arun Siluvery
2016-02-10 15:50 ` [PATCH v2 8/9] drm/i915/error: add GuC state error capture & decode Arun Siluvery
2016-02-10 15:50 ` [PATCH v2 9/9] drm/i915/error: Capture WA ctx batch in error state Arun Siluvery
2016-02-26 14:53   ` Mika Kuoppala
2016-02-26 15:35     ` Chris Wilson
2016-02-26 16:06   ` [PATCH v3 " Arun Siluvery
2016-03-01 10:34     ` Tvrtko Ursulin
2016-02-15 13:52 ` ✗ Fi.CI.BAT: failure for Capture more useful details in error state (rev2) Patchwork
2016-02-26 16:27 ` ✗ Fi.CI.BAT: warning for Capture more useful details in error state (rev3) Patchwork
2016-02-26 17:01 ` ✗ Fi.CI.BAT: failure " Patchwork
2016-02-29 10:32   ` Arun Siluvery

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.