diff options
author | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2021-05-21 18:42:35 +0200 |
---|---|---|
committer | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2021-05-26 11:10:16 +0200 |
commit | f62d8953c0bc5ed68ea978662e62f9dbb46cf101 (patch) | |
tree | bccdb14032fbda38e8172a4cbc4e5a7e2d4c8e26 /benchmarks/gem_userptr_benchmark.c | |
parent | 50523f74bcd60d9bf0c4d2bb1486157a6b15e5b2 (diff) |
benchmarks/gem_userptr_benchmark: Remove tests with unsynchronized flag
As flag I915_USERPTR_UNSYNCHRONIZED is not supported by the i915 anymore
remove tests which tries to use it in the benchmark.
Remove benchmark from meson libdrm depending code as it is a little bit
confusing.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin.com>
Diffstat (limited to 'benchmarks/gem_userptr_benchmark.c')
-rw-r--r-- | benchmarks/gem_userptr_benchmark.c | 52 |
1 files changed, 12 insertions, 40 deletions
diff --git a/benchmarks/gem_userptr_benchmark.c b/benchmarks/gem_userptr_benchmark.c index d7a49520..3b589432 100644 --- a/benchmarks/gem_userptr_benchmark.c +++ b/benchmarks/gem_userptr_benchmark.c @@ -57,20 +57,10 @@ #define PAGE_SIZE 4096 #endif -static uint32_t userptr_flags = I915_USERPTR_UNSYNCHRONIZED; +static uint32_t userptr_flags = 0; #define BO_SIZE (65536) -static void gem_userptr_test_unsynchronized(void) -{ - userptr_flags = I915_USERPTR_UNSYNCHRONIZED; -} - -static void gem_userptr_test_synchronized(void) -{ - userptr_flags = 0; -} - static void **handle_ptr_map; static unsigned int num_handle_ptr_map; @@ -124,14 +114,10 @@ static int has_userptr(int fd) { uint32_t handle = 0; void *ptr; - uint32_t oldflags; int ret; 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; if (ret != 0) { free(ptr); return 0; @@ -464,32 +450,18 @@ static void test_userptr(int fd) test_multiple(fd, 100, 1); } -int main(int argc, char **argv) +igt_main { int fd = -1, ret; - igt_subtest_init(argc, argv); - - fd = drm_open_driver(DRIVER_INTEL); - igt_assert(fd >= 0); - - ret = has_userptr(fd); - igt_skip_on_f(ret == 0, "No userptr support - %s (%d)\n", - strerror(errno), ret); - + igt_fixture { + fd = drm_open_driver(DRIVER_INTEL); + igt_assert(fd >= 0); - gem_userptr_test_unsynchronized(); - - igt_subtest("userptr-unsync") - test_userptr(fd); - - igt_subtest("userptr-impact-unsync") - test_impact(fd, "unsync-"); - - igt_subtest("userptr-impact-unsync-overlap") - test_impact_overlap(fd, "unsync-"); - - gem_userptr_test_synchronized(); + ret = has_userptr(fd); + igt_skip_on_f(ret == 0, "No userptr support - %s (%d)\n", + strerror(errno), ret); + } igt_subtest("userptr-sync") test_userptr(fd); @@ -500,7 +472,7 @@ int main(int argc, char **argv) igt_subtest("userptr-impact-sync-overlap") test_impact_overlap(fd, "sync-"); - igt_exit(); - - return 0; + igt_fixture { + close(fd); + } } |