summaryrefslogtreecommitdiff
path: root/lib/igt_gt.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/igt_gt.h')
-rw-r--r--lib/igt_gt.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index ad993c1b..dfe1cfb3 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -100,4 +100,13 @@ extern const struct intel_execution_engine {
unsigned flags;
} intel_execution_engines[];
+#define for_if(expr__) if (!(expr__)) {} else
+
+#define for_each_engine(fd__, flags__) \
+ for (const struct intel_execution_engine *e__ = intel_execution_engines;\
+ e__->name; \
+ e__++) \
+ for_if (gem_has_ring(fd, flags__ = e__->exec_id | e__->flags))
+
+
#endif /* IGT_GT_H */