All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/i915: Clean up VLV rps code a bit
Date: Tue, 25 Jun 2013 11:59:11 -0700	[thread overview]
Message-ID: <20130625115911.5733573e@jbarnes-desktop> (raw)
In-Reply-To: <1372177266-2665-2-git-send-email-ville.syrjala@linux.intel.com>

On Tue, 25 Jun 2013 19:21:01 +0300
ville.syrjala@linux.intel.com wrote:

> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Always print both the MHz value and raw register value for rps stuff.
> 
> Also kill a somewhat pointless local 'rpe' variable and just use
> dev_priv->rps.rpe_delay.
> 
> While at it clean up the caps in "GPU" and "Punit" debug messages.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 50 ++++++++++++++++++++++++-----------------
>  1 file changed, 30 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 3705203..48a3162 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3077,10 +3077,11 @@ void valleyview_set_rps(struct drm_device *dev, u8 val)
>  	WARN_ON(val > dev_priv->rps.max_delay);
>  	WARN_ON(val < dev_priv->rps.min_delay);
>  
> -	DRM_DEBUG_DRIVER("gpu freq request from %d to %d\n",
> +	DRM_DEBUG_DRIVER("GPU freq request from %d MHz (%u) to %d MHz (%u)\n",
>  			 vlv_gpu_freq(dev_priv->mem_freq,
>  				      dev_priv->rps.cur_delay),
> -			 vlv_gpu_freq(dev_priv->mem_freq, val));
> +			 dev_priv->rps.cur_delay,
> +			 vlv_gpu_freq(dev_priv->mem_freq, val), val);
>  
>  	if (val == dev_priv->rps.cur_delay)
>  		return;
> @@ -3098,8 +3099,9 @@ void valleyview_set_rps(struct drm_device *dev, u8 val)
>  
>  	pval = vlv_punit_read(dev_priv, PUNIT_REG_GPU_FREQ_STS);
>  	if ((pval >> 8) != val)
> -		DRM_DEBUG_DRIVER("punit overrode freq: %d requested, but got %d\n",
> -			  val, pval >> 8);
> +		DRM_DEBUG_DRIVER("Punit overrode GPU freq: %d MHz (%u) requested, but got %d Mhz (%u)\n",
> +				 vlv_gpu_freq(dev_priv->mem_freq, val), val,
> +				 vlv_gpu_freq(dev_priv->mem_freq, pval >> 8), pval >> 8);
>  
>  	/* Make sure we continue to get interrupts
>  	 * until we hit the minimum or maximum frequencies.
> @@ -3493,7 +3495,7 @@ static void valleyview_enable_rps(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct intel_ring_buffer *ring;
> -	u32 gtfifodbg, val, rpe;
> +	u32 gtfifodbg, val;
>  	int i;
>  
>  	WARN_ON(!mutex_is_locked(&dev_priv->rps.hw_lock));
> @@ -3554,31 +3556,39 @@ static void valleyview_enable_rps(struct drm_device *dev)
>  	DRM_DEBUG_DRIVER("GPLL enabled? %s\n", val & 0x10 ? "yes" : "no");
>  	DRM_DEBUG_DRIVER("GPU status: 0x%08x\n", val);
>  
> -	DRM_DEBUG_DRIVER("current GPU freq: %d\n",
> -			 vlv_gpu_freq(dev_priv->mem_freq, (val >> 8) & 0xff));
>  	dev_priv->rps.cur_delay = (val >> 8) & 0xff;
> +	DRM_DEBUG_DRIVER("current GPU freq: %d MHz (%u)\n",
> +			 vlv_gpu_freq(dev_priv->mem_freq,
> +				      dev_priv->rps.cur_delay),
> +			 dev_priv->rps.cur_delay);
>  
>  	dev_priv->rps.max_delay = valleyview_rps_max_freq(dev_priv);
>  	dev_priv->rps.hw_max = dev_priv->rps.max_delay;
> -	DRM_DEBUG_DRIVER("max GPU freq: %d\n", vlv_gpu_freq(dev_priv->mem_freq,
> -						     dev_priv->rps.max_delay));
> +	DRM_DEBUG_DRIVER("max GPU freq: %d MHz (%u)\n",
> +			 vlv_gpu_freq(dev_priv->mem_freq,
> +				      dev_priv->rps.max_delay),
> +			 dev_priv->rps.max_delay);
>  
> -	rpe = valleyview_rps_rpe_freq(dev_priv);
> -	DRM_DEBUG_DRIVER("RPe GPU freq: %d\n",
> -			 vlv_gpu_freq(dev_priv->mem_freq, rpe));
> -	dev_priv->rps.rpe_delay = rpe;
> +	dev_priv->rps.rpe_delay = valleyview_rps_rpe_freq(dev_priv);
> +	DRM_DEBUG_DRIVER("RPe GPU freq: %d MHz (%u)\n",
> +			 vlv_gpu_freq(dev_priv->mem_freq,
> +				      dev_priv->rps.rpe_delay),
> +			 dev_priv->rps.rpe_delay);
>  
> -	val = valleyview_rps_min_freq(dev_priv);
> -	DRM_DEBUG_DRIVER("min GPU freq: %d\n", vlv_gpu_freq(dev_priv->mem_freq,
> -							    val));
> -	dev_priv->rps.min_delay = val;
> +	dev_priv->rps.min_delay = valleyview_rps_min_freq(dev_priv);
> +	DRM_DEBUG_DRIVER("min GPU freq: %d MHz (%u)\n",
> +			 vlv_gpu_freq(dev_priv->mem_freq,
> +				      dev_priv->rps.min_delay),
> +			 dev_priv->rps.min_delay);
>  
> -	DRM_DEBUG_DRIVER("setting GPU freq to %d\n",
> -			 vlv_gpu_freq(dev_priv->mem_freq, rpe));
> +	DRM_DEBUG_DRIVER("setting GPU freq to %d MHz (%u)\n",
> +			 vlv_gpu_freq(dev_priv->mem_freq,
> +				      dev_priv->rps.rpe_delay),
> +			 dev_priv->rps.rpe_delay);
>  
>  	INIT_DELAYED_WORK(&dev_priv->rps.vlv_work, vlv_rps_timer_work);
>  
> -	valleyview_set_rps(dev_priv->dev, rpe);
> +	valleyview_set_rps(dev_priv->dev, dev_priv->rps.rpe_delay);
>  
>  	/* requires MSI enabled */
>  	I915_WRITE(GEN6_PMIER, GEN6_PM_RPS_EVENTS);

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

-- 
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2013-06-25 18:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25 16:21 [PATCH 0/6] drm/i915: VLV rps stuff ville.syrjala
2013-06-25 16:21 ` [PATCH 1/6] drm/i915: Clean up VLV rps code a bit ville.syrjala
2013-06-25 18:59   ` Jesse Barnes [this message]
2013-06-25 16:21 ` [PATCH 2/6] drm/i915: Don't wait for Punit after each freq change on VLV ville.syrjala
2013-06-25 19:02   ` Jesse Barnes
2013-06-25 16:21 ` [PATCH 3/6] drm/i915: Optimize the VLV Punit wait a bit ville.syrjala
2013-06-25 19:03   ` Jesse Barnes
2013-06-26 10:17   ` Daniel Vetter
2013-06-26 14:43     ` [PATCH] drm/i915: Use wait_for() to wait for Punit to change GPU freq on VLV ville.syrjala
2013-06-26 16:26       ` Jesse Barnes
2013-07-02 13:41         ` Daniel Vetter
2013-07-02 14:01         ` Daniel Vetter
2013-06-25 16:21 ` [PATCH 4/6] drm/i915: Use msecs_to_jiffies_timeout when waiting for Punit freq change ville.syrjala
2013-06-25 19:03   ` Jesse Barnes
2013-06-25 16:21 ` [PATCH 5/6] drm/i915: Make the rps new_delay comparison more readable ville.syrjala
2013-06-25 19:06   ` Jesse Barnes
2013-06-25 16:21 ` [PATCH 6/6] drm/i915: GEN6_RP_INTERRUPT_LIMITS doesn't seem to exist on VLV ville.syrjala
2013-06-25 19:06   ` Jesse Barnes
2013-06-26 10:19     ` Daniel Vetter

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=20130625115911.5733573e@jbarnes-desktop \
    --to=jbarnes@virtuousgeek.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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.