]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.17/drm-i915-enable-low-power-render-writes-on-gen3-hardware.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.17 / drm-i915-enable-low-power-render-writes-on-gen3-hardware.patch
CommitLineData
7563275a
GKH
1From 944001201ca0196bcdb088129e5866a9f379d08c Mon Sep 17 00:00:00 2001
2From: Dave Airlie <airlied@redhat.com>
3Date: Tue, 20 Jul 2010 13:15:31 +1000
4Subject: drm/i915: enable low power render writes on GEN3 hardware.
5
6From: Dave Airlie <airlied@redhat.com>
7
8commit 944001201ca0196bcdb088129e5866a9f379d08c upstream.
9
10A lot of 945GMs have had stability issues for a long time, this manifested as X hangs, blitter engine hangs, and lots of crashes.
11
12one such report is at:
13https://bugs.freedesktop.org/show_bug.cgi?id=20560
14
15along with numerous distro bugzillas.
16
17This only took a week of digging and hair ripping to figure out.
18
19Tracked down and tested on a 945GM Lenovo T60,
20previously running
21x11perf -copypixwin500
22or
23x11perf -copywinpix500
24repeatedly would cause the GPU to wedge within 4 or 5 tries, with random busy bits set.
25
26After this patch no hangs were observed.
27
28Signed-off-by: Dave Airlie <airlied@redhat.com>
29Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
30
31---
32 drivers/gpu/drm/i915/i915_gem.c | 10 ++++++++++
33 1 file changed, 10 insertions(+)
34
35--- a/drivers/gpu/drm/i915/i915_gem.c
36+++ b/drivers/gpu/drm/i915/i915_gem.c
37@@ -4697,6 +4697,16 @@ i915_gem_load(struct drm_device *dev)
38 list_add(&dev_priv->mm.shrink_list, &shrink_list);
39 spin_unlock(&shrink_list_lock);
40
41+ /* On GEN3 we really need to make sure the ARB C3 LP bit is set */
42+ if (IS_I915G(dev) || IS_I915GM(dev) || IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) {
43+ u32 tmp = I915_READ(MI_ARB_STATE);
44+ if (!(tmp & MI_ARB_C3_LP_WRITE_ENABLE)) {
45+ /* arb state is a masked write, so set bit + bit in mask */
46+ tmp = MI_ARB_C3_LP_WRITE_ENABLE | (MI_ARB_C3_LP_WRITE_ENABLE << MI_ARB_MASK_SHIFT);
47+ I915_WRITE(MI_ARB_STATE, tmp);
48+ }
49+ }
50+
51 /* Old X drivers will take 0-2 for front, back, depth buffers */
52 dev_priv->fence_reg_start = 3;
53