From b35b1505f762839b0e9a0f8a146804444566a92a Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Thu, 13 Nov 2014 13:33:54 +0200 Subject: tests/pm_rpm: add gem-evict-pwrite subtest This triggers a device suspended WARN in the kernel in gen6_ggtt_insert_entries() while calling the GEM pwrite ioctl. The sequence is suggested by Daniel. Signed-off-by: Imre Deak Reviewed-by: Daniel Vetter --- lib/igt_aux.h | 3 +++ tests/pm_rpm.c | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/lib/igt_aux.h b/lib/igt_aux.h index 9b42918f..7bca11c4 100644 --- a/lib/igt_aux.h +++ b/lib/igt_aux.h @@ -31,6 +31,9 @@ #include #include +extern drm_intel_bo **trash_bos; +extern int num_trash_bos; + /* auxialiary igt helpers from igt_aux.c */ /* generally useful helpers */ void igt_fork_signal_helper(void); diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index 1e65c04e..c120d75e 100644 --- a/tests/pm_rpm.c +++ b/tests/pm_rpm.c @@ -1319,6 +1319,29 @@ static void gem_idle_subtest(void) gem_quiescent_gpu(drm_fd); } +static void gem_evict_pwrite_subtest(void) +{ + static drm_intel_bufmgr *bufmgr; + uint32_t buf; + int i; + + bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096); + igt_assert(bufmgr); + igt_init_aperture_trashers(bufmgr); + + igt_trash_aperture(); + + disable_or_dpms_all_screens_and_wait(&ms_data, true); + igt_assert(wait_for_suspended()); + + buf = 0; + for (i = 0; i < num_trash_bos; i++) + gem_write(drm_fd, trash_bos[i]->handle, 0, &buf, sizeof(buf)); + + igt_cleanup_aperture_trashers(); + drm_intel_bufmgr_destroy(bufmgr); +} + /* This also triggered WARNs on dmesg at some point. */ static void reg_read_ioctl_subtest(void) { @@ -1830,6 +1853,8 @@ int main(int argc, char *argv[]) gem_execbuf_subtest(); igt_subtest("gem-idle") gem_idle_subtest(); + igt_subtest("gem-evict-pwrite") + gem_evict_pwrite_subtest(); /* Planes and cursors */ igt_subtest("cursor") -- cgit v1.2.3