From 3265124a2d3744d789ede58452ab6f8a9b454be8 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri, 27 Oct 2017 12:06:17 +0100
Subject: [PATCH] drm/i915: Give more details for the active-when-parking warning for the engines
Git-commit: 3265124a2d3744d789ede58452ab6f8a9b454be8
Patch-mainline: v4.16-rc1
References: FATE#322643 bsc#1055900
If the we think the engine is still active when we attempt to park it,
we want more details -- so dump the engine state.
References: https://bugs.freedesktop.org/show_bug.cgi?id=103479
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171027110617.31745-4-chris@chris-wilson.co.uk
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
---
drivers/gpu/drm/i915/intel_engine_cs.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -1621,14 +1621,20 @@ void intel_engines_park(struct drm_i915_
struct intel_engine_cs *engine;
enum intel_engine_id id;
- /*
- * We are committed now to parking the engines, make sure there
- * will be no more interrupts arriving later.
- */
- if (!intel_engines_are_idle(dev_priv))
- DRM_ERROR("Timeout waiting for engines to idle\n");
-
for_each_engine(engine, i915, id) {
+ /*
+ * We are committed now to parking the engines, make sure there
+ * will be no more interrupts arriving later and the engines
+ * are truly idle.
+ */
+ if (!intel_engine_is_idle(engine)) {
+ struct drm_printer p = drm_debug_printer(__func__);
+
+ DRM_ERROR("%s is not idle before parking\n",
+ engine->name);
+ intel_engine_dump(engine, &p);
+ }
+
if (engine->park)
engine->park(engine);