diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-06-25 13:27:36 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-07-06 14:29:35 +0100 |
commit | 4b57f85b31f01701584190dd2f0adbc9563562be (patch) | |
tree | 80902143e54703a7688c4e383703ca876340cb30 /tests/gem_eio.c | |
parent | f4a60b943391519aa95bcd6aa2a4a7f9ed34d084 (diff) |
lib: Convert spin batch constructor to a factory
In order to make adding more options easier, expose the full set of
options to the caller.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests/gem_eio.c')
-rw-r--r-- | tests/gem_eio.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/gem_eio.c b/tests/gem_eio.c index 5faf7502..0ec1aaec 100644 --- a/tests/gem_eio.c +++ b/tests/gem_eio.c @@ -157,10 +157,15 @@ static int __gem_wait(int fd, uint32_t handle, int64_t timeout) static igt_spin_t * __spin_poll(int fd, uint32_t ctx, unsigned long flags) { - if (gem_can_store_dword(fd, flags)) - return __igt_spin_batch_new_poll(fd, ctx, flags); - else - return __igt_spin_batch_new(fd, ctx, flags, 0); + struct igt_spin_factory opts = { + .ctx = ctx, + .engine = flags, + }; + + if (gem_can_store_dword(fd, opts.engine)) + opts.flags |= IGT_SPIN_POLL_RUN; + + return __igt_spin_batch_factory(fd, &opts); } static void __spin_wait(int fd, igt_spin_t *spin) |