diff options
author | Grégoire Henry <Gregoire.Henry@pps.jussieu.fr> | 2009-06-23 09:41:02 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-06-23 12:22:11 -0400 |
commit | b5aa8a0fc132dd512c33e7c2621d075e3b77a65e (patch) | |
tree | ce36025b5f62c2eb6bef4e45d18c23a89edfd895 /drivers/gpu | |
parent | 56d21b07d44e0a33ab846f4f08e9e33bd87e5d4b (diff) |
drm/i915: initialize fence registers to zero when loading GEM
Unitialized fence register could leads to corrupted display. Problem
encountered on MacBooks (revision 1 and 2), directly booting from EFI
or through BIOS emulation.
(bug #21710 at freedestop.org)
Signed-off-by: Grégoire Henry <henry@pps.jussieu.fr>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 8660b2144b27..876b65cb7629 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -4227,6 +4227,7 @@ i915_gem_lastclose(struct drm_device *dev) | |||
4227 | void | 4227 | void |
4228 | i915_gem_load(struct drm_device *dev) | 4228 | i915_gem_load(struct drm_device *dev) |
4229 | { | 4229 | { |
4230 | int i; | ||
4230 | drm_i915_private_t *dev_priv = dev->dev_private; | 4231 | drm_i915_private_t *dev_priv = dev->dev_private; |
4231 | 4232 | ||
4232 | spin_lock_init(&dev_priv->mm.active_list_lock); | 4233 | spin_lock_init(&dev_priv->mm.active_list_lock); |
@@ -4246,6 +4247,18 @@ i915_gem_load(struct drm_device *dev) | |||
4246 | else | 4247 | else |
4247 | dev_priv->num_fence_regs = 8; | 4248 | dev_priv->num_fence_regs = 8; |
4248 | 4249 | ||
4250 | /* Initialize fence registers to zero */ | ||
4251 | if (IS_I965G(dev)) { | ||
4252 | for (i = 0; i < 16; i++) | ||
4253 | I915_WRITE64(FENCE_REG_965_0 + (i * 8), 0); | ||
4254 | } else { | ||
4255 | for (i = 0; i < 8; i++) | ||
4256 | I915_WRITE(FENCE_REG_830_0 + (i * 4), 0); | ||
4257 | if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) | ||
4258 | for (i = 0; i < 8; i++) | ||
4259 | I915_WRITE(FENCE_REG_945_8 + (i * 4), 0); | ||
4260 | } | ||
4261 | |||
4249 | i915_gem_detect_bit_6_swizzle(dev); | 4262 | i915_gem_detect_bit_6_swizzle(dev); |
4250 | } | 4263 | } |
4251 | 4264 | ||