diff mbox series

drm/i915: Avoid computing tile_row_size() for untiled objects

Message ID 20180726104759.8684-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series drm/i915: Avoid computing tile_row_size() for untiled objects | expand

Commit Message

Chris Wilson July 26, 2018, 10:47 a.m. UTC
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>
---
 drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthew Auld July 26, 2018, 11:22 a.m. UTC | #1
On 26 July 2018 at 11:47, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> 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>
Chris Wilson July 26, 2018, 11:31 a.m. UTC | #2
Quoting Matthew Auld (2018-07-26 12:22:52)
> On 26 July 2018 at 11:47, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > 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>

Ta, onto the real problem that the GTT write didn't land. :|
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_object.c b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
index c69cbd5aed52..d9eca1b02aee 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
@@ -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),