diff mbox

[3/3] drm/i915: Add rc6vids to debugfs

Message ID 1348680842-3036-3-git-send-email-ben@bwidawsk.net (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Widawsky Sept. 26, 2012, 5:34 p.m. UTC
CC: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Jesse Barnes Sept. 27, 2012, 6:06 p.m. UTC | #1
On Wed, 26 Sep 2012 10:34:02 -0700
Ben Widawsky <ben@bwidawsk.net> wrote:

> CC: Jesse Barnes <jbarnes@virtuousgeek.org>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 6647585..3c5710f 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1069,7 +1069,7 @@ static int gen6_drpc_info(struct seq_file *m)
>  	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;
> -	u32 rpmodectl1, gt_core_status, rcctl1;
> +	u32 rpmodectl1, gt_core_status, rcctl1, rc6vids = 0;
>  	unsigned forcewake_count;
>  	int count=0, ret;
>  
> @@ -1097,6 +1097,7 @@ static int gen6_drpc_info(struct seq_file *m)
>  
>  	rpmodectl1 = I915_READ(GEN6_RP_CONTROL);
>  	rcctl1 = I915_READ(GEN6_RC_CONTROL);
> +	sandybridge_pcode_read(dev_priv, GEN6_PCODE_READ_RC6VIDS, &rc6vids);
>  	mutex_unlock(&dev->struct_mutex);
>  
>  	seq_printf(m, "Video Turbo Mode: %s\n",
> @@ -1149,6 +1150,12 @@ static int gen6_drpc_info(struct seq_file *m)
>  	seq_printf(m, "RC6++ residency since boot: %u\n",
>  		   I915_READ(GEN6_GT_GFX_RC6pp));
>  
> +	seq_printf(m, "RC6   voltage: %dmV\n",
> +		   GEN6_DECODE_RC6_VID(((rc6vids >> 0) & 0xff)));
> +	seq_printf(m, "RC6+  voltage: %dmV\n",
> +		   GEN6_DECODE_RC6_VID(((rc6vids >> 8) & 0xff)));
> +	seq_printf(m, "RC6++ voltage: %dmV\n",
> +		   GEN6_DECODE_RC6_VID(((rc6vids >> 16) & 0xff)));
>  	return 0;
>  }
>  

Nice.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Daniel Vetter Oct. 15, 2012, 7 p.m. UTC | #2
On Thu, Sep 27, 2012 at 11:06:21AM -0700, Jesse Barnes wrote:
> On Wed, 26 Sep 2012 10:34:02 -0700
> Ben Widawsky <ben@bwidawsk.net> wrote:
> 
> > CC: Jesse Barnes <jbarnes@virtuousgeek.org>
> > Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> > ---
> >  drivers/gpu/drm/i915/i915_debugfs.c | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index 6647585..3c5710f 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -1069,7 +1069,7 @@ static int gen6_drpc_info(struct seq_file *m)
> >  	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;
> > -	u32 rpmodectl1, gt_core_status, rcctl1;
> > +	u32 rpmodectl1, gt_core_status, rcctl1, rc6vids = 0;
> >  	unsigned forcewake_count;
> >  	int count=0, ret;
> >  
> > @@ -1097,6 +1097,7 @@ static int gen6_drpc_info(struct seq_file *m)
> >  
> >  	rpmodectl1 = I915_READ(GEN6_RP_CONTROL);
> >  	rcctl1 = I915_READ(GEN6_RC_CONTROL);
> > +	sandybridge_pcode_read(dev_priv, GEN6_PCODE_READ_RC6VIDS, &rc6vids);
> >  	mutex_unlock(&dev->struct_mutex);
> >  
> >  	seq_printf(m, "Video Turbo Mode: %s\n",
> > @@ -1149,6 +1150,12 @@ static int gen6_drpc_info(struct seq_file *m)
> >  	seq_printf(m, "RC6++ residency since boot: %u\n",
> >  		   I915_READ(GEN6_GT_GFX_RC6pp));
> >  
> > +	seq_printf(m, "RC6   voltage: %dmV\n",
> > +		   GEN6_DECODE_RC6_VID(((rc6vids >> 0) & 0xff)));
> > +	seq_printf(m, "RC6+  voltage: %dmV\n",
> > +		   GEN6_DECODE_RC6_VID(((rc6vids >> 8) & 0xff)));
> > +	seq_printf(m, "RC6++ voltage: %dmV\n",
> > +		   GEN6_DECODE_RC6_VID(((rc6vids >> 16) & 0xff)));
> >  	return 0;
> >  }
> >  
> 
> Nice.
> 
> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

Queued for -next, thanks for the patch.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 6647585..3c5710f 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1069,7 +1069,7 @@  static int gen6_drpc_info(struct seq_file *m)
 	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;
-	u32 rpmodectl1, gt_core_status, rcctl1;
+	u32 rpmodectl1, gt_core_status, rcctl1, rc6vids = 0;
 	unsigned forcewake_count;
 	int count=0, ret;
 
@@ -1097,6 +1097,7 @@  static int gen6_drpc_info(struct seq_file *m)
 
 	rpmodectl1 = I915_READ(GEN6_RP_CONTROL);
 	rcctl1 = I915_READ(GEN6_RC_CONTROL);
+	sandybridge_pcode_read(dev_priv, GEN6_PCODE_READ_RC6VIDS, &rc6vids);
 	mutex_unlock(&dev->struct_mutex);
 
 	seq_printf(m, "Video Turbo Mode: %s\n",
@@ -1149,6 +1150,12 @@  static int gen6_drpc_info(struct seq_file *m)
 	seq_printf(m, "RC6++ residency since boot: %u\n",
 		   I915_READ(GEN6_GT_GFX_RC6pp));
 
+	seq_printf(m, "RC6   voltage: %dmV\n",
+		   GEN6_DECODE_RC6_VID(((rc6vids >> 0) & 0xff)));
+	seq_printf(m, "RC6+  voltage: %dmV\n",
+		   GEN6_DECODE_RC6_VID(((rc6vids >> 8) & 0xff)));
+	seq_printf(m, "RC6++ voltage: %dmV\n",
+		   GEN6_DECODE_RC6_VID(((rc6vids >> 16) & 0xff)));
 	return 0;
 }