drm/i915: Avoid computing tile_row_size() for untiled objects
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 26 Jul 2018 10:47:59 +0000 (11:47 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 26 Jul 2018 11:30:24 +0000 (12:30 +0100)
i915_gem_tile_height() asserts that the object is tiled, but inside the
error printer for the selftest we computed the row size regardless of
tiling, tripping over the assert.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180726104759.8684-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/selftests/i915_gem_object.c

index c69cbd5..d9eca1b 100644 (file)
@@ -282,7 +282,7 @@ static int check_partial_mapping(struct drm_i915_gem_object *obj,
                               view.partial.offset,
                               view.partial.size,
                               vma->size >> PAGE_SHIFT,
-                              tile_row_pages(obj),
+                              tile->tiling ? tile_row_pages(obj) : 0,
                               vma->fence ? vma->fence->id : -1, tile->tiling, tile->stride,
                               offset >> PAGE_SHIFT,
                               (unsigned int)offset_in_page(offset),