]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/i915: Dump the engine state before declaring wedged from wait_for_engines()
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 11 Dec 2017 19:41:35 +0000 (19:41 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 12 Dec 2017 21:07:41 +0000 (21:07 +0000)
If wait_for_engines() fails and we resort to declaring the HW wedged,
dump the engine state for debugging.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171211194135.27095-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem.c

index 55e4475fabe01a4d24b5bc451089cbc31b636f31..8c92fcd6f805dfc99c2e5ac7fe098b0888468865 100644 (file)
@@ -3534,7 +3534,18 @@ static int wait_for_timeline(struct i915_gem_timeline *tl, unsigned int flags)
 static int wait_for_engines(struct drm_i915_private *i915)
 {
        if (wait_for(intel_engines_are_idle(i915), I915_IDLE_ENGINES_TIMEOUT)) {
-               DRM_ERROR("Failed to idle engines, declaring wedged!\n");
+               dev_err(i915->drm.dev,
+                       "Failed to idle engines, declaring wedged!\n");
+               if (drm_debug & DRM_UT_DRIVER) {
+                       struct drm_printer p = drm_debug_printer(__func__);
+                       struct intel_engine_cs *engine;
+                       enum intel_engine_id id;
+
+                       for_each_engine(engine, i915, id)
+                               intel_engine_dump(engine, &p,
+                                                 "%s", engine->name);
+               }
+
                i915_gem_set_wedged(i915);
                return -EIO;
        }