All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Weinehall <david.weinehall@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Show RPS autotuning thresholds along with waitboost
Date: Mon, 15 Aug 2016 11:27:29 +0300	[thread overview]
Message-ID: <20160815082729.iedfvqyfcza33woa@boom> (raw)
In-Reply-To: <1471181336-27523-1-git-send-email-chris@chris-wilson.co.uk>

On Sun, Aug 14, 2016 at 02:28:56PM +0100, Chris Wilson wrote:
> For convenience when debugging user issues show the autotuning
> RPS parameters in debugfs/i915_rps_boost_info.
> 
> v2: Refine the presentation
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: fritsch@kodi.tv

Looks good to me (well, it doesn't, I hate having things on the same
line as the case statement, but that's a personal opinion), compiles
and works as it should.

Reviewed-by: David Weinehall <david.weinehall@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 43 +++++++++++++++++++++++++++++++++++--
>  1 file changed, 41 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index c461072da142..8d302906d768 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2441,6 +2441,16 @@ static int count_irq_waiters(struct drm_i915_private *i915)
>  	return count;
>  }
>  
> +static const char *rps_power_to_str(int power)
> +{
> +	switch (power) {
> +	default: return "unknown";
> +	case LOW_POWER: return "low power";
> +	case BETWEEN: return "mixed";
> +	case HIGH_POWER: return "high power";
> +	}
> +}
> +
>  static int i915_rps_boost_info(struct seq_file *m, void *data)
>  {
>  	struct drm_info_node *node = m->private;
> @@ -2452,12 +2462,17 @@ static int i915_rps_boost_info(struct seq_file *m, void *data)
>  	seq_printf(m, "GPU busy? %s [%x]\n",
>  		   yesno(dev_priv->gt.awake), dev_priv->gt.active_engines);
>  	seq_printf(m, "CPU waiting? %d\n", count_irq_waiters(dev_priv));
> -	seq_printf(m, "Frequency requested %d; min hard:%d, soft:%d; max soft:%d, hard:%d\n",
> -		   intel_gpu_freq(dev_priv, dev_priv->rps.cur_freq),
> +	seq_printf(m, "Frequency requested %d\n",
> +		   intel_gpu_freq(dev_priv, dev_priv->rps.cur_freq));
> +	seq_printf(m, "  min hard:%d, soft:%d; max soft:%d, hard:%d\n",
>  		   intel_gpu_freq(dev_priv, dev_priv->rps.min_freq),
>  		   intel_gpu_freq(dev_priv, dev_priv->rps.min_freq_softlimit),
>  		   intel_gpu_freq(dev_priv, dev_priv->rps.max_freq_softlimit),
>  		   intel_gpu_freq(dev_priv, dev_priv->rps.max_freq));
> +	seq_printf(m, "  idle:%d, efficient:%d, boost:%d\n",
> +		   intel_gpu_freq(dev_priv, dev_priv->rps.idle_freq),
> +		   intel_gpu_freq(dev_priv, dev_priv->rps.efficient_freq),
> +		   intel_gpu_freq(dev_priv, dev_priv->rps.boost_freq));
>  
>  	mutex_lock(&dev->filelist_mutex);
>  	spin_lock(&dev_priv->rps.client_lock);
> @@ -2478,6 +2493,30 @@ static int i915_rps_boost_info(struct seq_file *m, void *data)
>  	spin_unlock(&dev_priv->rps.client_lock);
>  	mutex_unlock(&dev->filelist_mutex);
>  
> +	if (INTEL_GEN(dev_priv) >= 6 &&
> +	    dev_priv->rps.enabled &&
> +	    dev_priv->gt.active_engines) {
> +		u32 rpupei, rpcurup;
> +		u32 rpdownei, rpcurdown;
> +
> +		intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
> +		rpupei = I915_READ_FW(GEN6_RP_CUR_UP_EI) & GEN6_CURICONT_MASK;
> +		rpcurup = I915_READ_FW(GEN6_RP_CUR_UP) & GEN6_CURBSYTAVG_MASK;
> +		rpdownei = I915_READ_FW(GEN6_RP_CUR_DOWN_EI) & GEN6_CURIAVG_MASK;
> +		rpcurdown = I915_READ_FW(GEN6_RP_CUR_DOWN) & GEN6_CURBSYTAVG_MASK;
> +		intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
> +
> +		seq_printf(m, "\nRPS Autotuning (current \"%s\" window):\n",
> +			   rps_power_to_str(dev_priv->rps.power));
> +		seq_printf(m, "  Avg. up: %d%% [above threshold? %d%%]\n",
> +			   100*rpcurup/rpupei,
> +			   dev_priv->rps.up_threshold);
> +		seq_printf(m, "  Avg. down: %d%% [below threshold? %d%%]\n",
> +			   100*rpcurdown/rpdownei,
> +			   dev_priv->rps.down_threshold);
> +	} else
> +		seq_printf(m, "\nRPS Autotuning inactive\n");
> +
>  	return 0;
>  }
>  
> -- 
> 2.8.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-08-15  8:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-14  8:52 [PATCH] drm/i915: Show RPS autotuning thresholds along with waitboost Chris Wilson
2016-08-14  9:21 ` ✗ Ro.CI.BAT: failure for " Patchwork
2016-08-14 13:28 ` [PATCH v2] " Chris Wilson
2016-08-14 13:58   ` kbuild test robot
2016-08-15  8:27   ` David Weinehall [this message]
2016-08-14 13:52 ` ✗ Ro.CI.BAT: failure for drm/i915: Show RPS autotuning thresholds along with waitboost (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160815082729.iedfvqyfcza33woa@boom \
    --to=david.weinehall@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.