[igt-dev] [PATCH i-g-t 6/6] i915/gem_softpin: Active rebinds
Chris Wilson
chris at chris-wilson.co.uk
Fri Jul 10 09:32:34 UTC 2020
Verify that we do not block userspace [controlling fence progress] if it
requires vma recycling.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
tests/i915/gem_softpin.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
index 202abdd88..55ceb1bf2 100644
--- a/tests/i915/gem_softpin.c
+++ b/tests/i915/gem_softpin.c
@@ -263,6 +263,33 @@ static void test_reverse(int i915)
gem_close(i915, handle);
}
+static void test_active(int i915)
+{
+ const uint32_t bbe = MI_BATCH_BUFFER_END;
+ struct drm_i915_gem_exec_object2 obj = {
+ .handle = gem_create(i915, 4096),
+ };
+ struct drm_i915_gem_execbuffer2 execbuf = {
+ .buffers_ptr = to_user_pointer(&obj),
+ .buffer_count = 1,
+ };
+ igt_spin_t *spin;
+
+ gem_write(i915, obj.handle, 0, &bbe, sizeof(bbe));
+
+ /* Make a busy spot */
+ spin = igt_spin_new(i915);
+
+ /* Reuse it for ourselves */
+ obj.offset = spin->obj[IGT_SPIN_BATCH].offset;
+ obj.flags = EXEC_OBJECT_PINNED;
+ gem_execbuf(i915, &execbuf);
+ igt_assert_eq_u64(obj.offset, spin->obj[IGT_SPIN_BATCH].offset);
+
+ gem_close(i915, obj.handle);
+ igt_spin_free(i915, spin);
+}
+
static uint64_t busy_batch(int fd)
{
const int gen = intel_gen(intel_get_drm_devid(fd));
@@ -565,6 +592,8 @@ igt_main
test_overlap(fd);
igt_subtest("reverse")
test_reverse(fd);
+ igt_subtest("active")
+ test_active(fd);
igt_subtest("noreloc")
test_noreloc(fd, NOSLEEP, 0);
--
2.27.0
More information about the igt-dev
mailing list