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 2/7] drm/i915: Return residency as microseconds
Date: Tue, 14 Mar 2017 14:18:38 +0000	[thread overview]
Message-ID: <20170314141838.GK2118@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <1489497449-31640-2-git-send-email-mika.kuoppala@intel.com>

On Tue, Mar 14, 2017 at 03:17:24PM +0200, Mika Kuoppala wrote:
> Change the granularity from milliseconds to microseconds
> when returning rc6 residencies. This is in preparation
> for increased resolution on some platforms.
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h   |  4 ++--
>  drivers/gpu/drm/i915/i915_sysfs.c |  2 +-
>  drivers/gpu/drm/i915/intel_pm.c   | 12 ++++++------
>  3 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 4aee323..0023e21 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -3874,8 +3874,8 @@ void vlv_phy_reset_lanes(struct intel_encoder *encoder);
>  
>  int intel_gpu_freq(struct drm_i915_private *dev_priv, int val);
>  int intel_freq_opcode(struct drm_i915_private *dev_priv, int val);
> -u32 intel_rc6_residency(struct drm_i915_private *dev_priv,
> -			i915_reg_t reg);
> +u64 intel_rc6_residency_us(struct drm_i915_private *dev_priv,
> +			   const i915_reg_t reg);
>  
>  #define I915_READ8(reg)		dev_priv->uncore.funcs.mmio_readb(dev_priv, (reg), true)
>  #define I915_WRITE8(reg, val)	dev_priv->uncore.funcs.mmio_writeb(dev_priv, (reg), (val), true)
> diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> index ab723e3..a0b35a8 100644
> --- a/drivers/gpu/drm/i915/i915_sysfs.c
> +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> @@ -42,7 +42,7 @@ static inline struct drm_i915_private *kdev_minor_to_i915(struct device *kdev)
>  static u32 calc_residency(struct drm_i915_private *dev_priv,
>  			  i915_reg_t reg)
>  {
> -	return intel_rc6_residency(dev_priv, reg);
> +	return DIV_ROUND_UP(intel_rc6_residency_us(dev_priv, reg), 1000);

Is DIV_ROUND_UP() 64bit safe? I think this needs DIV_ROUND_UP_ULL()
-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-14 14:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14 13:17 [PATCH 1/7] drm/i915: Move residency calculation into intel_pm.c Mika Kuoppala
2017-03-14 13:17 ` [PATCH 2/7] drm/i915: Return residency as microseconds Mika Kuoppala
2017-03-14 14:18   ` Chris Wilson [this message]
2017-03-14 13:17 ` [PATCH 3/7] drm/i915: Extend vlv/chv residency resolution Mika Kuoppala
2017-03-14 14:16   ` Chris Wilson
2017-03-14 13:17 ` [PATCH 4/7] drm/i915: Convert debugfs to use generic residency calculator Mika Kuoppala
2017-03-14 14:19   ` Chris Wilson
2017-03-14 13:17 ` [PATCH 5/7] drm/i915: Use cpu clock to calculate rc0 residency Mika Kuoppala
2017-03-14 13:30   ` Chris Wilson
2017-03-14 13:48     ` Ville Syrjälä
2017-03-14 13:17 ` [PATCH 6/7] drm/i915: Use coarse grained residency counter with byt Mika Kuoppala
2017-03-14 13:17 ` [PATCH 7/7] drm/i915: Upclock on the first residency calculation Mika Kuoppala
2017-03-14 13:34   ` Chris Wilson
2017-03-14 13:36     ` Mika Kuoppala
2017-03-14 18:46 ` ✗ Fi.CI.BAT: warning for series starting with [1/7] drm/i915: Move residency calculation into intel_pm.c 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=20170314141838.GK2118@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.