All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/bxt: fix RC6 residency time calculation
@ 2015-09-29 12:07 Imre Deak
  2015-09-29 13:17 ` Ville Syrjälä
  2015-09-29 13:28 ` [PATCH v2] " Imre Deak
  0 siblings, 2 replies; 5+ messages in thread
From: Imre Deak @ 2015-09-29 12:07 UTC (permalink / raw)
  To: intel-gfx

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 {
+		units = 1;
+		div = 1200;		/* 833.33ns */
 	}
 
 	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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/i915/bxt: fix RC6 residency time calculation
  2015-09-29 12:07 [PATCH] drm/i915/bxt: fix RC6 residency time calculation Imre Deak
@ 2015-09-29 13:17 ` Ville Syrjälä
  2015-09-29 13:28 ` [PATCH v2] " Imre Deak
  1 sibling, 0 replies; 5+ messages in thread
From: Ville Syrjälä @ 2015-09-29 13:17 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-gfx

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] drm/i915/bxt: fix RC6 residency time calculation
  2015-09-29 12:07 [PATCH] drm/i915/bxt: fix RC6 residency time calculation Imre Deak
  2015-09-29 13:17 ` Ville Syrjälä
@ 2015-09-29 13:28 ` Imre Deak
  2015-09-29 19:03   ` Ville Syrjälä
  1 sibling, 1 reply; 5+ messages in thread
From: Imre Deak @ 2015-09-29 13:28 UTC (permalink / raw)
  To: intel-gfx

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.

v2:
- add missing IS_BROXTON check (Ville)

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..50ce9ce 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 if (IS_BROXTON(dev)) {
+		units = 1;
+		div = 1200;		/* 833.33ns */
 	}
 
 	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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm/i915/bxt: fix RC6 residency time calculation
  2015-09-29 13:28 ` [PATCH v2] " Imre Deak
@ 2015-09-29 19:03   ` Ville Syrjälä
  2015-09-30 12:26     ` Daniel Vetter
  0 siblings, 1 reply; 5+ messages in thread
From: Ville Syrjälä @ 2015-09-29 19:03 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-gfx

On Tue, Sep 29, 2015 at 04:28:46PM +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.
> 
> v2:
> - add missing IS_BROXTON check (Ville)
> 
> Testcase: igt/pm_rc6_residency
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.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..50ce9ce 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 if (IS_BROXTON(dev)) {
> +		units = 1;
> +		div = 1200;		/* 833.33ns */
>  	}
>  
>  	raw_time = I915_READ(reg) * units;
> -- 
> 2.1.4

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm/i915/bxt: fix RC6 residency time calculation
  2015-09-29 19:03   ` Ville Syrjälä
@ 2015-09-30 12:26     ` Daniel Vetter
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2015-09-30 12:26 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

On Tue, Sep 29, 2015 at 10:03:43PM +0300, Ville Syrjälä wrote:
> On Tue, Sep 29, 2015 at 04:28:46PM +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.
> > 
> > v2:
> > - add missing IS_BROXTON check (Ville)
> > 
> > Testcase: igt/pm_rc6_residency
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Queued for -next, thanks for the patch.
-Daniel

> 
> > ---
> >  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..50ce9ce 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 if (IS_BROXTON(dev)) {
> > +		units = 1;
> > +		div = 1200;		/* 833.33ns */
> >  	}
> >  
> >  	raw_time = I915_READ(reg) * units;
> > -- 
> > 2.1.4
> 
> -- 
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-30 12:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-29 12:07 [PATCH] drm/i915/bxt: fix RC6 residency time calculation Imre Deak
2015-09-29 13:17 ` Ville Syrjälä
2015-09-29 13:28 ` [PATCH v2] " Imre Deak
2015-09-29 19:03   ` Ville Syrjälä
2015-09-30 12:26     ` Daniel Vetter

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.