浏览代码

drm/i915: Show if we consider the engine is idle in the GPU error state

Useful for verifying our bookkeeper when we encounter is knowing whether
we think the engine is idle at the time of the GPU hang.

References: https://bugs.freedesktop.org/show_bug.cgi?id=104305
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171219131419.13117-1-chris@chris-wilson.co.uk
Chris Wilson 7 年之前
父节点
当前提交
398c8a300b
共有 2 个文件被更改,包括 3 次插入0 次删除
  1. 1 0
      drivers/gpu/drm/i915/i915_drv.h
  2. 2 0
      drivers/gpu/drm/i915/i915_gpu_error.c

+ 1 - 0
drivers/gpu/drm/i915/i915_drv.h

@@ -948,6 +948,7 @@ struct i915_gpu_state {
 	struct drm_i915_error_engine {
 	struct drm_i915_error_engine {
 		int engine_id;
 		int engine_id;
 		/* Software tracked state */
 		/* Software tracked state */
+		bool idle;
 		bool waiting;
 		bool waiting;
 		int num_waiters;
 		int num_waiters;
 		unsigned long hangcheck_timestamp;
 		unsigned long hangcheck_timestamp;

+ 2 - 0
drivers/gpu/drm/i915/i915_gpu_error.c

@@ -416,6 +416,7 @@ static void error_print_engine(struct drm_i915_error_state_buf *m,
 	int n;
 	int n;
 
 
 	err_printf(m, "%s command stream:\n", engine_str(ee->engine_id));
 	err_printf(m, "%s command stream:\n", engine_str(ee->engine_id));
+	err_printf(m, "  IDLE?: %s\n", yesno(ee->idle));
 	err_printf(m, "  START: 0x%08x\n", ee->start);
 	err_printf(m, "  START: 0x%08x\n", ee->start);
 	err_printf(m, "  HEAD:  0x%08x [0x%08x]\n", ee->head, ee->rq_head);
 	err_printf(m, "  HEAD:  0x%08x [0x%08x]\n", ee->head, ee->rq_head);
 	err_printf(m, "  TAIL:  0x%08x [0x%08x, 0x%08x]\n",
 	err_printf(m, "  TAIL:  0x%08x [0x%08x, 0x%08x]\n",
@@ -1239,6 +1240,7 @@ static void error_record_engine_registers(struct i915_gpu_state *error,
 		ee->hws = I915_READ(mmio);
 		ee->hws = I915_READ(mmio);
 	}
 	}
 
 
+	ee->idle = intel_engine_is_idle(engine);
 	ee->hangcheck_timestamp = engine->hangcheck.action_timestamp;
 	ee->hangcheck_timestamp = engine->hangcheck.action_timestamp;
 	ee->hangcheck_action = engine->hangcheck.action;
 	ee->hangcheck_action = engine->hangcheck.action;
 	ee->hangcheck_stalled = engine->hangcheck.stalled;
 	ee->hangcheck_stalled = engine->hangcheck.stalled;