summaryrefslogtreecommitdiff
path: root/lib/igt_dummyload.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-06-25 13:27:36 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2018-07-06 14:29:35 +0100
commit4b57f85b31f01701584190dd2f0adbc9563562be (patch)
tree80902143e54703a7688c4e383703ca876340cb30 /lib/igt_dummyload.h
parentf4a60b943391519aa95bcd6aa2a4a7f9ed34d084 (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 'lib/igt_dummyload.h')
-rw-r--r--lib/igt_dummyload.h42
1 files changed, 19 insertions, 23 deletions
diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h
index c6ccc293..c794f254 100644
--- a/lib/igt_dummyload.h
+++ b/lib/igt_dummyload.h
@@ -43,29 +43,25 @@ typedef struct igt_spin {
bool *running;
} igt_spin_t;
-igt_spin_t *__igt_spin_batch_new(int fd,
- uint32_t ctx,
- unsigned engine,
- uint32_t dep);
-igt_spin_t *igt_spin_batch_new(int fd,
- uint32_t ctx,
- unsigned engine,
- uint32_t dep);
-
-igt_spin_t *__igt_spin_batch_new_fence(int fd,
- uint32_t ctx,
- unsigned engine);
-
-igt_spin_t *igt_spin_batch_new_fence(int fd,
- uint32_t ctx,
- unsigned engine);
-
-igt_spin_t *__igt_spin_batch_new_poll(int fd,
- uint32_t ctx,
- unsigned engine);
-igt_spin_t *igt_spin_batch_new_poll(int fd,
- uint32_t ctx,
- unsigned engine);
+struct igt_spin_factory {
+ uint32_t ctx;
+ uint32_t dependency;
+ unsigned int engine;
+ unsigned int flags;
+};
+
+#define IGT_SPIN_FENCE_OUT (1 << 0)
+#define IGT_SPIN_POLL_RUN (1 << 1)
+
+igt_spin_t *
+__igt_spin_batch_factory(int fd, const struct igt_spin_factory *opts);
+igt_spin_t *
+igt_spin_batch_factory(int fd, const struct igt_spin_factory *opts);
+
+#define __igt_spin_batch_new(fd, ...) \
+ __igt_spin_batch_factory(fd, &((struct igt_spin_factory){__VA_ARGS__}))
+#define igt_spin_batch_new(fd, ...) \
+ igt_spin_batch_factory(fd, &((struct igt_spin_factory){__VA_ARGS__}))
void igt_spin_batch_set_timeout(igt_spin_t *spin, int64_t ns);
void igt_spin_batch_end(igt_spin_t *spin);