mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-24 00:06:09 +00:00
lib: Magic for_each_engine() macro to iterate over available engines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
60eafc5489
commit
697c3f5550
@ -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 */
|
||||
|
@ -53,10 +53,10 @@ static void check_bo(int fd, uint32_t handle)
|
||||
|
||||
static void test_all(int fd)
|
||||
{
|
||||
const struct intel_execution_engine *e;
|
||||
for (e = intel_execution_engines; e->name; e++)
|
||||
if (gem_has_ring(fd, e->exec_id | e->flags))
|
||||
run_test(fd, e->exec_id | e->flags, NOSLEEP);
|
||||
unsigned engine;
|
||||
|
||||
for_each_engine(fd, engine)
|
||||
run_test(fd, engine, NOSLEEP);
|
||||
}
|
||||
|
||||
static void run_test(int fd, unsigned ring, enum mode mode)
|
||||
|
Loading…
x
Reference in New Issue
Block a user