All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/6] drm/i915: Use coarse grained residency counter with byt
Date: Wed, 15 Mar 2017 15:56:27 +0000	[thread overview]
Message-ID: <20170315155627.GD2118@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <1489592584-10422-6-git-send-email-mika.kuoppala@intel.com>

On Wed, Mar 15, 2017 at 05:43:04PM +0200, Mika Kuoppala wrote:
> Set byt rc residency counters high level as chv does by
> default. We lose some accuracy on byt but we can do the calculation
> without extra hw read on both platforms, as now they behave
> identically in this respect.
> 
> v2: use ktime
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 9 ++-------
>  drivers/gpu/drm/i915/intel_pm.c | 9 +++------
>  2 files changed, 5 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index f73d8db..7fb35a5 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1100,11 +1100,6 @@ static u32 vlv_wa_c0_ei(struct drm_i915_private *dev_priv, u32 pm_iir)
>  	if (prev->ktime) {
>  		u64 time, c0;
>  		u32 render, media;
> -		unsigned int mul;
> -
> -		mul = 1000 * 100; /* scale to threshold% */
> -		if (I915_READ(VLV_COUNTER_CONTROL) & VLV_COUNT_RANGE_HIGH)
> -			mul <<= 8;
>  
>  		time = ktime_us_delta(now.ktime, prev->ktime);
>  		time *= dev_priv->czclk_freq;
> @@ -1116,8 +1111,8 @@ static u32 vlv_wa_c0_ei(struct drm_i915_private *dev_priv, u32 pm_iir)
>  		 */
>  		render = now.render_c0 - prev->render_c0;
>  		media = now.media_c0 - prev->media_c0;
> -		c0 = max(render, media);
> -		c0 *= mul;
> +		c0 = max_t(u64, render, media) << 8; /* upper part of 40 bit */

Keep the comparison at u32, do the promotion afterwards, be kind to
32bit machines, i.e.  c0 *= 1000 * 100 << 8; as before

With that
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-03-15 15:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 15:42 [PATCH 1/6] drm/i915: Move residency calculation into intel_pm.c Mika Kuoppala
2017-03-15 15:43 ` [PATCH 2/6] drm/i915: Return residency as microseconds Mika Kuoppala
2017-03-15 15:58   ` Chris Wilson
2017-03-15 15:43 ` [PATCH 3/6] drm/i915: Extend vlv/chv residency resolution Mika Kuoppala
2017-03-15 15:52   ` Chris Wilson
2017-03-15 16:07     ` Mika Kuoppala
2017-03-15 15:43 ` [PATCH 4/6] drm/i915: Convert debugfs to use generic residency calculator Mika Kuoppala
2017-03-15 15:56   ` Chris Wilson
2017-03-15 15:43 ` [PATCH 5/6] drm/i915: Use ktime to calculate rc0 residency Mika Kuoppala
2017-03-15 15:57   ` Chris Wilson
2017-03-15 15:43 ` [PATCH 6/6] drm/i915: Use coarse grained residency counter with byt Mika Kuoppala
2017-03-15 15:56   ` Chris Wilson [this message]
2017-03-15 16:12     ` Mika Kuoppala
2017-03-15 15:58 ` [PATCH 1/6] drm/i915: Move residency calculation into intel_pm.c Chris Wilson
2017-03-16 10:52   ` Mika Kuoppala
2017-03-15 17:50 ` ✓ Fi.CI.BAT: success for series starting with [1/6] drm/i915: Move residency calculation into intel_pm.c (rev3) 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=20170315155627.GD2118@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@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.