summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2014-11-13 13:33:54 +0200
committerImre Deak <imre.deak@intel.com>2014-11-14 00:18:30 +0200
commitb35b1505f762839b0e9a0f8a146804444566a92a (patch)
tree1115683c79170d23c4d55aadf4bb8e2e2f941a5c
parentf12ed8305807975e232e42fd34ad75e1147a788e (diff)
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 <imre.deak@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--lib/igt_aux.h3
-rw-r--r--tests/pm_rpm.c25
2 files changed, 28 insertions, 0 deletions
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 <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 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")