drm/i915: add i915_ips_status debugfs entry
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Fri, 31 May 2013 19:33:24 +0000 (16:33 -0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 31 May 2013 19:40:20 +0000 (21:40 +0200)
It just prints whether it's supported/enabled/disabled. Feature
requested by the power management team.

v2: Checkpatch started complaining about seq_printf with 1 argument.

Requested-by: Kristen Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_debugfs.c

index 2b4a6fa6350e32d2b3aac844cf7110d36c18c299..76255a69752aa5129ae167fff01c7267c00feeb1 100644 (file)
@@ -1435,6 +1435,25 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
        return 0;
 }
 
+static int i915_ips_status(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;
+
+       if (!IS_ULT(dev)) {
+               seq_puts(m, "not supported\n");
+               return 0;
+       }
+
+       if (I915_READ(IPS_CTL) & IPS_ENABLE)
+               seq_puts(m, "enabled\n");
+       else
+               seq_puts(m, "disabled\n");
+
+       return 0;
+}
+
 static int i915_sr_status(struct seq_file *m, void *unused)
 {
        struct drm_info_node *node = (struct drm_info_node *) m->private;
@@ -2233,6 +2252,7 @@ static struct drm_info_list i915_debugfs_list[] = {
        {"i915_ring_freq_table", i915_ring_freq_table, 0},
        {"i915_gfxec", i915_gfxec, 0},
        {"i915_fbc_status", i915_fbc_status, 0},
+       {"i915_ips_status", i915_ips_status, 0},
        {"i915_sr_status", i915_sr_status, 0},
        {"i915_opregion", i915_opregion, 0},
        {"i915_gem_framebuffer", i915_gem_framebuffer_info, 0},