@@ -483,6 +483,34 @@ static int i915_rps_boost_info(struct seq_file *m, void *data)
return 0;
}
+#ifdef CONFIG_PM
+static int i915_runtime_dump_child_status(struct device *dev, void *data)
+{
+ struct seq_file *m = data;
+ const char *rpm_status;
+
+ static const char * const status_lookup[] = {
+ [RPM_ACTIVE] = "active",
+ [RPM_RESUMING] = "resuming",
+ [RPM_SUSPENDED] = "suspended",
+ [RPM_SUSPENDING] = "suspending"
+ };
+
+ /* Early return if runtime_pm is disabled */
+ if (dev->power.disable_depth)
+ return 0;
+ else if (dev->power.runtime_status < ARRAY_SIZE(status_lookup))
+ rpm_status = status_lookup[dev->power.runtime_status];
+ else
+ rpm_status = "unknown";
+
+ seq_printf(m, "\t%s %s: Runtime status: %s\n", dev_driver_string(dev),
+ dev_name(dev), rpm_status);
+
+ return 0;
+}
+#endif
+
static int i915_runtime_pm_status(struct seq_file *m, void *unused)
{
struct drm_i915_private *dev_priv = node_to_i915(m->private);
@@ -500,6 +528,10 @@ static int i915_runtime_pm_status(struct seq_file *m, void *unused)
#ifdef CONFIG_PM
seq_printf(m, "Usage count: %d\n",
atomic_read(&dev_priv->drm.dev->power.usage_count));
+ seq_printf(m, "Runtime active children: %d\n",
+ atomic_read(&dev_priv->drm.dev->power.child_count));
+ device_for_each_child(&pdev->dev, m, i915_runtime_dump_child_status);
+
#else
seq_printf(m, "Device Power Management (CONFIG_PM) disabled\n");
#endif