Skip to content

Commit 9606ca2

Browse files
committed
drm/i915: Ensure i915_vma tests do not get -ENOSPC with the locking changes.
Now that we require locking to evict, multiple vmas from the same object might not be evicted. This is expected and required, because execbuf will move to short-term pinning by using the lock only. This will cause these tests to fail, because they create a ton of vma's for the same object. Unbind manually to prevent spurious -ENOSPC in those mock tests. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-8-maarten.lankhorst@linux.intel.com
1 parent fd06ccf commit 9606ca2

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

drivers/gpu/drm/i915/selftests/i915_vma.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,11 @@ static int igt_vma_rotate_remap(void *arg)
691691
}
692692

693693
i915_vma_unpin(vma);
694-
694+
err = i915_vma_unbind(vma);
695+
if (err) {
696+
pr_err("Unbinding returned %i\n", err);
697+
goto out_object;
698+
}
695699
cond_resched();
696700
}
697701
}
@@ -848,6 +852,11 @@ static int igt_vma_partial(void *arg)
848852

849853
i915_vma_unpin(vma);
850854
nvma++;
855+
err = i915_vma_unbind(vma);
856+
if (err) {
857+
pr_err("Unbinding returned %i\n", err);
858+
goto out_object;
859+
}
851860

852861
cond_resched();
853862
}
@@ -882,6 +891,12 @@ static int igt_vma_partial(void *arg)
882891

883892
i915_vma_unpin(vma);
884893

894+
err = i915_vma_unbind(vma);
895+
if (err) {
896+
pr_err("Unbinding returned %i\n", err);
897+
goto out_object;
898+
}
899+
885900
count = 0;
886901
list_for_each_entry(vma, &obj->vma.list, obj_link)
887902
count++;

0 commit comments

Comments
 (0)