summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-07-28 12:55:20 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-08-11 12:00:15 +0100
commit936a09731bb6c52117da96182bd60afead10785a (patch)
tree8207e051faad18b70ed1d63aa2591fa6526bf88f
parent066c959c04ceb5b7414e47cd6030c511bc104537 (diff)
igt/gem_userptr_blits: Errors from gup are permanent
After triggering an error (such as trying to use userptr on a GTT mmaping), we store the EFAULT on the object permanently. So to test the error, we must sacrifice the object and recreate the userptr handle. We restrict the error to just one of the overlapping userptr handles to check the object independence. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100596 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tests/gem_userptr_blits.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c
index 7767c0ca..849054ad 100644
--- a/tests/gem_userptr_blits.c
+++ b/tests/gem_userptr_blits.c
@@ -681,12 +681,17 @@ static int test_map_fixed_invalidate(int fd, uint32_t flags)
gem_set_tiling(fd, mmap_gtt.handle, I915_TILING_NONE, 0);
*map = 0xdead;
- if (flags & MAP_FIXED_INVALIDATE_GET_PAGES)
+ if (flags & MAP_FIXED_INVALIDATE_GET_PAGES) {
igt_assert_eq(__gem_set_domain(fd, handle[0],
I915_GEM_DOMAIN_GTT,
I915_GEM_DOMAIN_GTT),
-EFAULT);
+ /* Errors are permanent, so we have to recreate */
+ gem_close(fd, handle[0]);
+ handle[0] = create_userptr(fd, 0, ptr + PAGE_SIZE/sizeof(*ptr));
+ }
+
gem_set_tiling(fd, mmap_gtt.handle, I915_TILING_Y, 512 * 4);
*(uint32_t*)map = 0xbeef;