[Intel-gfx] [PATCH] tests/kms_flip: Add vblank vs. gpu hang testcase

Daniel Vetter daniel.vetter at ffwll.ch
Tue May 20 14:42:50 CEST 2014


Currently broken :(

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 tests/kms_flip.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index f2ec9ef64701..634b6274afae 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -75,6 +75,7 @@
 #define TEST_SUSPEND		(1 << 26)
 #define TEST_TS_CONT		(1 << 27)
 #define TEST_BO_TOOBIG		(1 << 28)
+#define TEST_HANG_ONCE		(1 << 29)
 
 #define EVENT_FLIP		(1 << 0)
 #define EVENT_VBLANK		(1 << 1)
@@ -1174,6 +1175,12 @@ static unsigned int wait_for_events(struct test_output *o)
 static unsigned event_loop(struct test_output *o, unsigned duration_ms)
 {
 	unsigned long start, end;
+	uint32_t hang = 0;	/* Suppress GCC warning */
+
+	if (o->flags & TEST_HANG_ONCE) {
+		hang = hang_gpu(drm_fd);
+		igt_assert_f(hang, "failed to exercise page flip hang recovery\n");
+	}
 
 	start = gettime_us();
 
@@ -1192,6 +1199,9 @@ static unsigned event_loop(struct test_output *o, unsigned duration_ms)
 
 	end = gettime_us();
 
+	if (hang)
+		unhang_gpu(drm_fd, hang);
+
 	/* Flush any remaining events */
 	if (o->pending_events)
 		wait_for_events(o);
@@ -1542,6 +1552,7 @@ int main(int argc, char **argv)
 			TEST_CHECK_TS, "flip-vs-blocking-wf-vblank" },
 		{ 30, TEST_FLIP | TEST_MODESET | TEST_HANG | TEST_NOEVENT, "flip-vs-modeset-vs-hang" },
 		{ 30, TEST_FLIP | TEST_PAN | TEST_HANG, "flip-vs-panning-vs-hang" },
+		{ 30, TEST_VBLANK | TEST_HANG_ONCE, "vblank-vs-hang" },
 		{ 1, TEST_FLIP | TEST_EINVAL | TEST_FB_BAD_TILING, "flip-vs-bad-tiling" },
 
 		{ 1, TEST_DPMS_OFF | TEST_MODESET | TEST_FLIP,
-- 
1.8.1.4




More information about the Intel-gfx mailing list