summaryrefslogtreecommitdiff
path: root/tests/i915/gem_userptr_blits.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-10-14 09:32:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-10-15 19:34:19 +0100
commit520f88d7817ebb7464907252a32e8e747429102b (patch)
tree081f49b62223bb38371b9ac6707eb231afe440e8 /tests/i915/gem_userptr_blits.c
parented93d507b13c5b4773427d162c1c25112f51b050 (diff)
i915/gem_userptr_blits: Tighten has_userptr()
We use has_userptr() to determine if the different flags are supported, so it helps not to override the flags inside the test. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests/i915/gem_userptr_blits.c')
-rw-r--r--tests/i915/gem_userptr_blits.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index 3ae02201..b752a0f5 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -71,8 +71,7 @@
#define PAGE_SIZE 4096
#endif
-static uint32_t userptr_flags = I915_USERPTR_UNSYNCHRONIZED;
-
+static uint32_t userptr_flags;
static bool *can_mmap;
#define WIDTH 512
@@ -504,14 +503,11 @@ static int has_userptr(int fd)
{
uint32_t handle = 0;
void *ptr;
- uint32_t oldflags;
int ret;
igt_assert(posix_memalign(&ptr, PAGE_SIZE, PAGE_SIZE) == 0);
- oldflags = userptr_flags;
- gem_userptr_test_unsynchronized();
ret = __gem_userptr(fd, ptr, PAGE_SIZE, 0, userptr_flags, &handle);
- userptr_flags = oldflags;
+ errno = 0;
if (ret != 0) {
free(ptr);
return 0;
@@ -2112,6 +2108,10 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
igt_subtest_group {
igt_fixture {
+ /* Either mode will do for parameter checking */
+ gem_userptr_test_synchronized();
+ if (!has_userptr(fd))
+ gem_userptr_test_unsynchronized();
igt_require(has_userptr(fd));
}