[Intel-gfx] [PATCH 3/3] lib: make igt_pipe_crc_start never fail

Daniel Vetter daniel.vetter at ffwll.ch
Fri Dec 6 10:48:44 CET 2013


It's what callers expect - pipe_crc_new is the function where
we pass a potential failure back to callers.

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 lib/igt_debugfs.c          | 7 ++-----
 lib/igt_debugfs.h          | 2 +-
 tests/kms_pipe_crc_basic.c | 2 +-
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 139be893f75b..4b96521331af 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -269,12 +269,11 @@ void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
 	free(pipe_crc);
 }
 
-bool igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
+void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
 {
 	igt_crc_t *crcs = NULL;
 
-	if (!igt_pipe_crc_do_start(pipe_crc))
-		return false;
+	igt_assert(igt_pipe_crc_do_start(pipe_crc));
 
 	/*
 	 * For some no yet identified reason, the first CRC is bonkers. So
@@ -282,8 +281,6 @@ bool igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
 	 */
 	igt_pipe_crc_get_crcs(pipe_crc, 1, &crcs);
 	free(crcs);
-
-	return true;
 }
 
 void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc)
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 393b5767adbe..075e44625213 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -75,7 +75,7 @@ igt_pipe_crc_t *
 igt_pipe_crc_new(igt_debugfs_t *debugfs, int drm_fd, enum pipe pipe,
 		 enum intel_pipe_crc_source source);
 void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc);
-bool igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
+void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
 void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc);
 void igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
 			   igt_crc_t **out_crcs);
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 90d9b9404877..3fc59344d90d 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -180,7 +180,7 @@ static void test_read_crc(data_t *data, int pipe, unsigned flags)
 			continue;
 		valid_connectors++;
 
-		igt_assert(igt_pipe_crc_start(pipe_crc));
+		igt_pipe_crc_start(pipe_crc);
 
 		/* wait for 3 vblanks and the corresponding 3 CRCs */
 		igt_pipe_crc_get_crcs(pipe_crc, 3, &crcs);
-- 
1.8.4.3




More information about the Intel-gfx mailing list