drm/i915: Export per-engine reset count info to debugfs
authorMichel Thierry <michel.thierry@intel.com>
Tue, 20 Jun 2017 09:57:49 +0000 (10:57 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 20 Jun 2017 20:00:27 +0000 (21:00 +0100)
A new variable is added to export the reset counts to debugfs, this
includes full gpu reset and engine reset count. This is useful for tests
where they are expected to trigger reset; these counts are checked before
and after the test to ensure the same.

v2: Include reset engine count in i915_engine_info too (Chris).

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170615201828.23144-8-michel.thierry@intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170620095751.13127-8-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_debugfs.c

index 6103d0079d16e7f1b44c73c7a1914bcc91500f8f..1f1176b6400e5b43cc3c5b9d1e01285cf91d2f6a 100644 (file)
@@ -1403,6 +1403,23 @@ static int i915_hangcheck_info(struct seq_file *m, void *unused)
        return 0;
 }
 
+static int i915_reset_info(struct seq_file *m, void *unused)
+{
+       struct drm_i915_private *dev_priv = node_to_i915(m->private);
+       struct i915_gpu_error *error = &dev_priv->gpu_error;
+       struct intel_engine_cs *engine;
+       enum intel_engine_id id;
+
+       seq_printf(m, "full gpu reset = %u\n", i915_reset_count(error));
+
+       for_each_engine(engine, dev_priv, id) {
+               seq_printf(m, "%s = %u\n", engine->name,
+                          i915_reset_engine_count(error, engine));
+       }
+
+       return 0;
+}
+
 static int ironlake_drpc_info(struct seq_file *m)
 {
        struct drm_i915_private *dev_priv = node_to_i915(m->private);
@@ -3285,6 +3302,7 @@ static int i915_display_info(struct seq_file *m, void *unused)
 static int i915_engine_info(struct seq_file *m, void *unused)
 {
        struct drm_i915_private *dev_priv = node_to_i915(m->private);
+       struct i915_gpu_error *error = &dev_priv->gpu_error;
        struct intel_engine_cs *engine;
        enum intel_engine_id id;
 
@@ -3308,6 +3326,8 @@ static int i915_engine_info(struct seq_file *m, void *unused)
                           engine->hangcheck.seqno,
                           jiffies_to_msecs(jiffies - engine->hangcheck.action_timestamp),
                           engine->timeline->inflight_seqnos);
+               seq_printf(m, "\tReset count: %d\n",
+                          i915_reset_engine_count(error, engine));
 
                rcu_read_lock();
 
@@ -4820,6 +4840,7 @@ static const struct drm_info_list i915_debugfs_list[] = {
        {"i915_huc_load_status", i915_huc_load_status_info, 0},
        {"i915_frequency_info", i915_frequency_info, 0},
        {"i915_hangcheck_info", i915_hangcheck_info, 0},
+       {"i915_reset_info", i915_reset_info, 0},
        {"i915_drpc_info", i915_drpc_info, 0},
        {"i915_emon_status", i915_emon_status, 0},
        {"i915_ring_freq_table", i915_ring_freq_table, 0},