]>
Commit | Line | Data |
---|---|---|
7691b2d1 GKH |
1 | From d270ae34eb77c58dea60e5b1e300a698d2ce39ac Mon Sep 17 00:00:00 2001 |
2 | From: Jesse Barnes <jbarnes@virtuousgeek.org> | |
3 | Date: Mon, 27 Sep 2010 10:35:44 -0700 | |
4 | Subject: drm/i915: fix GMCH power reporting | |
5 | ||
6 | From: Jesse Barnes <jbarnes@virtuousgeek.org> | |
7 | ||
8 | commit d270ae34eb77c58dea60e5b1e300a698d2ce39ac upstream. | |
9 | ||
10 | The IPS driver needs to know the current power consumption of the GMCH | |
11 | in order to make decisions about when to increase or decrease the CPU | |
12 | and/or GPU power envelope. So fix up the divisions to save the results | |
13 | so the numbers are actually correct (contrary to some earlier comments | |
14 | and code, these functions do not modify the first argument and use it | |
15 | for the result). | |
16 | ||
17 | Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> | |
18 | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
20 | ||
21 | --- | |
22 | drivers/gpu/drm/i915/i915_dma.c | 6 +++--- | |
23 | 1 file changed, 3 insertions(+), 3 deletions(-) | |
24 | ||
25 | --- a/drivers/gpu/drm/i915/i915_dma.c | |
26 | +++ b/drivers/gpu/drm/i915/i915_dma.c | |
27 | @@ -1778,9 +1778,9 @@ unsigned long i915_chipset_val(struct dr | |
28 | } | |
29 | } | |
30 | ||
31 | - div_u64(diff, diff1); | |
32 | + diff = div_u64(diff, diff1); | |
33 | ret = ((m * diff) + c); | |
34 | - div_u64(ret, 10); | |
35 | + ret = div_u64(ret, 10); | |
36 | ||
37 | dev_priv->last_count1 = total_count; | |
38 | dev_priv->last_time1 = now; | |
39 | @@ -1849,7 +1849,7 @@ void i915_update_gfx_val(struct drm_i915 | |
40 | ||
41 | /* More magic constants... */ | |
42 | diff = diff * 1181; | |
43 | - div_u64(diff, diffms * 10); | |
44 | + diff = div_u64(diff, diffms * 10); | |
45 | dev_priv->gfx_power = diff; | |
46 | } | |
47 |