[Intel-gfx] [PATCH 1/5] lib/core: add interactive debug point to igt_fail

Daniel Vetter daniel.vetter at ffwll.ch
Fri Mar 13 10:43:04 PDT 2015


Useful for inspecting the screen state in kms tests when they fail.

Also move the screen clearing in kms_cursor_crc to the bottom.

Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 lib/igt_core.c         | 2 ++
 tests/kms_cursor_crc.c | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index c217a016f856..410554435b70 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -917,6 +917,8 @@ void igt_fail(int exitcode)
 {
 	assert(exitcode != IGT_EXIT_SUCCESS && exitcode != IGT_EXIT_SKIP);
 
+	igt_debug_wait_for_keypress("failure");
+
 	if (!failed_one)
 		igt_exitcode = exitcode;
 
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 94e2b4a731e6..3de7e021f3f3 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -130,13 +130,14 @@ static void do_single_test(data_t *data, int x, int y)
 	/* Now render the same in software and collect crc */
 	draw_cursor(cr, x, y, data->curw, data->curh);
 	igt_display_commit(display);
+
 	igt_wait_for_vblank(data->drm_fd, data->pipe);
 	igt_pipe_crc_collect_crc(pipe_crc, &ref_crc);
 	/* Clear screen afterwards */
+	igt_assert(igt_crc_equal(&crc, &ref_crc));
+
 	igt_paint_color(cr, 0, 0, data->screenw, data->screenh,
 			0.0, 0.0, 0.0);
-
-	igt_assert(igt_crc_equal(&crc, &ref_crc));
 }
 
 static void do_fail_test(data_t *data, int x, int y, int expect)
-- 
1.9.3



More information about the Intel-gfx mailing list