diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-02-03 11:56:52 +0100 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2017-02-16 10:59:10 +0100 |
commit | 1769ae83c8cb32166d1e208f7cefbf334085bd58 (patch) | |
tree | 751264c514747430fc26398e23075dff3af3cfa0 /drivers/gpu | |
parent | drm/i915: Recreate internal objects with single page segments if dmar fails (diff) | |
download | linux-1769ae83c8cb32166d1e208f7cefbf334085bd58.tar.xz linux-1769ae83c8cb32166d1e208f7cefbf334085bd58.zip |
drm/i915: Reject set-tiling-ioctl with stride==0 and a tiling mode
In commit 957870f93412 ("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: 957870f93412 ("drm/i915: Split out i915_gem_object_set_tiling()")
Testcase: igt/gem_tiling_max_stride
Signed-off-by: Chris 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.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
(cherry picked from commit 52da22e7aba155be238faff4f6e97b2eb9de64f3)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_tiling.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index b1361cfd4c5c..974ac08df473 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c @@ -173,7 +173,7 @@ i915_tiling_ok(struct drm_i915_gem_object *obj, else tile_width = 512; - if (!IS_ALIGNED(stride, tile_width)) + if (!stride || !IS_ALIGNED(stride, tile_width)) return false; /* 965+ just needs multiples of tile width */ |