From: Akash Goel <akash.goel@xxxxxxxxx> Added the dump of GuC log buffer to i915 error state, as the contents of GuC log buffer would also be useful to determine that why the GPU reset was triggered. Suggested-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Signed-off-by: Akash Goel <akash.goel@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_gpu_error.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 28ffac5..4bd3790 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -509,6 +509,7 @@ struct drm_i915_error_state { struct intel_overlay_error_state *overlay; struct intel_display_error_state *display; struct drm_i915_error_object *semaphore_obj; + struct drm_i915_error_object *guc_log_obj; struct drm_i915_error_engine { int engine_id; diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index eecb870..561b523 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -546,6 +546,21 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, } } + if ((obj = error->guc_log_obj)) { + err_printf(m, "GuC log buffer = 0x%08x\n", + lower_32_bits(obj->gtt_offset)); + for (i = 0; i < obj->page_count; i++) { + for (elt = 0; elt < PAGE_SIZE/4; elt += 4) { + err_printf(m, "[%08x] %08x %08x %08x %08x\n", + (u32)(i*PAGE_SIZE) + elt*4, + obj->pages[i][elt], + obj->pages[i][elt+1], + obj->pages[i][elt+2], + obj->pages[i][elt+3]); + } + } + } + if (error->overlay) intel_overlay_print_error_state(m, error->overlay); @@ -625,6 +640,7 @@ static void i915_error_state_free(struct kref *error_ref) } i915_error_object_free(error->semaphore_obj); + i915_error_object_free(error->guc_log_obj); for (i = 0; i < error->vm_count; i++) kfree(error->active_bo[i]); @@ -1210,6 +1226,16 @@ static void i915_gem_record_rings(struct drm_i915_private *dev_priv, } } +static void i915_gem_capture_guc_log_buffer(struct drm_i915_private *dev_priv, + struct drm_i915_error_state *error) +{ + if (!dev_priv->guc.log.obj) + return; + + error->guc_log_obj = i915_error_ggtt_object_create(dev_priv, + dev_priv->guc.log.obj); +} + /* FIXME: Since pin count/bound list is global, we duplicate what we capture per * VM. */ @@ -1439,6 +1465,7 @@ void i915_capture_error_state(struct drm_i915_private *dev_priv, i915_gem_capture_buffers(dev_priv, error); i915_gem_record_fences(dev_priv, error); i915_gem_record_rings(dev_priv, error); + i915_gem_capture_guc_log_buffer(dev_priv, error); do_gettimeofday(&error->time); -- 1.9.2 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx