Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [i-g-t PATCH] tests/gem_wait_render_timeout: make sure the GPU is idle before exiting
@ 2013-05-27 15:42 Imre Deak
  2013-05-28  9:31 ` Daniel Vetter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Imre Deak @ 2013-05-27 15:42 UTC (permalink / raw)
  To: intel-gfx

Leaving the GPU running after we exit can mess up timing dependent tests
we run afterwards.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64270

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tests/gem_wait_render_timeout.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/gem_wait_render_timeout.c b/tests/gem_wait_render_timeout.c
index 14482e3..9ec4e49 100644
--- a/tests/gem_wait_render_timeout.c
+++ b/tests/gem_wait_render_timeout.c
@@ -216,6 +216,11 @@ int main(int argc, char **argv)
 	assert(gem_bo_wait_timeout(fd, dst2->handle, &timeout) == -ETIME);
 	assert(timeout == 0);
 
+	/* Make sure we exit only after the GPU is idle. Apply some fuzz
+	 * to the timeout since the calibrated iteration count can be
+	 * twice the amount the GPU can execute in a second. */
+	timeout = 5 * ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC;
+	assert(gem_bo_wait_timeout(fd, dst2->handle, &timeout) == 0);
 
 	if (do_signals)
 		drmtest_stop_signal_helper();
-- 
1.8.1.2

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

end of thread, other threads:[~2013-05-28 16:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-27 15:42 [i-g-t PATCH] tests/gem_wait_render_timeout: make sure the GPU is idle before exiting Imre Deak
2013-05-28  9:31 ` Daniel Vetter
2013-05-28 14:22 ` [i-g-t PATCH v2 1/2] lib: make sure all rings are idle in gpu_quiescent_gpu() Imre Deak
2013-05-28 14:22 ` [i-g-t PATCH v2 2/2] tests/lib: make sure the GPU is idle at test start and exit Imre Deak
2013-05-28 14:35   ` [i-g-t PATCH v3 " Imre Deak
2013-05-28 16:33     ` Daniel Vetter

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