diff options
author | Mika Kuoppala <mika.kuoppala@linux.intel.com> | 2017-03-15 19:12:59 +0300 |
---|---|---|
committer | Mika Kuoppala <mika.kuoppala@intel.com> | 2017-03-16 13:28:28 +0300 |
commit | 6b7f6aa75e38ef4e2bfb9e13726f6561e682892f (patch) | |
tree | c0028fc967d28217d8ffb5f2ef2a4de548d488bb /drivers/gpu/drm/i915/i915_irq.c | |
parent | 679cb6c1320bc0d4b1572a4cf0988c3bba66becf (diff) | |
download | linux-6b7f6aa75e38ef4e2bfb9e13726f6561e682892f.tar.xz |
drm/i915: Use coarse grained residency counter with byt
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
v3: keep comparison u32 (Chris)
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>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1489592584-10422-1-git-send-email-mika.kuoppala@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index fcefa45162b1..ea92af229133 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1102,11 +1102,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; @@ -1119,7 +1114,7 @@ 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 *= 1000 * 100 << 8; /* to usecs and scale to threshold% */ if (c0 > time * dev_priv->rps.up_threshold) events = GEN6_PM_RP_UP_THRESHOLD; |