summaryrefslogtreecommitdiff
path: root/tests/gem_ctx_switch.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-09-08 15:34:09 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-09-08 15:42:49 +0100
commit8bde63fe23587194667f39e27ea92f9f046fb0db (patch)
tree96203d91374d20a6d94daa0122820a4ed49efc2e /tests/gem_ctx_switch.c
parent61b19a4b8f68d4cf82382f7776c740311b9d0be0 (diff)
igt/gem_ctx_switch: Increase execution weight
Add a heavier batch of (1M nops) in order to stress a context switch onto a busy engine. (The immediate goal is try and fill the GuC workqueue, but it seems like the lightweight test was enough anyway, as well as gem_exec_nop.) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_ctx_switch.c')
-rw-r--r--tests/gem_ctx_switch.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/tests/gem_ctx_switch.c b/tests/gem_ctx_switch.c
index aa48a168..0f5286d7 100644
--- a/tests/gem_ctx_switch.c
+++ b/tests/gem_ctx_switch.c
@@ -143,33 +143,41 @@ igt_main
{
const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
const struct intel_execution_engine *e;
- uint32_t handle = 0;
+ uint32_t light = 0, heavy;
int fd = -1;
igt_fixture {
const uint32_t bbe = MI_BATCH_BUFFER_END;
fd = drm_open_driver(DRIVER_INTEL);
- handle = gem_create(fd, 4096);
- gem_write(fd, handle, 0, &bbe, sizeof(bbe));
+ light = gem_create(fd, 4096);
+ gem_write(fd, light, 0, &bbe, sizeof(bbe));
+
+ heavy = gem_create(fd, 4096*1024);
+ gem_write(fd, heavy, 4096*1024-sizeof(bbe), &bbe, sizeof(bbe));
igt_fork_hang_detector(fd);
}
for (e = intel_execution_engines; e->name; e++) {
igt_subtest_f("%s%s", e->exec_id == 0 ? "basic-" : "", e->name)
- single(fd, handle, e, 0, 1);
+ single(fd, light, e, 0, 1);
+ igt_subtest_f("%s%s-heavy", e->exec_id == 0 ? "basic-" : "", e->name)
+ single(fd, heavy, e, 0, 1);
igt_subtest_f("%s-interruptible", e->name)
- single(fd, handle, e, INTERRUPTIBLE, 1);
+ single(fd, light, e, INTERRUPTIBLE, 1);
igt_subtest_f("forked-%s", e->name)
- single(fd, handle, e, 0, ncpus);
+ single(fd, light, e, 0, ncpus);
+ igt_subtest_f("forked-%s-heavy", e->name)
+ single(fd, heavy, e, 0, ncpus);
igt_subtest_f("forked-%s-interruptible", e->name)
- single(fd, handle, e, INTERRUPTIBLE, ncpus);
+ single(fd, light, e, INTERRUPTIBLE, ncpus);
}
igt_fixture {
igt_stop_hang_detector();
- gem_close(fd, handle);
+ gem_close(fd, heavy);
+ gem_close(fd, light);
close(fd);
}
}