summaryrefslogtreecommitdiff
path: root/tests/i915/gem_pread.c
diff options
context:
space:
mode:
authorMatthew Auld <matthew.auld@intel.com>2020-06-03 11:07:51 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-06-03 12:29:10 +0100
commita9b6c4c74bfddf7d3d2da3be08804fe315945cea (patch)
tree7cbe2fe04d2a329d5e74f5cf12c17f85aa120207 /tests/i915/gem_pread.c
parentc7b786f02ed942d9cdc1570c4ffbd42e5e90ab3e (diff)
i915: purge i915_gem_create_v2
The gem_create_v2 uapi was never merged, which would have been a nice addition to allow userspace to utilise stolen memory. Since it can only get in the way at this point, let's just remove it. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/i915/gem_pread.c')
-rw-r--r--tests/i915/gem_pread.c93
1 files changed, 0 insertions, 93 deletions
diff --git a/tests/i915/gem_pread.c b/tests/i915/gem_pread.c
index 5b926ab0..6d12b8e9 100644
--- a/tests/i915/gem_pread.c
+++ b/tests/i915/gem_pread.c
@@ -73,7 +73,6 @@ static void pread_self(int i915)
}
#define OBJECT_SIZE 16384
-#define LARGE_OBJECT_SIZE 1024 * 1024
#define KGRN "\x1B[32m"
#define KRED "\x1B[31m"
#define KNRM "\x1B[0m"
@@ -110,10 +109,7 @@ static const char *bytes_per_sec(char *buf, double v)
return buf;
}
-
uint32_t *src, dst;
-uint32_t *dst_user, src_stolen, large_stolen;
-uint32_t *stolen_pf_user, *stolen_nopf_user;
int fd, count;
int object_size = 0;
@@ -156,8 +152,6 @@ igt_main_args("s:", NULL, help_str, opt_handler, NULL)
dst = gem_create(fd, object_size);
src = malloc(object_size);
- src_stolen = gem_create_stolen(fd, object_size);
- dst_user = malloc(object_size);
}
igt_subtest("bench") {
@@ -197,96 +191,9 @@ igt_main_args("s:", NULL, help_str, opt_handler, NULL)
}
}
- igt_subtest("stolen-normal") {
- gem_require_stolen_support(fd);
- for (count = 1; count <= 1<<17; count <<= 1) {
- struct timeval start, end;
-
- gettimeofday(&start, NULL);
- do_gem_read(fd, src_stolen, dst_user, object_size, count);
- gettimeofday(&end, NULL);
- usecs = elapsed(&start, &end, count);
- bps = bytes_per_sec(buf, object_size/usecs*1e6);
- igt_info("Time to pread %d bytes x %6d: %7.3fµs, %s\n",
- object_size, count, usecs, bps);
- fflush(stdout);
- }
- }
- for (c = cache; c->level != -1; c++) {
- igt_subtest_f("stolen-%s", c->name) {
- gem_require_stolen_support(fd);
- gem_set_caching(fd, src_stolen, c->level);
-
- for (count = 1; count <= 1<<17; count <<= 1) {
- struct timeval start, end;
-
- gettimeofday(&start, NULL);
- do_gem_read(fd, src_stolen, dst_user,
- object_size, count);
- gettimeofday(&end, NULL);
- usecs = elapsed(&start, &end, count);
- bps = bytes_per_sec(buf, object_size/usecs*1e6);
- igt_info("Time to stolen-%s pread %d bytes x %6d: %7.3fµs, %s\n",
- c->name, object_size, count, usecs, bps);
- fflush(stdout);
- }
- }
- }
-
- /* List the time taken in pread operation for stolen objects, with
- * and without the overhead of page fault handling on accessing the
- * user space buffer
- */
- igt_subtest("pagefault-pread") {
- gem_require_stolen_support(fd);
- large_stolen = gem_create_stolen(fd, LARGE_OBJECT_SIZE);
- stolen_nopf_user = (uint32_t *) mmap(NULL, LARGE_OBJECT_SIZE,
- PROT_WRITE,
- MAP_ANONYMOUS|MAP_PRIVATE,
- -1, 0);
- igt_assert(stolen_nopf_user);
-
- for (count = 1; count <= 10; count ++) {
- struct timeval start, end;
- double t_elapsed = 0;
-
- gettimeofday(&start, NULL);
- do_gem_read(fd, large_stolen, stolen_nopf_user,
- LARGE_OBJECT_SIZE, 1);
- gettimeofday(&end, NULL);
- t_elapsed = elapsed(&start, &end, count);
- bps = bytes_per_sec(buf, object_size/t_elapsed*1e6);
- igt_info("Pagefault-N - Time to pread %d bytes: %7.3fµs, %s\n",
- LARGE_OBJECT_SIZE, t_elapsed, bps);
-
- stolen_pf_user = (uint32_t *) mmap(NULL, LARGE_OBJECT_SIZE,
- PROT_WRITE,
- MAP_ANONYMOUS|MAP_PRIVATE,
- -1, 0);
- igt_assert(stolen_pf_user);
-
- gettimeofday(&start, NULL);
- do_gem_read(fd, large_stolen, stolen_pf_user,
- LARGE_OBJECT_SIZE, 1);
- gettimeofday(&end, NULL);
- usecs = elapsed(&start, &end, count);
- bps = bytes_per_sec(buf, object_size/usecs*1e6);
- igt_info("Pagefault-Y - Time to pread %d bytes: %7.3fµs, %s%s%s\n",
- LARGE_OBJECT_SIZE, usecs,
- t_elapsed < usecs ? KGRN : KRED, bps, KNRM);
- fflush(stdout);
- munmap(stolen_pf_user, LARGE_OBJECT_SIZE);
- }
- munmap(stolen_nopf_user, LARGE_OBJECT_SIZE);
- gem_close(fd, large_stolen);
- }
-
-
igt_fixture {
free(src);
gem_close(fd, dst);
- free(dst_user);
- gem_close(fd, src_stolen);
close(fd);
}