summaryrefslogtreecommitdiff
path: root/tests/i915/gen3_render_tiledy_blits.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-04-26 15:02:07 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-04-26 20:45:23 +0100
commit9386624c2da8357c112015858177398c7cc6cd06 (patch)
treee74f54210d7739723626eac5412b0cc823e97319 /tests/i915/gen3_render_tiledy_blits.c
parent71fed15724898a8f914666093352a964b70a62fc (diff)
i915: Reduce gen3 specific runtimes
gen3 mixes all the render/blitter copies to check inter operations. Trim these tests to only just force the aperture thrashing. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1367 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests/i915/gen3_render_tiledy_blits.c')
-rw-r--r--tests/i915/gen3_render_tiledy_blits.c64
1 files changed, 6 insertions, 58 deletions
diff --git a/tests/i915/gen3_render_tiledy_blits.c b/tests/i915/gen3_render_tiledy_blits.c
index 94127b62..f0e6535f 100644
--- a/tests/i915/gen3_render_tiledy_blits.c
+++ b/tests/i915/gen3_render_tiledy_blits.c
@@ -323,36 +323,17 @@ check_bo(int fd, uint32_t handle, uint32_t val)
munmap(v, WIDTH*HEIGHT*4);
}
-int count;
-
-static int opt_handler(int opt, int opt_index, void *data)
-{
- switch (opt) {
- case 'c':
- count = atoi(optarg);
- break;
- default:
- return IGT_OPT_HANDLER_ERROR;
- }
-
- return IGT_OPT_HANDLER_SUCCESS;
-}
-
-const char *help_str = " -c\tBuffer count\n";
-
-igt_simple_main_args("c:", NULL, help_str, opt_handler, NULL)
+igt_simple_main
{
uint32_t *handle, *start_val;
uint32_t start = 0;
- int i, fd;
+ int i, fd, count;
fd = drm_open_driver(DRIVER_INTEL);
-
igt_require(IS_GEN3(intel_get_drm_devid(fd)));
+ igt_require_gem(fd);
- if (count == 0)
- count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
- igt_info("Using %d 1MiB buffers\n", count);
+ count = 3 + gem_aperture_size(fd) / (1024 * 1024);
intel_require_memory(count, 1024*1024, CHECK_RAM);
handle = malloc(sizeof(uint32_t)*count*2);
@@ -364,39 +345,7 @@ igt_simple_main_args("c:", NULL, help_str, opt_handler, NULL)
start += 1024 * 1024 / 4;
}
- igt_info("Verifying initialisation..."); fflush(stdout);
- for (i = 0; i < count; i++)
- check_bo(fd, handle[i], start_val[i]);
- igt_info("done\n");
-
- igt_info("Cyclic blits, forward..."); fflush(stdout);
- for (i = 0; i < count * 32; i++) {
- int src = i % count;
- int dst = (i + 1) % count;
-
- copy(fd, handle[dst], handle[src]);
- start_val[dst] = start_val[src];
- }
- igt_info("verifying..."); fflush(stdout);
- for (i = 0; i < count; i++)
- check_bo(fd, handle[i], start_val[i]);
- igt_info("done\n");
-
- igt_info("Cyclic blits, backward..."); fflush(stdout);
- for (i = 0; i < count * 32; i++) {
- int src = (i + 1) % count;
- int dst = i % count;
-
- copy(fd, handle[dst], handle[src]);
- start_val[dst] = start_val[src];
- }
- igt_info("verifying..."); fflush(stdout);
- for (i = 0; i < count; i++)
- check_bo(fd, handle[i], start_val[i]);
- igt_info("done\n");
-
- igt_info("Random blits..."); fflush(stdout);
- for (i = 0; i < count * 32; i++) {
+ for (i = 0; i < count; i++) {
int src = random() % count;
int dst = random() % count;
@@ -406,8 +355,7 @@ igt_simple_main_args("c:", NULL, help_str, opt_handler, NULL)
copy(fd, handle[dst], handle[src]);
start_val[dst] = start_val[src];
}
- igt_info("verifying..."); fflush(stdout);
+
for (i = 0; i < count; i++)
check_bo(fd, handle[i], start_val[i]);
- igt_info("done\n");
}