/[linux-patches]/genpatches-2.6/trunk/2.6.30/2700_init-fence-regs-to-zero-on-GEM-load.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.30/2700_init-fence-regs-to-zero-on-GEM-load.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1592 - (show annotations) (download)
Sat Jul 25 01:04:29 2009 UTC (9 years, 4 months ago) by mpagano
File size: 1635 byte(s)
MacBook display corruption fix
1 From: Grégoire Henry <Gregoire.Henry@pps.jussieu.fr>
2 Date: Tue, 23 Jun 2009 13:41:02 +0000 (+0200)
3 Subject: drm/i915: initialize fence registers to zero when loading GEM
4 X-Git-Tag: v2.6.31-rc2~85^2~1^2
5 X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=b5aa8a0fc132dd512c33e7c2621d075e3b77a65e
6
7 drm/i915: initialize fence registers to zero when loading GEM
8
9 Unitialized fence register could leads to corrupted display. Problem
10 encountered on MacBooks (revision 1 and 2), directly booting from EFI
11 or through BIOS emulation.
12
13 (bug #21710 at freedestop.org)
14
15 Signed-off-by: Grégoire Henry <henry@pps.jussieu.fr>
16 Signed-off-by: Eric Anholt <eric@anholt.net>
17 ---
18
19 diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
20 index 8660b21..876b65c 100644
21 --- a/drivers/gpu/drm/i915/i915_gem.c
22 +++ b/drivers/gpu/drm/i915/i915_gem.c
23 @@ -4227,6 +4227,7 @@ i915_gem_lastclose(struct drm_device *dev)
24 void
25 i915_gem_load(struct drm_device *dev)
26 {
27 + int i;
28 drm_i915_private_t *dev_priv = dev->dev_private;
29
30 spin_lock_init(&dev_priv->mm.active_list_lock);
31 @@ -4246,6 +4247,18 @@ i915_gem_load(struct drm_device *dev)
32 else
33 dev_priv->num_fence_regs = 8;
34
35 + /* Initialize fence registers to zero */
36 + if (IS_I965G(dev)) {
37 + for (i = 0; i < 16; i++)
38 + I915_WRITE64(FENCE_REG_965_0 + (i * 8), 0);
39 + } else {
40 + for (i = 0; i < 8; i++)
41 + I915_WRITE(FENCE_REG_830_0 + (i * 4), 0);
42 + if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev))
43 + for (i = 0; i < 8; i++)
44 + I915_WRITE(FENCE_REG_945_8 + (i * 4), 0);
45 + }
46 +
47 i915_gem_detect_bit_6_swizzle(dev);
48 }
49
50

  ViewVC Help
Powered by ViewVC 1.1.20