Commit c647760f authored by Chris Wilson's avatar Chris Wilson

igt/prime_busy: Declare the hang tests expect to cause GPU hangs

Pull the two subtests together into the same subtest group as the
fixtures were repeated for both and so we can consolidate down to one.
Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
parent 4b0e0bf4
......@@ -52,6 +52,8 @@ static void busy(int fd, unsigned ring, unsigned flags)
uint32_t *batch, *bbe;
int i, count, timeout;
gem_quiescent_gpu(fd);
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)obj;
execbuf.buffer_count = 2;
......@@ -172,53 +174,39 @@ static void busy(int fd, unsigned ring, unsigned flags)
close(pfd[SCRATCH].fd);
}
static void run_busy(int fd,
const struct intel_execution_engine *e,
const char *name, unsigned flags)
{
igt_fixture {
gem_require_ring(fd, e->exec_id | e->flags);
igt_require(gem_can_store_dword(fd, e->exec_id | e->flags));
gem_quiescent_gpu(fd);
if ((flags & HANG) == 0)
igt_fork_hang_detector(fd);
}
igt_subtest_f("%s%s-%s",
!e->exec_id && !(flags & HANG) ? "basic-" : "",
name, e->name)
busy(fd, e->exec_id | e->flags, flags);
igt_fixture {
if ((flags & HANG) == 0)
igt_stop_hang_detector();
gem_quiescent_gpu(fd);
}
}
static void run_poll(int fd,
const struct intel_execution_engine *e,
const char *name, unsigned flags)
static void test_engine_mode(int fd,
const struct intel_execution_engine *e,
const char *name, unsigned int flags)
{
igt_fixture {
gem_require_ring(fd, e->exec_id | e->flags);
igt_require(gem_can_store_dword(fd, e->exec_id | e->flags));
gem_quiescent_gpu(fd);
if ((flags & HANG) == 0)
igt_fork_hang_detector(fd);
}
igt_hang_t hang = {};
igt_subtest_f("%swait-%s-%s",
!e->exec_id && !(flags & HANG) ? "basic-" : "",
name, e->name)
busy(fd, e->exec_id | e->flags, flags | POLL);
igt_subtest_group {
igt_fixture {
gem_require_ring(fd, e->exec_id | e->flags);
igt_require(gem_can_store_dword(fd, e->exec_id | e->flags));
if ((flags & HANG) == 0)
igt_fork_hang_detector(fd);
else
hang = igt_allow_hang(fd, 0, 0);
}
igt_fixture {
if ((flags & HANG) == 0)
igt_stop_hang_detector();
gem_quiescent_gpu(fd);
igt_subtest_f("%s%s-%s",
!e->exec_id && !(flags & HANG) ? "basic-" : "",
name, e->name)
busy(fd, e->exec_id | e->flags, flags);
igt_subtest_f("%swait-%s-%s",
!e->exec_id && !(flags & HANG) ? "basic-" : "",
name, e->name)
busy(fd, e->exec_id | e->flags, flags | POLL);
igt_fixture {
if ((flags & HANG) == 0)
igt_stop_hang_detector();
else
igt_disallow_hang(fd, hang);
}
}
}
......@@ -250,10 +238,7 @@ igt_main
for (e = intel_execution_engines; e->name; e++) {
for (const struct mode *m = modes; m->name; m++)
igt_subtest_group {
run_busy(fd, e, m->name, m->flags);
run_poll(fd, e, m->name, m->flags);
}
test_engine_mode(fd, e, m->name, m->flags);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment