summaryrefslogtreecommitdiff
path: root/tests/gem_exec_schedule.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gem_exec_schedule.c')
-rw-r--r--tests/gem_exec_schedule.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/tests/gem_exec_schedule.c b/tests/gem_exec_schedule.c
index 1f43147f..35a44ab1 100644
--- a/tests/gem_exec_schedule.c
+++ b/tests/gem_exec_schedule.c
@@ -132,9 +132,12 @@ static void unplug_show_queue(int fd, struct igt_cork *c, unsigned int engine)
igt_spin_t *spin[MAX_ELSP_QLEN];
for (int n = 0; n < ARRAY_SIZE(spin); n++) {
- uint32_t ctx = create_highest_priority(fd);
- spin[n] = __igt_spin_batch_new(fd, ctx, engine, 0);
- gem_context_destroy(fd, ctx);
+ const struct igt_spin_factory opts = {
+ .ctx = create_highest_priority(fd),
+ .engine = engine,
+ };
+ spin[n] = __igt_spin_batch_factory(fd, &opts);
+ gem_context_destroy(fd, opts.ctx);
}
igt_cork_unplug(c); /* batches will now be queued on the engine */
@@ -196,7 +199,7 @@ static void independent(int fd, unsigned int engine)
continue;
if (spin == NULL) {
- spin = __igt_spin_batch_new(fd, 0, other, 0);
+ spin = __igt_spin_batch_new(fd, .engine = other);
} else {
struct drm_i915_gem_exec_object2 obj = {
.handle = spin->handle,
@@ -428,7 +431,9 @@ static void preempt(int fd, unsigned ring, unsigned flags)
ctx[LO] = gem_context_create(fd);
gem_context_set_priority(fd, ctx[LO], MIN_PRIO);
}
- spin[n] = __igt_spin_batch_new(fd, ctx[LO], ring, 0);
+ spin[n] = __igt_spin_batch_new(fd,
+ .ctx = ctx[LO],
+ .engine = ring);
igt_debug("spin[%d].handle=%d\n", n, spin[n]->handle);
store_dword(fd, ctx[HI], ring, result, 0, n + 1, 0, I915_GEM_DOMAIN_RENDER);
@@ -462,7 +467,9 @@ static igt_spin_t *__noise(int fd, uint32_t ctx, int prio, igt_spin_t *spin)
for_each_physical_engine(fd, other) {
if (spin == NULL) {
- spin = __igt_spin_batch_new(fd, ctx, other, 0);
+ spin = __igt_spin_batch_new(fd,
+ .ctx = ctx,
+ .engine = other);
} else {
struct drm_i915_gem_exec_object2 obj = {
.handle = spin->handle,
@@ -672,7 +679,9 @@ static void preempt_self(int fd, unsigned ring)
n = 0;
gem_context_set_priority(fd, ctx[HI], MIN_PRIO);
for_each_physical_engine(fd, other) {
- spin[n] = __igt_spin_batch_new(fd, ctx[NOISE], other, 0);
+ spin[n] = __igt_spin_batch_new(fd,
+ .ctx = ctx[NOISE],
+ .engine = other);
store_dword(fd, ctx[HI], other,
result, (n + 1)*sizeof(uint32_t), n + 1,
0, I915_GEM_DOMAIN_RENDER);
@@ -714,7 +723,9 @@ static void preemptive_hang(int fd, unsigned ring)
ctx[LO] = gem_context_create(fd);
gem_context_set_priority(fd, ctx[LO], MIN_PRIO);
- spin[n] = __igt_spin_batch_new(fd, ctx[LO], ring, 0);
+ spin[n] = __igt_spin_batch_new(fd,
+ .ctx = ctx[LO],
+ .engine = ring);
gem_context_destroy(fd, ctx[LO]);
}