[igt-dev] [PATCH i-g-t] benchmarks/gem_userptr_benchmark: Remove tests with unsynchronized flag
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Fri May 21 16:46:37 UTC 2021
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 at intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Petri Latvala <petri.latvala at intel.com>
---
benchmarks/gem_userptr_benchmark.c | 54 +++++++-----------------------
benchmarks/meson.build | 2 +-
2 files changed, 14 insertions(+), 42 deletions(-)
diff --git a/benchmarks/gem_userptr_benchmark.c b/benchmarks/gem_userptr_benchmark.c
index d7a495209..a85997b86 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;
+ ret = __gem_userptr(fd, ptr, PAGE_SIZE, 0, 0, &handle);
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);
+ }
}
diff --git a/benchmarks/meson.build b/benchmarks/meson.build
index bede51dce..98a08e25c 100644
--- a/benchmarks/meson.build
+++ b/benchmarks/meson.build
@@ -11,6 +11,7 @@ benchmark_progs = [
'gem_prw',
'gem_set_domain',
'gem_syslatency',
+ 'gem_userptr_benchmark',
'gem_wsim',
'kms_vblank',
'prime_lookup',
@@ -23,7 +24,6 @@ if libdrm_intel.found()
'intel_upload_blit_large_gtt',
'intel_upload_blit_large_map',
'intel_upload_blit_small',
- 'gem_userptr_benchmark',
]
endif
--
2.26.0
More information about the igt-dev
mailing list