diff mbox

[2/2] drm/i915: Show PCI power state under debugfs/i915_runtime_pm_status

Message ID 1459347521-31558-2-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson March 30, 2016, 2:18 p.m. UTC
As the current PCI power state is an essential feature of runtime pm,
include it in the debugfs/i915_runtime_pm_status.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Daniel Vetter March 30, 2016, 6:55 p.m. UTC | #1
On Wed, Mar 30, 2016 at 03:18:41PM +0100, Chris Wilson wrote:
> As the current PCI power state is an essential feature of runtime pm,
> include it in the debugfs/i915_runtime_pm_status.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index adabbb47a8aa..05d701122259 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2695,10 +2695,8 @@ static int i915_runtime_pm_status(struct seq_file *m, void *unused)
>  	struct drm_device *dev = node->minor->dev;
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  
> -	if (!HAS_RUNTIME_PM(dev)) {
> -		seq_puts(m, "not supported\n");
> -		return 0;
> -	}
> +	if (!HAS_RUNTIME_PM(dev_priv))
> +		seq_puts(m, "Runtime power management not supported\n");
>  
>  	seq_printf(m, "GPU idle: %s\n", yesno(!dev_priv->mm.busy));
>  	seq_printf(m, "IRQs disabled: %s\n",
> @@ -2709,6 +2707,9 @@ static int i915_runtime_pm_status(struct seq_file *m, void *unused)
>  #else
>  	seq_printf(m, "Device Power Management (CONFIG_PM) disabled\n");
>  #endif
> +	seq_printf(m, "PCI device power state: %s [%d]\n",
> +		   pci_power_names[dev_priv->dev->pdev->current_state],

Please use pci_power_name() instead (you are missing a + 1), and I don't
think we need the raw value. With that addressed:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> +		   dev_priv->dev->pdev->current_state);
>  
>  	return 0;
>  }
> -- 
> 2.8.0.rc3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson March 30, 2016, 7:05 p.m. UTC | #2
On Wed, Mar 30, 2016 at 08:55:51PM +0200, Daniel Vetter wrote:
> On Wed, Mar 30, 2016 at 03:18:41PM +0100, Chris Wilson wrote:
> > As the current PCI power state is an essential feature of runtime pm,
> > include it in the debugfs/i915_runtime_pm_status.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_debugfs.c | 9 +++++----
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index adabbb47a8aa..05d701122259 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -2695,10 +2695,8 @@ static int i915_runtime_pm_status(struct seq_file *m, void *unused)
> >  	struct drm_device *dev = node->minor->dev;
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> >  
> > -	if (!HAS_RUNTIME_PM(dev)) {
> > -		seq_puts(m, "not supported\n");
> > -		return 0;
> > -	}
> > +	if (!HAS_RUNTIME_PM(dev_priv))
> > +		seq_puts(m, "Runtime power management not supported\n");
> >  
> >  	seq_printf(m, "GPU idle: %s\n", yesno(!dev_priv->mm.busy));
> >  	seq_printf(m, "IRQs disabled: %s\n",
> > @@ -2709,6 +2707,9 @@ static int i915_runtime_pm_status(struct seq_file *m, void *unused)
> >  #else
> >  	seq_printf(m, "Device Power Management (CONFIG_PM) disabled\n");
> >  #endif
> > +	seq_printf(m, "PCI device power state: %s [%d]\n",
> > +		   pci_power_names[dev_priv->dev->pdev->current_state],
> 
> Please use pci_power_name() instead (you are missing a + 1), and I don't
> think we need the raw value. With that addressed:

I put in the raw value since inside igt that is the value we see when we
look at pci_device_cfg(), so I thought it would be easier for
comparison purposes.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index adabbb47a8aa..05d701122259 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2695,10 +2695,8 @@  static int i915_runtime_pm_status(struct seq_file *m, void *unused)
 	struct drm_device *dev = node->minor->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
-	if (!HAS_RUNTIME_PM(dev)) {
-		seq_puts(m, "not supported\n");
-		return 0;
-	}
+	if (!HAS_RUNTIME_PM(dev_priv))
+		seq_puts(m, "Runtime power management not supported\n");
 
 	seq_printf(m, "GPU idle: %s\n", yesno(!dev_priv->mm.busy));
 	seq_printf(m, "IRQs disabled: %s\n",
@@ -2709,6 +2707,9 @@  static int i915_runtime_pm_status(struct seq_file *m, void *unused)
 #else
 	seq_printf(m, "Device Power Management (CONFIG_PM) disabled\n");
 #endif
+	seq_printf(m, "PCI device power state: %s [%d]\n",
+		   pci_power_names[dev_priv->dev->pdev->current_state],
+		   dev_priv->dev->pdev->current_state);
 
 	return 0;
 }