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>
This commit is contained in:
parent
a6f429a5a2
commit
fe48d8de34
1 changed files with 3 additions and 3 deletions
|
@ -235,6 +235,9 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stride < tile_width)
|
||||||
|
return false;
|
||||||
|
|
||||||
/* 965+ just needs multiples of tile width */
|
/* 965+ just needs multiples of tile width */
|
||||||
if (INTEL_INFO(dev)->gen >= 4) {
|
if (INTEL_INFO(dev)->gen >= 4) {
|
||||||
if (stride & (tile_width - 1))
|
if (stride & (tile_width - 1))
|
||||||
|
@ -243,9 +246,6 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pre-965 needs power of two tile widths */
|
/* Pre-965 needs power of two tile widths */
|
||||||
if (stride < tile_width)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (stride & (stride - 1))
|
if (stride & (stride - 1))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue