[Intel-gfx] [PATCH 8/8] drm/i915: add a debugfs entry for power domain info
Imre Deak
imre.deak at intel.com
Fri Nov 1 18:19:54 CET 2013
Signed-off-by: Imre Deak <imre.deak at intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 68 +++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 5c45e9e..a32f3c4 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1760,6 +1760,73 @@ static int i915_pc8_status(struct seq_file *m, void *unused)
return 0;
}
+static const char *power_domain_str(enum intel_display_power_domain domain)
+{
+#define PWRD(p) { POWER_DOMAIN_ ## p, # p }
+ static struct {
+ enum intel_display_power_domain domain;
+ const char *name;
+ } table[] = {
+ PWRD(PIPE_A),
+ PWRD(PIPE_B),
+ PWRD(PIPE_C),
+ PWRD(PIPE_A_PANEL_FITTER),
+ PWRD(PIPE_B_PANEL_FITTER),
+ PWRD(PIPE_C_PANEL_FITTER),
+ PWRD(TRANSCODER_A),
+ PWRD(TRANSCODER_B),
+ PWRD(TRANSCODER_C),
+ PWRD(TRANSCODER_EDP),
+ PWRD(VGA),
+ PWRD(AUDIO),
+ PWRD(INIT),
+ };
+#undef PWRD
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(table); i++)
+ if (table[i].domain == domain)
+ return table[i].name;
+
+ WARN_ON(1);
+
+ return "?";
+}
+
+static int i915_power_domain_info(struct seq_file *m, void *unused)
+{
+ struct drm_info_node *node = (struct drm_info_node *) m->private;
+ struct drm_device *dev = node->minor->dev;
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ struct i915_power_domains *power_domains = &dev_priv->power_domains;
+ int i;
+
+ mutex_lock(&power_domains->lock);
+
+ for (i = 0; i < power_domains->power_well_count; i++) {
+ struct i915_power_well *power_well;
+ enum intel_display_power_domain power_domain;
+
+ power_well = &power_domains->power_wells[i];
+ seq_printf(m, "Power well: %s\n", power_well->name);
+ seq_printf(m, " Use count: %d\n", power_well->count);
+ seq_printf(m, " Power domains:\n");
+
+ for (power_domain = 0; power_domain < POWER_DOMAIN_NUM;
+ power_domain++) {
+ if (!(BIT(power_domain) & power_well->domains))
+ continue;
+
+ seq_printf(m, " %s\n",
+ power_domain_str(power_domain));
+ }
+ }
+
+ mutex_unlock(&power_domains->lock);
+
+ return 0;
+}
+
struct pipe_crc_info {
const char *name;
struct drm_device *dev;
@@ -2820,6 +2887,7 @@ static struct drm_info_list i915_debugfs_list[] = {
{"i915_edp_psr_status", i915_edp_psr_status, 0},
{"i915_energy_uJ", i915_energy_uJ, 0},
{"i915_pc8_status", i915_pc8_status, 0},
+ {"i915_power_domain_info", i915_power_domain_info, 0},
};
#define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
--
1.8.4
More information about the Intel-gfx
mailing list