[Intel-gfx] [PATCH i-g-t] tests/gem_reset_stats : mask off ring_stop bits

tim.gore at intel.com tim.gore at intel.com
Wed Jun 3 01:20:21 PDT 2015


From: Tim Gore <tim.gore at intel.com>

Function check_gpu_ok checks to make sure that any hangs
have cleared by testing for (flags == 0). Some tests set
the STOP_RINGS_ALLOW_BAN and STOP_RINGS_ALLOW_ERRORS flags
but these do not get cleared by an individual ring reset,
(a feature added recently to the driver), leading the
check_gpu_ok function to think that the gpu is still hung.

So I mask the flags with STOP_RING_ALL, to ignore the mode
bits and look only at the bits that stop the rings.

Once gpu_check_ok sees that the gpu is not hung I write 0
to stop_rings in order to clear it completely. This is
because igt_set_stop_rings will only write to stop_rings
if either a) they are currently 0 or b) we are writing 0.
If we leave the mode bits set then subsequent calls to
igt_set_stop_rings to create hangs will fail.

Signed-off-by: Tim Gore <tim.gore at intel.com>
---
 tests/gem_reset_stats.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c
index 0e9db10..2bb4291 100644
--- a/tests/gem_reset_stats.c
+++ b/tests/gem_reset_stats.c
@@ -1033,7 +1033,7 @@ static void check_gpu_ok(void)
 	igt_debug("checking gpu state\n");
 
 	while (retry_count--) {
-		flags = igt_get_stop_rings();
+		flags = igt_get_stop_rings() & STOP_RING_ALL;
 		if (flags == 0)
 			break;
 
@@ -1043,6 +1043,12 @@ static void check_gpu_ok(void)
 
 	igt_assert(flags == 0);
 
+	/*
+	 * Clear the _ALLOW_ERRORS and _ALLOW_BAN flags;
+	 * these are not cleared by individual ring reset.
+	 */
+	igt_set_stop_rings(0);
+
 	fd = drm_open_any();
 	gem_quiescent_gpu(fd);
 	close(fd);
-- 
2.3.0



More information about the Intel-gfx mailing list