summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-07-25 15:46:56 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-09-06 19:04:16 +0100
commit4a1c8daff2005e2cbfe980d63bc0a0fb09cb017d (patch)
tree27ca4b126b63ac13a8ae9dbe04c5e2b0e6716048 /tests
parent0d028f8fd07f0a4b46c9e4659eb3caf93a69ac11 (diff)
igt/gem_ringfill: Prime execbuf before measuring ring size
Make sure that our buffers are ready and loaded to reduce the initial stall. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: MichaƂ Winiarski <michal.winiarski@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_ringfill.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index b52996a4..01cbd0a9 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -288,10 +288,15 @@ static unsigned int measure_ring_size(int fd)
obj[1].handle = gem_create(fd, 4096);
gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
+ memset(&execbuf, 0, sizeof(execbuf));
+ execbuf.buffers_ptr = to_user_pointer(obj + 1);
+ execbuf.buffer_count = 1;
+ gem_execbuf(fd, &execbuf);
+ gem_sync(fd, obj[1].handle);
+
plug(fd, &c);
obj[0].handle = c.handle;
- memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = to_user_pointer(obj);
execbuf.buffer_count = 2;
@@ -302,7 +307,8 @@ static unsigned int measure_ring_size(int fd)
itv.it_value.tv_usec = 1000;
setitimer(ITIMER_REAL, &itv, NULL);
- last = count = 0;
+ last = -1;
+ count = 0;
do {
if (__execbuf(fd, &execbuf) == 0) {
count++;