diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-11-09 12:19:14 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-02-21 10:37:49 +0000 |
commit | d8d93c6a6ea0ddc3a2cf316ceb2660c973f671c7 (patch) | |
tree | 109239d5e5b8e476b6cfa30eba0a62b8ac82f778 /tests | |
parent | 9ba3717a86553e15aa6e4aec8a77c2e3460fd4d3 (diff) |
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 <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gem_ctx_switch.c | 7 |
1 files changed, 7 insertions, 0 deletions
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) { |