Skip to content

Commit c2dc6cc

Browse files
committed
drm/i915: Add a test that we terminate the trimmed sgtable as expected
In commit 0c40ce1 ("drm/i915: Trim the object sg table"), we expect to copy exactly orig_st->nents across and allocate the table thusly. The copy loop should therefore end with the new_sg being NULL. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20161219124346.550-2-chris@chris-wilson.co.uk Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
1 parent d766ef5 commit c2dc6cc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,6 +2333,7 @@ static void i915_sg_trim(struct sg_table *orig_st)
23332333
/* called before being DMA mapped, no need to copy sg->dma_* */
23342334
new_sg = sg_next(new_sg);
23352335
}
2336+
GEM_BUG_ON(new_sg); /* Should walk exactly nents and hit the end */
23362337

23372338
sg_free_table(orig_st);
23382339

0 commit comments

Comments
 (0)