[Intel-gfx] [PATCH] drm/i915: provide self-refresh status in debugfs
ykzhao
yakui.zhao at intel.com
Mon Feb 8 02:53:04 CET 2010
On Sat, 2010-02-06 at 04:47 +0800, Jesse Barnes wrote:
> Oops, please apply this one instead. I forgot the PINEVIEW check.
> ---
>
> From bd22212e9e2e1a1187acb5ea3e4923af0d9721a1 Mon Sep 17 00:00:00 2001
> From: Jesse Barnes <jbarnes at virtuousgeek.org>
> Date: Fri, 5 Feb 2010 12:39:45 -0800
> Subject: [PATCH] drm/i915: provide self-refresh status in debugfs
>
> Export self-refresh status in debugfs for tools like powertop.
It seems that the G33 is missing.
I am not sure whether the self-refresh is meaningful on I915G platform.
Do we need to consider it?
Thanks.
Yakui
>
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 21 +++++++++++++++++++++
> 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 ff66739..6fee83e 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)
> return 0;
> }
>
> +static int i915_sr_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;
> + drm_i915_private_t *dev_priv = dev->dev_private;
> + bool sr_enabled = false;
> +
> + if (IS_I965G(dev) || IS_I945G(dev) || IS_I945GM(dev))
> + sr_enabled = I915_READ(FW_BLC_SELF) & FW_BLC_SELF_EN;
> + else if (IS_I915GM(dev))
> + sr_enabled = I915_READ(INSTPM) & INSTPM_SELF_EN;
> + else if (IS_PINEVIEW(dev))
> + sr_enabled = I915_READ(DSPFW3) & PINEVIEW_SELF_REFRESH_EN;
> +
> + seq_printf(m, "self-refresh: %s\n", sr_enabled ? "enabled" :
> + "disabled");
> +
> + return 0;
> +}
> +
> static int
> i915_wedged_open(struct inode *inode,
> struct file *filp)
> @@ -648,6 +668,7 @@ static struct drm_info_list i915_debugfs_list[] = {
> {"i915_inttoext_table", i915_inttoext_table, 0},
> {"i915_drpc_info", i915_drpc_info, 0},
> {"i915_fbc_status", i915_fbc_status, 0},
> + {"i915_sr_status", i915_sr_status, 0},
> };
> #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
>
More information about the Intel-gfx
mailing list