diff options
author | Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> | 2020-03-06 12:18:50 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-06 13:10:45 +0000 |
commit | 5df1c5f339a3626cf18f0704b11d0571aaf3b601 (patch) | |
tree | 713888f38cebe2518c3e43f8f135a48c0ab65ebf /tests/i915/gem_userptr_blits.c | |
parent | 6e3abe576849909fe15ffdad67b17eaf3f776f05 (diff) |
i915/gem_userptr_blits: Add active variant of mmap-offset-invalidate
Add a variant that also attaches a igt_spin_t to the userptr, waits for
it to start executing, call igt_spin_set_timeout and then do the munmap.
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/i915/gem_userptr_blits.c')
-rw-r--r-- | tests/i915/gem_userptr_blits.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c index 6420695f..beced298 100644 --- a/tests/i915/gem_userptr_blits.c +++ b/tests/i915/gem_userptr_blits.c @@ -806,7 +806,9 @@ static int test_map_fixed_invalidate(int fd, uint32_t flags, static void test_mmap_offset_invalidate(int fd, const struct mmap_offset *t, unsigned int flags) +#define MMOI_ACTIVE (1u << 0) { + igt_spin_t *spin = NULL; uint32_t handle; uint32_t *map; void *ptr; @@ -833,10 +835,19 @@ static void test_mmap_offset_invalidate(int fd, gem_set_domain(fd, handle, t->domain, t->domain); *map = 0; + if (flags & MMOI_ACTIVE) { + gem_quiescent_gpu(fd); + spin = igt_spin_new(fd, + .dependency = handle, + .flags = IGT_SPIN_NO_PREEMPTION); + igt_spin_set_timeout(spin, NSEC_PER_SEC); /* XXX borked */ + } + /* trigger the notifier */ munmap(ptr, PAGE_SIZE); /* cleanup */ + igt_spin_free(fd, spin); munmap(map, PAGE_SIZE); gem_close(fd, handle); } @@ -2233,6 +2244,13 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL) igt_dynamic_f("%s", t->name) test_mmap_offset_invalidate(fd, t, 0); + igt_describe("Invalidate pages of active userptr with mmap-offset on top"); + igt_subtest_with_dynamic("mmap-offset-invalidate-active") + for_each_mmap_offset_type(fd, t) + igt_dynamic_f("%s", t->name) + test_mmap_offset_invalidate(fd, t, + MMOI_ACTIVE); + igt_subtest("coherency-sync") test_coherency(fd, count); |