diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2020-10-12 13:31:42 +0200 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2021-01-28 17:17:00 +0100 |
commit | 0b6967520b15e73773eace7937ed8c17ba411bc0 (patch) | |
tree | 4a1fd440156ad04523f48c6508ff05e01c75a377 /tests/i915/gem_exec_parallel.c | |
parent | 4c751f53d748370ba062cc5958a839cbd570a822 (diff) |
tests: Do not use pread on userptr in gem_exec_parallel.
It's even silly to use pread, directly read from the pointer instead by
executing gem_wait first.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> #irc
Diffstat (limited to 'tests/i915/gem_exec_parallel.c')
-rw-r--r-- | tests/i915/gem_exec_parallel.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c index d3dd06a6..c9cf9d7a 100644 --- a/tests/i915/gem_exec_parallel.c +++ b/tests/i915/gem_exec_parallel.c @@ -151,7 +151,7 @@ static void *thread(void *data) return NULL; } -static void check_bo(int fd, uint32_t handle, int pass, struct thread *threads) +static void check_bo(int fd, uint32_t *data, uint32_t handle, int pass, struct thread *threads) { uint32_t x = hash32(handle * pass) % 1024; uint32_t result; @@ -161,8 +161,14 @@ static void check_bo(int fd, uint32_t handle, int pass, struct thread *threads) igt_debug("Verifying result (pass=%d, handle=%d, thread %d)\n", pass, handle, x); - gem_read(fd, handle, x * sizeof(result), &result, sizeof(result)); - igt_assert_eq_u32(result, x); + + if (data) { + gem_wait(fd, handle, NULL); + igt_assert_eq_u32(data[x], x); + } else { + gem_read(fd, handle, x * sizeof(result), &result, sizeof(result)); + igt_assert_eq_u32(result, x); + } } static uint32_t handle_create(int fd, unsigned int flags, void **data) @@ -178,6 +184,7 @@ static uint32_t handle_create(int fd, unsigned int flags, void **data) return handle; } + *data = NULL; return gem_create(fd, 4096); } @@ -258,7 +265,7 @@ static void all(int fd, struct intel_execution_engine2 *engine, unsigned flags) pthread_join(threads[i].thread, NULL); for (i = 0; i < NUMOBJ; i++) { - check_bo(fd, handle[i], i, threads); + check_bo(fd, arg[i], handle[i], i, threads); handle_close(fd, flags, handle[i], arg[i]); } |