diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-02-25 21:11:19 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-02-25 21:54:36 +0300 |
commit | b3bb82885feb74feadc101a700e64ed7ede84b04 (patch) | |
tree | 1664371aefc07733112bd4b36fe69f899c92e5a6 /drivers/gpu/drm/i915/selftests | |
parent | 91e32157de148ce37422d8110f6f8a84d05da1ec (diff) | |
download | linux-b3bb82885feb74feadc101a700e64ed7ede84b04.tar.xz |
drm/i915: Assert all sg are initialised in fake_dma_object for selftests
Double check that we allocated the right amount of scatterlist elements
for our obj->size.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170225181122.4788-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/selftests')
-rw-r--r-- | drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c index 6bac267914df..0f3fa34377c6 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -62,12 +62,14 @@ fake_get_pages(struct drm_i915_gem_object *obj) for (sg = pages->sgl; sg; sg = sg_next(sg)) { unsigned long len = min_t(typeof(rem), rem, BIT(31)); + GEM_BUG_ON(!len); sg_set_page(sg, pfn_to_page(PFN_BIAS), len, 0); sg_dma_address(sg) = page_to_phys(sg_page(sg)); sg_dma_len(sg) = len; rem -= len; } + GEM_BUG_ON(rem); obj->mm.madv = I915_MADV_DONTNEED; return pages; |