aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-05-26 20:44:56 -0400
committerEric Anholt <eric@anholt.net>2009-05-26 22:11:31 -0400
commite76a16deb8785317a23cca7204331af053e0fb4e (patch)
tree5a5c2197914c84d21ce4e31942ecfcc9d083b602 /drivers/gpu/drm/i915/i915_gem.c
parentcd86a536c81e9300d984327517548ca0652eebf9 (diff)
drm/i915: Fix tiling pitch handling on 8xx.
The pitch field is an exponent on pre-965, so we were rejecting buffers on 8xx that we shouldn't have. 915 got lucky in that the largest legal value happened to match (8KB / 512 = 0x10), but 8xx has a smaller tile width. Additionally, we programmed that bad value into the register on 8xx, so the only pitch that would work correctly was 4096 (512-1023 pixels), while others would probably give bad rendering or hangs. Signed-off-by: Eric Anholt <eric@anholt.net> fd.o bug #20473.
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 717b6a854bcd..e4408daf8cef 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2128,8 +2128,10 @@ static void i830_write_fence_reg(struct drm_i915_fence_reg *reg)
2128 return; 2128 return;
2129 } 2129 }
2130 2130
2131 pitch_val = (obj_priv->stride / 128) - 1; 2131 pitch_val = obj_priv->stride / 128;
2132 WARN_ON(pitch_val & ~0x0000000f); 2132 pitch_val = ffs(pitch_val) - 1;
2133 WARN_ON(pitch_val > I830_FENCE_MAX_PITCH_VAL);
2134
2133 val = obj_priv->gtt_offset; 2135 val = obj_priv->gtt_offset;
2134 if (obj_priv->tiling_mode == I915_TILING_Y) 2136 if (obj_priv->tiling_mode == I915_TILING_Y)
2135 val |= 1 << I830_FENCE_TILING_Y_SHIFT; 2137 val |= 1 << I830_FENCE_TILING_Y_SHIFT;