tests/drv_hangman: Convert to using central list of engines

Rather than encoding our own list of engines, use the common one for
greater coverage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2016-02-04 11:17:42 +00:00
parent 01e467a631
commit 38fe49d9a8
3 changed files with 17 additions and 21 deletions

View File

@ -539,12 +539,12 @@ unsigned intel_detect_and_clear_missed_interrupts(int fd)
} }
const struct intel_execution_engine intel_execution_engines[] = { const struct intel_execution_engine intel_execution_engines[] = {
{ "default", 0, 0 }, { "default", NULL, 0, 0 },
{ "render", I915_EXEC_RENDER, 0 }, { "render", "render ring", I915_EXEC_RENDER, 0 },
{ "bsd", I915_EXEC_BSD, 0 }, { "bsd", "bsd ring", I915_EXEC_BSD, 0 },
{ "bsd1", I915_EXEC_BSD, 1<<13 /*I915_EXEC_BSD_RING1*/ }, { "bsd1", "bsd ring", I915_EXEC_BSD, 1<<13 /*I915_EXEC_BSD_RING1*/ },
{ "bsd2", I915_EXEC_BSD, 2<<13 /*I915_EXEC_BSD_RING2*/ }, { "bsd2", "bsd2 ring", I915_EXEC_BSD, 2<<13 /*I915_EXEC_BSD_RING2*/ },
{ "blt", I915_EXEC_BLT, 0 }, { "blt", "blitter ring", I915_EXEC_BLT, 0 },
{ "vebox", I915_EXEC_VEBOX, 0 }, { "vebox", "video enhancement ring", I915_EXEC_VEBOX, 0 },
{ NULL, 0, 0 } { NULL, 0, 0 }
}; };

View File

@ -93,6 +93,7 @@ unsigned intel_detect_and_clear_missed_interrupts(int fd);
extern const struct intel_execution_engine { extern const struct intel_execution_engine {
const char *name; const char *name;
const char *full_name;
unsigned exec_id; unsigned exec_id;
unsigned flags; unsigned flags;
} intel_execution_engines[]; } intel_execution_engines[];

View File

@ -288,19 +288,10 @@ static void test_error_state_capture(unsigned ring_id,
check_error_state(gen, cmd_parser, ring_name, offset); check_error_state(gen, cmd_parser, ring_name, offset);
} }
static const struct target_ring {
const int id;
const char *short_name;
const char *full_name;
} rings[] = {
{ I915_EXEC_RENDER, "render", "render ring" },
{ I915_EXEC_BSD, "bsd", "bsd ring" },
{ I915_EXEC_BLT, "blt", "blitter ring" },
{ I915_EXEC_VEBOX, "vebox", "video enhancement ring" },
};
igt_main igt_main
{ {
const struct intel_execution_engine *e;
igt_skip_on_simulation(); igt_skip_on_simulation();
igt_subtest("error-state-debugfs-entry") igt_subtest("error-state-debugfs-entry")
@ -315,8 +306,12 @@ igt_main
igt_subtest("error-state-basic") igt_subtest("error-state-basic")
test_error_state_basic(); test_error_state_basic();
for (int i = 0; i < sizeof(rings)/sizeof(rings[0]); i++) { for (e = intel_execution_engines; e->name; e++) {
igt_subtest_f("error-state-capture-%s", rings[i].short_name) if (e->exec_id == 0)
test_error_state_capture(rings[i].id, rings[i].full_name); continue;
igt_subtest_f("error-state-capture-%s", e->name)
test_error_state_capture(e->exec_id | e->flags,
e->full_name);
} }
} }