Skip to content

Commit

Permalink
drm/i915: fix GMCH power reporting
Browse files Browse the repository at this point in the history
The IPS driver needs to know the current power consumption of the GMCH
in order to make decisions about when to increase or decrease the CPU
and/or GPU power envelope.  So fix up the divisions to save the results
so the numbers are actually correct (contrary to some earlier comments
and code, these functions do not modify the first argument and use it
for the result).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
  • Loading branch information
Jesse Barnes authored and Chris Wilson committed Sep 27, 2010
1 parent cf9a2f3 commit d270ae3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1787,9 +1787,9 @@ unsigned long i915_chipset_val(struct drm_i915_private *dev_priv)
}
}

div_u64(diff, diff1);
diff = div_u64(diff, diff1);
ret = ((m * diff) + c);
div_u64(ret, 10);
ret = div_u64(ret, 10);

dev_priv->last_count1 = total_count;
dev_priv->last_time1 = now;
Expand Down Expand Up @@ -1858,7 +1858,7 @@ void i915_update_gfx_val(struct drm_i915_private *dev_priv)

/* More magic constants... */
diff = diff * 1181;
div_u64(diff, diffms * 10);
diff = div_u64(diff, diffms * 10);
dev_priv->gfx_power = diff;
}

Expand Down

0 comments on commit d270ae3

Please sign in to comment.