drm/i915: Move debugfs/i915_semaphore_status to i915_engine_info
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 20 Nov 2017 20:55:03 +0000 (20:55 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 20 Nov 2017 21:59:08 +0000 (21:59 +0000)
As the semaphores is just part of the engine, include it with the
general pretty printer universally used for debugging.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171120205504.21892-4-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/intel_engine_cs.c

index 9cef1463d4113327b60849bc25ae353752db0580..41d49a4d25d352fe27f7a7fbcc0318c1dcfdf0d6 100644 (file)
@@ -3235,37 +3235,6 @@ static int i915_shrinker_info(struct seq_file *m, void *unused)
        return 0;
 }
 
-static int i915_semaphore_status(struct seq_file *m, void *unused)
-{
-       struct drm_i915_private *dev_priv = node_to_i915(m->private);
-       struct drm_device *dev = &dev_priv->drm;
-       struct intel_engine_cs *engine;
-       int num_rings = INTEL_INFO(dev_priv)->num_rings;
-       enum intel_engine_id id;
-       int j, ret;
-
-       if (!i915_modparams.semaphores) {
-               seq_puts(m, "Semaphores are disabled\n");
-               return 0;
-       }
-
-       ret = mutex_lock_interruptible(&dev->struct_mutex);
-       if (ret)
-               return ret;
-       intel_runtime_pm_get(dev_priv);
-
-       seq_puts(m, "  Last signal:");
-       for_each_engine(engine, dev_priv, id)
-               for (j = 0; j < num_rings; j++)
-                       seq_printf(m, "0x%08x\n",
-                                  I915_READ(engine->semaphore.mbox.signal[j]));
-       seq_putc(m, '\n');
-
-       intel_runtime_pm_put(dev_priv);
-       mutex_unlock(&dev->struct_mutex);
-       return 0;
-}
-
 static int i915_shared_dplls_info(struct seq_file *m, void *unused)
 {
        struct drm_i915_private *dev_priv = node_to_i915(m->private);
@@ -4745,7 +4714,6 @@ static const struct drm_info_list i915_debugfs_list[] = {
        {"i915_display_info", i915_display_info, 0},
        {"i915_engine_info", i915_engine_info, 0},
        {"i915_shrinker_info", i915_shrinker_info, 0},
-       {"i915_semaphore_status", i915_semaphore_status, 0},
        {"i915_shared_dplls_info", i915_shared_dplls_info, 0},
        {"i915_dp_mst_info", i915_dp_mst_info, 0},
        {"i915_wa_registers", i915_wa_registers, 0},
index 1fca7ac3b059d5426fdd884f8b7d9f6dc88a6e7c..ef8e101ebd987447e4a448adb5f779ed95b16abf 100644 (file)
@@ -1713,6 +1713,15 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
                           I915_READ(RING_MI_MODE(engine->mmio_base)),
                           I915_READ(RING_MI_MODE(engine->mmio_base)) & (MODE_IDLE) ? " [idle]" : "");
        }
+       if (i915_modparams.semaphores) {
+               drm_printf(m, "\tSYNC_0: 0x%08x\n",
+                          I915_READ(RING_SYNC_0(engine->mmio_base)));
+               drm_printf(m, "\tSYNC_1: 0x%08x\n",
+                          I915_READ(RING_SYNC_1(engine->mmio_base)));
+               if (HAS_VEBOX(dev_priv))
+                       drm_printf(m, "\tSYNC_2: 0x%08x\n",
+                                  I915_READ(RING_SYNC_2(engine->mmio_base)));
+       }
 
        rcu_read_unlock();