Skip to content

Commit

Permalink
drm/i915: Ensure i915_vma tests do not get -ENOSPC with the locking c…
Browse files Browse the repository at this point in the history
…hanges.

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
  • Loading branch information
Maarten Lankhorst committed Dec 20, 2021
1 parent fd06ccf commit 9606ca2
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion drivers/gpu/drm/i915/selftests/i915_vma.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,11 @@ static int igt_vma_rotate_remap(void *arg)
}

i915_vma_unpin(vma);

err = i915_vma_unbind(vma);
if (err) {
pr_err("Unbinding returned %i\n", err);
goto out_object;
}
cond_resched();
}
}
Expand Down Expand Up @@ -848,6 +852,11 @@ static int igt_vma_partial(void *arg)

i915_vma_unpin(vma);
nvma++;
err = i915_vma_unbind(vma);
if (err) {
pr_err("Unbinding returned %i\n", err);
goto out_object;
}

cond_resched();
}
Expand Down Expand Up @@ -882,6 +891,12 @@ static int igt_vma_partial(void *arg)

i915_vma_unpin(vma);

err = i915_vma_unbind(vma);
if (err) {
pr_err("Unbinding returned %i\n", err);
goto out_object;
}

count = 0;
list_for_each_entry(vma, &obj->vma.list, obj_link)
count++;
Expand Down

0 comments on commit 9606ca2

Please sign in to comment.