public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/bxt: fix RC6 residency time calculation
Date: Tue, 29 Sep 2015 16:17:56 +0300	[thread overview]
Message-ID: <20150929131756.GW26517@intel.com> (raw)
In-Reply-To: <1443528479-17636-1-git-send-email-imre.deak@intel.com>

On Tue, Sep 29, 2015 at 03:07:59PM +0300, Imre Deak wrote:
> The RC6 residency time unit is 833.33ns on BXT according to the
> specification, so update the calculation accordingly. Use the same way
> as CHV/VLV to divide by the corresponding frequency, as I think this is
> the more natural unit for what the HW does internally.
> 
> Testcase: igt/pm_rc6_residency
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_sysfs.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> index 74086eb..7879255 100644
> --- a/drivers/gpu/drm/i915/i915_sysfs.c
> +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> @@ -54,6 +54,9 @@ static u32 calc_residency(struct drm_device *dev, const u32 reg)
>  
>  		if (I915_READ(VLV_COUNTER_CONTROL) & VLV_COUNT_RANGE_HIGH)
>  			units <<= 8;
> +	} else {

missing IS_BROXTON()

> +		units = 1;
> +		div = 1200;		/* 833.33ns */

Yeah, so based on Bspec "Timestamp bases" section, this is
in fact 16 19.2MHz clocks.

With the bxt check added this is
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  	}
>  
>  	raw_time = I915_READ(reg) * units;
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-09-29 13:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29 12:07 [PATCH] drm/i915/bxt: fix RC6 residency time calculation Imre Deak
2015-09-29 13:17 ` Ville Syrjälä [this message]
2015-09-29 13:28 ` [PATCH v2] " Imre Deak
2015-09-29 19:03   ` Ville Syrjälä
2015-09-30 12:26     ` 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=20150929131756.GW26517@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=imre.deak@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox