aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-04-09 13:09:13 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-04-18 03:43:19 -0400
commitfe48d8de34eeaefb2c71dab68ea7c236f06e5877 (patch)
tree942de3dfb68e6301581ed0d0ae66e7ec3ed4056a
parenta6f429a5a2f6ae0e1e8df2493884f9a881486d81 (diff)
drm/i915: Reject fence stride=0 on gen4+
Our checks for an invalid fence stride forgot to guard against zero stride on gen4+. Fix it. v2: Avoid duplicated code (danvet) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_gem_tiling.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index c807eb93755b..b56185f4babb 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -235,6 +235,9 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)
235 } 235 }
236 } 236 }
237 237
238 if (stride < tile_width)
239 return false;
240
238 /* 965+ just needs multiples of tile width */ 241 /* 965+ just needs multiples of tile width */
239 if (INTEL_INFO(dev)->gen >= 4) { 242 if (INTEL_INFO(dev)->gen >= 4) {
240 if (stride & (tile_width - 1)) 243 if (stride & (tile_width - 1))
@@ -243,9 +246,6 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)
243 } 246 }
244 247
245 /* Pre-965 needs power of two tile widths */ 248 /* Pre-965 needs power of two tile widths */
246 if (stride < tile_width)
247 return false;
248
249 if (stride & (stride - 1)) 249 if (stride & (stride - 1))
250 return false; 250 return false;
251 251