Commit 52da22e7 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Reject set-tiling-ioctl with stride==0 and a tiling mode

In commit 957870f9 ("drm/i915: Split out i915_gem_object_set_tiling()"),
I swapped an alignment check for IS_ALIGNED and in the process removed
the less-than check. That check turns out to be important as it was the
only rejection for stride == 0. Tvrtko did spot it, but I was
overconfident in the IS_ALIGNED() conversion.

Fixes: 957870f9 ("drm/i915: Split out i915_gem_object_set_tiling()")
Testcase: igt/gem_tiling_max_stride
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170203105652.27819-1-chris@chris-wilson.co.ukReviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
parent 0aab2c72
...@@ -173,7 +173,7 @@ i915_tiling_ok(struct drm_i915_gem_object *obj, ...@@ -173,7 +173,7 @@ i915_tiling_ok(struct drm_i915_gem_object *obj,
else else
tile_width = 512; tile_width = 512;
if (!IS_ALIGNED(stride, tile_width)) if (!stride || !IS_ALIGNED(stride, tile_width))
return false; return false;
/* 965+ just needs multiples of tile width */ /* 965+ just needs multiples of tile width */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment