aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2010-02-05 15:47:35 -0500
committerEric Anholt <eric@anholt.net>2010-02-22 11:46:58 -0500
commit4a9bef37e5cf2c73b61ecc9ead52cad2eb4a372b (patch)
tree54575d1c9518ef71c4d59939dde0e2ce780f7e07 /drivers/gpu/drm/i915
parentb5e50c3f56ee4aa0d0168eab5ece413ac5df76aa (diff)
drm/i915: provide self-refresh status in debugfs
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 96e8b9b2cb32..56095b3d28ce 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -525,6 +525,26 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
525 return 0; 525 return 0;
526} 526}
527 527
528static int i915_sr_status(struct seq_file *m, void *unused)
529{
530 struct drm_info_node *node = (struct drm_info_node *) m->private;
531 struct drm_device *dev = node->minor->dev;
532 drm_i915_private_t *dev_priv = dev->dev_private;
533 bool sr_enabled = false;
534
535 if (IS_I965G(dev) || IS_I945G(dev) || IS_I945GM(dev))
536 sr_enabled = I915_READ(FW_BLC_SELF) & FW_BLC_SELF_EN;
537 else if (IS_I915GM(dev))
538 sr_enabled = I915_READ(INSTPM) & INSTPM_SELF_EN;
539 else if (IS_PINEVIEW(dev))
540 sr_enabled = I915_READ(DSPFW3) & PINEVIEW_SELF_REFRESH_EN;
541
542 seq_printf(m, "self-refresh: %s\n", sr_enabled ? "enabled" :
543 "disabled");
544
545 return 0;
546}
547
528static int 548static int
529i915_wedged_open(struct inode *inode, 549i915_wedged_open(struct inode *inode,
530 struct file *filp) 550 struct file *filp)
@@ -648,6 +668,7 @@ static struct drm_info_list i915_debugfs_list[] = {
648 {"i915_inttoext_table", i915_inttoext_table, 0}, 668 {"i915_inttoext_table", i915_inttoext_table, 0},
649 {"i915_drpc_info", i915_drpc_info, 0}, 669 {"i915_drpc_info", i915_drpc_info, 0},
650 {"i915_fbc_status", i915_fbc_status, 0}, 670 {"i915_fbc_status", i915_fbc_status, 0},
671 {"i915_sr_status", i915_sr_status, 0},
651}; 672};
652#define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list) 673#define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
653 674