From e7a0d06730f77842998368660fb45fe5c1738fda Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 21 Mar 2017 13:12:07 +0000 Subject: igt/gem_exec_nop: Sync before measuring total elapsed time The systematic error should be lost in the millions of cycles, but better pedagogically correct. Signed-off-by: Chris Wilson --- tests/gem_exec_nop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c index 5a2f1b93..5d0d4957 100644 --- a/tests/gem_exec_nop.c +++ b/tests/gem_exec_nop.c @@ -387,6 +387,9 @@ static void sequential(int fd, uint32_t handle, unsigned flags, int timeout) count += 1024; clock_gettime(CLOCK_MONOTONIC, &now); } while (elapsed(&start, &now) < timeout); /* Hang detection ~120s */ + + gem_sync(fd, obj[0].handle); + clock_gettime(CLOCK_MONOTONIC, &now); results[child] = elapsed(&start, &now) / count; if (flags & CONTEXT) -- cgit v1.2.3