diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-16 19:32:17 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-21 06:19:45 -0400 |
commit | a6c45cf013a57e32ddae43dd4ac911eb4a3919fd (patch) | |
tree | 21ce3ea9dcbeb815c92eb0a17377e5061b33151c /drivers/gpu/drm/i915/i915_gem_tiling.c | |
parent | 219adae138513bae20b256f1946b9cb3b75ca05c (diff) |
drm/i915: INTEL_INFO->gen supercedes i8xx, i9xx, i965g
Avoid confusion between i965g meaning broadwater and the gen4+ chipset
families.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_tiling.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_tiling.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index caef7ff2aa39..b09b157f6ada 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c | |||
@@ -98,7 +98,7 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev) | |||
98 | */ | 98 | */ |
99 | swizzle_x = I915_BIT_6_SWIZZLE_9_10; | 99 | swizzle_x = I915_BIT_6_SWIZZLE_9_10; |
100 | swizzle_y = I915_BIT_6_SWIZZLE_9; | 100 | swizzle_y = I915_BIT_6_SWIZZLE_9; |
101 | } else if (!IS_I9XX(dev)) { | 101 | } else if (IS_GEN2(dev)) { |
102 | /* As far as we know, the 865 doesn't have these bit 6 | 102 | /* As far as we know, the 865 doesn't have these bit 6 |
103 | * swizzling issues. | 103 | * swizzling issues. |
104 | */ | 104 | */ |
@@ -190,19 +190,19 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) | |||
190 | if (tiling_mode == I915_TILING_NONE) | 190 | if (tiling_mode == I915_TILING_NONE) |
191 | return true; | 191 | return true; |
192 | 192 | ||
193 | if (!IS_I9XX(dev) || | 193 | if (IS_GEN2(dev) || |
194 | (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev))) | 194 | (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev))) |
195 | tile_width = 128; | 195 | tile_width = 128; |
196 | else | 196 | else |
197 | tile_width = 512; | 197 | tile_width = 512; |
198 | 198 | ||
199 | /* check maximum stride & object size */ | 199 | /* check maximum stride & object size */ |
200 | if (IS_I965G(dev)) { | 200 | if (INTEL_INFO(dev)->gen >= 4) { |
201 | /* i965 stores the end address of the gtt mapping in the fence | 201 | /* i965 stores the end address of the gtt mapping in the fence |
202 | * reg, so dont bother to check the size */ | 202 | * reg, so dont bother to check the size */ |
203 | if (stride / 128 > I965_FENCE_MAX_PITCH_VAL) | 203 | if (stride / 128 > I965_FENCE_MAX_PITCH_VAL) |
204 | return false; | 204 | return false; |
205 | } else if (IS_GEN3(dev) || IS_GEN2(dev)) { | 205 | } else { |
206 | if (stride > 8192) | 206 | if (stride > 8192) |
207 | return false; | 207 | return false; |
208 | 208 | ||
@@ -216,7 +216,7 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) | |||
216 | } | 216 | } |
217 | 217 | ||
218 | /* 965+ just needs multiples of tile width */ | 218 | /* 965+ just needs multiples of tile width */ |
219 | if (IS_I965G(dev)) { | 219 | if (INTEL_INFO(dev)->gen >= 4) { |
220 | if (stride & (tile_width - 1)) | 220 | if (stride & (tile_width - 1)) |
221 | return false; | 221 | return false; |
222 | return true; | 222 | return true; |
@@ -244,16 +244,18 @@ i915_gem_object_fence_offset_ok(struct drm_gem_object *obj, int tiling_mode) | |||
244 | if (tiling_mode == I915_TILING_NONE) | 244 | if (tiling_mode == I915_TILING_NONE) |
245 | return true; | 245 | return true; |
246 | 246 | ||
247 | if (!IS_I965G(dev)) { | 247 | if (INTEL_INFO(dev)->gen >= 4) |
248 | if (obj_priv->gtt_offset & (obj->size - 1)) | 248 | return true; |
249 | |||
250 | if (obj_priv->gtt_offset & (obj->size - 1)) | ||
251 | return false; | ||
252 | |||
253 | if (IS_GEN3(dev)) { | ||
254 | if (obj_priv->gtt_offset & ~I915_FENCE_START_MASK) | ||
255 | return false; | ||
256 | } else { | ||
257 | if (obj_priv->gtt_offset & ~I830_FENCE_START_MASK) | ||
249 | return false; | 258 | return false; |
250 | if (IS_I9XX(dev)) { | ||
251 | if (obj_priv->gtt_offset & ~I915_FENCE_START_MASK) | ||
252 | return false; | ||
253 | } else { | ||
254 | if (obj_priv->gtt_offset & ~I830_FENCE_START_MASK) | ||
255 | return false; | ||
256 | } | ||
257 | } | 259 | } |
258 | 260 | ||
259 | return true; | 261 | return true; |