diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-03 17:23:09 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-03 17:26:13 +0000 |
commit | 5b6930b4d267f7002c2e9442262e21a725941db5 (patch) | |
tree | 4ac4c962a127bc57d8033855df2c85414b6e07af /tests/i915 | |
parent | a3d29ab3524cef41bf4a2dce36f591897e6f8b48 (diff) |
i915/gem_ctx_create: Trim fixed loop of 1024
As it may take 17ms to create a context and execute, there is no
advantage in doing it a thousand times before checking for timeout.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests/i915')
-rw-r--r-- | tests/i915/gem_ctx_create.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/tests/i915/gem_ctx_create.c b/tests/i915/gem_ctx_create.c index d9192fba..2d477226 100644 --- a/tests/i915/gem_ctx_create.c +++ b/tests/i915/gem_ctx_create.c @@ -104,20 +104,17 @@ static void files(int core, int timeout, const int ncpus) clock_gettime(CLOCK_MONOTONIC, &start); do { - do { - fd = gem_reopen_driver(core); - /* - * Ensure the gpu is idle by launching - * a nop execbuf and stalling for it. - */ - gem_quiescent_gpu(fd); - gem_context_copy_engines(core, 0, fd, 0); - obj.handle = gem_open(fd, name); - execbuf.flags &= ~ENGINE_FLAGS; - execbuf.flags |= ppgtt_engines[count % ppgtt_nengine]; - gem_execbuf(fd, &execbuf); - close(fd); - } while (++count & 1023); + fd = gem_reopen_driver(core); + gem_context_copy_engines(core, 0, fd, 0); + + obj.handle = gem_open(fd, name); + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= ppgtt_engines[count % ppgtt_nengine]; + gem_execbuf(fd, &execbuf); + + close(fd); + count++; + clock_gettime(CLOCK_MONOTONIC, &end); } while (elapsed(&start, &end) < timeout); |