mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-20 12:52:55 +00:00
igt/gem_exec_suspend: Do pre/post suspend double checks
Check that the system operates normally before and after the suspend (as well as across the suspend). The goal is to isolate the breakage to the subtest. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
@@ -36,6 +36,8 @@ enum mode {
|
||||
HIBERNATE,
|
||||
};
|
||||
|
||||
static void run_test(int fd, unsigned ring, enum mode mode);
|
||||
|
||||
static void check_bo(int fd, uint32_t handle)
|
||||
{
|
||||
uint32_t *map;
|
||||
@@ -49,6 +51,14 @@ static void check_bo(int fd, uint32_t handle)
|
||||
munmap(map, 4096);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
static void run_test(int fd, unsigned ring, enum mode mode)
|
||||
{
|
||||
const int gen = intel_gen(intel_get_drm_devid(fd));
|
||||
@@ -61,6 +71,10 @@ static void run_test(int fd, unsigned ring, enum mode mode)
|
||||
igt_skip_on_f(gen == 6 && (ring & ~(3<<13)) == I915_EXEC_BSD,
|
||||
"MI_STORE_DATA broken on gen6 bsd\n");
|
||||
|
||||
/* Before suspending, check normal operation */
|
||||
if (mode != NOSLEEP)
|
||||
test_all(fd);
|
||||
|
||||
gem_quiescent_gpu(fd);
|
||||
|
||||
memset(&execbuf, 0, sizeof(execbuf));
|
||||
@@ -135,6 +149,12 @@ static void run_test(int fd, unsigned ring, enum mode mode)
|
||||
|
||||
check_bo(fd, obj[0].handle);
|
||||
gem_close(fd, obj[0].handle);
|
||||
|
||||
gem_quiescent_gpu(fd);
|
||||
|
||||
/* After resume, make sure it still works */
|
||||
if (mode != NOSLEEP)
|
||||
test_all(fd);
|
||||
}
|
||||
|
||||
igt_main
|
||||
|
||||
Reference in New Issue
Block a user