public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] igt/gem_fence_thrash, gem_mmap_gtt: Don't let the device sleep
@ 2019-05-23  9:49 Chris Wilson
  2019-05-23 10:08 ` [igt-dev] " Mika Kuoppala
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chris Wilson @ 2019-05-23  9:49 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

These tests are not intended to exercise runtime pm, but the device
going to sleep in the middle of these tests can significantly slow them
down as the GTT mmapping is torn down and must be rebuilt. This can be a
major nuisance if the device autosuspends many times a second.

These tests differ from typical applications as they are not doing any
rendering or utilizing the display which would ordinarily keep the
device awake.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_fence_thrash.c | 17 +++++++++++++++++
 tests/i915/gem_mmap_gtt.c     | 15 ++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/tests/i915/gem_fence_thrash.c b/tests/i915/gem_fence_thrash.c
index 2d7fb2ff8..770e9cb98 100644
--- a/tests/i915/gem_fence_thrash.c
+++ b/tests/i915/gem_fence_thrash.c
@@ -232,10 +232,27 @@ static int run_test(int threads_per_fence, void *f, int tiling,
 	return 0;
 }
 
+static int wakeref_open(int device)
+{
+	int dir, fd;
+
+	dir = igt_debugfs_dir(device);
+	fd = openat(dir, "i915_wakeref_user", O_RDONLY);
+	close(dir);
+
+	return fd;
+}
+
 igt_main
 {
 	igt_skip_on_simulation();
 
+	igt_fixture {
+		int fd = drm_open_driver(DRIVER_INTEL);
+		wakeref_open(fd);
+		close(fd);
+	}
+
 	igt_subtest("bo-write-verify-none")
 		igt_assert(run_test(0, bo_write_verify, I915_TILING_NONE, 80) == 0);
 
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index 9a670f030..4b709f81e 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -873,6 +873,17 @@ static int mmap_ioctl(int i915, struct drm_i915_gem_mmap_gtt *arg)
 	return err;
 }
 
+static int wakeref_open(int device)
+{
+	int dir, fd;
+
+	dir = igt_debugfs_dir(device);
+	fd = openat(dir, "i915_wakeref_user", O_RDONLY);
+	close(dir);
+
+	return fd;
+}
+
 int fd;
 
 igt_main
@@ -880,8 +891,10 @@ igt_main
 	if (igt_run_in_simulation())
 		OBJECT_SIZE = 1 * 1024 * 1024;
 
-	igt_fixture
+	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
+		wakeref_open(fd);
+	}
 
 	igt_subtest("bad-object") {
 		uint32_t real_handle = gem_create(fd, 4096);
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-24 11:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-23  9:49 [Intel-gfx] [PATCH i-g-t] igt/gem_fence_thrash, gem_mmap_gtt: Don't let the device sleep Chris Wilson
2019-05-23 10:08 ` [igt-dev] " Mika Kuoppala
2019-05-23 10:17   ` Chris Wilson
2019-05-23 12:05 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-05-24 11:17 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox