Skip to content

Commit

Permalink
drm/i915: Correct discard i915_vma_compare assertion
Browse files Browse the repository at this point in the history
As a last minute addition, I added an assertion to make sure that the
new i915_vma view would be equal to the discard. However, the positive
encouragement from CI only goes to show that we rarely take this path,
and it wasn't until the post-merge run did we hit the assert -- because
it compared the wrong view. Fixup the copy'n'paste error and compare
against both the old view and the expected new view.

Fixes: 9bdcaa5 ("drm/i915: Discard a misplaced GGTT vma")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200605184844.24644-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Jun 5, 2020
1 parent 9bdcaa5 commit 84d24cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,8 @@ discard_ggtt_vma(struct i915_vma *vma, const struct i915_ggtt_view *view)

rb_erase(&vma->obj_node, &obj->vma.tree);
vma->ggtt_view = discard;
GEM_BUG_ON(i915_vma_compare(vma, vma->vm, view));
GEM_BUG_ON(i915_vma_compare(vma, vma->vm, &discard));
GEM_BUG_ON(i915_vma_compare(vma, vma->vm, view) == 0);

rb = NULL;
p = &obj->vma.tree.rb_node;
Expand Down

0 comments on commit 84d24cb

Please sign in to comment.