From d8d93c6a6ea0ddc3a2cf316ceb2660c973f671c7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 9 Nov 2017 12:19:14 +0000 Subject: igt/gem_ctx_switch: Do a warmup pass over all contexts Ensure that we always use every context at least once before we start running the stress-test. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- tests/gem_ctx_switch.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/gem_ctx_switch.c b/tests/gem_ctx_switch.c index 4db902b1..79b1d74b 100644 --- a/tests/gem_ctx_switch.c +++ b/tests/gem_ctx_switch.c @@ -101,6 +101,13 @@ static void single(int fd, uint32_t handle, struct timespec start, now; unsigned int count = 0; + /* Warmup to bind all objects into each ctx before we begin */ + for (int i = 0; i < ARRAY_SIZE(contexts); i++) { + execbuf.rsvd1 = contexts[i]; + gem_execbuf(fd, &execbuf); + } + gem_sync(fd, handle); + clock_gettime(CLOCK_MONOTONIC, &start); do { igt_while_interruptible(flags & INTERRUPTIBLE) { -- cgit v1.2.3