]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.35.8/drm-i915-fix-gmch-power-reporting.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.35.8 / drm-i915-fix-gmch-power-reporting.patch
CommitLineData
7691b2d1
GKH
1From d270ae34eb77c58dea60e5b1e300a698d2ce39ac Mon Sep 17 00:00:00 2001
2From: Jesse Barnes <jbarnes@virtuousgeek.org>
3Date: Mon, 27 Sep 2010 10:35:44 -0700
4Subject: drm/i915: fix GMCH power reporting
5
6From: Jesse Barnes <jbarnes@virtuousgeek.org>
7
8commit d270ae34eb77c58dea60e5b1e300a698d2ce39ac upstream.
9
10The IPS driver needs to know the current power consumption of the GMCH
11in order to make decisions about when to increase or decrease the CPU
12and/or GPU power envelope. So fix up the divisions to save the results
13so the numbers are actually correct (contrary to some earlier comments
14and code, these functions do not modify the first argument and use it
15for the result).
16
17Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
18Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
19Signed-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