[Intel-gfx] [PATCH] tests/pm_rpm: add gem-evict-pwrite subtest

Imre Deak imre.deak at intel.com
Thu Nov 13 13:58:05 CET 2014


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 <imre.deak at intel.com>
---
 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 9b42918..7bca11c 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -31,6 +31,9 @@
 #include <intel_bufmgr.h>
 #include <stdbool.h>
 
+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 1e65c04..c120d75 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")
-- 
1.8.4




More information about the Intel-gfx mailing list