diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-03 14:16:19 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-03 14:53:10 +0000 |
commit | 5c37c3ee1e9490c16d2575bdcf1521f2092351b8 (patch) | |
tree | a50284281c55a030da6ca268d437950ba358042b /tests | |
parent | 75b3bcd33ce9679d8b12d04a63d3a66e7aaf68e5 (diff) |
i915/gem_exec_create: Trim loop counters
gem_create + gem_execbuf should be long enough that the accuracy of
gettime is insignificant; and this is a test not a benchmark! Remove the
1024 loop so that we check for timeout more frequently.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/i915/gem_exec_create.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/i915/gem_exec_create.c b/tests/i915/gem_exec_create.c index 102a161d..e3ceb3f5 100644 --- a/tests/i915/gem_exec_create.c +++ b/tests/i915/gem_exec_create.c @@ -93,23 +93,21 @@ static void all(int fd, unsigned flags, int timeout, int ncpus) count = 0; clock_gettime(CLOCK_MONOTONIC, &start); do { - for (int loop = 0; loop < 1024; loop++) { - for (int n = 0; n < nengine; n++) { - obj.handle = gem_create(fd, 4096); - gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); - execbuf.flags &= ~ENGINE_FLAGS; - execbuf.flags |= engines[n]; - gem_execbuf(fd, &execbuf); - if (flags & LEAK) - gem_madvise(fd, obj.handle, I915_MADV_DONTNEED); - else - gem_close(fd, obj.handle); - } + for (int n = 0; n < nengine; n++) { + obj.handle = gem_create(fd, 4096); + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); + execbuf.flags &= ~ENGINE_FLAGS; + execbuf.flags |= engines[n]; + gem_execbuf(fd, &execbuf); + if (flags & LEAK) + gem_madvise(fd, obj.handle, I915_MADV_DONTNEED); + else + gem_close(fd, obj.handle); } - count += nengine * 1024; + count += nengine; clock_gettime(CLOCK_MONOTONIC, &now); } while (elapsed(&start, &now) < timeout); /* Hang detection ~120s */ - obj.handle = gem_create(fd, 4096); + obj.handle = gem_create(fd, 4096); gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); for (int n = 0; n < nengine; n++) { execbuf.flags &= ~ENGINE_FLAGS; |