[igt-dev] [PATCH i-g-t 2/2] HACK tests/kms_rotation_crc: use igt_pipe_crc_get_current_with_reference()

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Thu Feb 14 13:57:13 UTC 2019


use igt_pipe_crc_get_current_with_reference() to see if failed
crcs happen only at first frames or if they're static.
---
 tests/kms_rotation_crc.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index fc995d0..69507ec 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -336,7 +336,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
 	igt_assert_eq(ret, 0);
 
 	/* Check CRC */
-	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
+	igt_pipe_crc_get_current_with_reference(display->drm_fd, data->pipe_crc, &crc_output, &data->ref_crc);
 	igt_assert_crc_equal(&data->ref_crc, &crc_output);
 
 	/*
@@ -359,7 +359,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
 			igt_assert_eq(ret, 0);
 		}
 		kmstest_wait_for_pageflip(data->gfx_fd);
-		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
+		igt_pipe_crc_get_current_with_reference(display->drm_fd, data->pipe_crc, &crc_output, &data->flip_crc);
 		igt_assert_crc_equal(&data->flip_crc,
 				     &crc_output);
 	}
@@ -428,7 +428,7 @@ typedef struct {
 
 static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 			       igt_crc_t *crc_output, planeinfos *planeinfo,
-			       int numplanes)
+			       int numplanes, igt_crc_t *refcrc)
 {
 	uint32_t w, h;
 	igt_display_t *display = &data->display;
@@ -473,7 +473,8 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
 	igt_assert_eq(ret, 0);
 
-	igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
+	igt_pipe_crc_get_current_with_reference(data->gfx_fd, data->pipe_crc,
+						crc_output, refcrc);
 
 	for (c = 0; c < numplanes && oldplanes; c++)
 		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
@@ -606,13 +607,13 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						p[1].rotation_sw = planeconfigs[j].rotation;
 						p[1].rotation_hw = IGT_ROTATION_0;
 						if (!get_multiplane_crc(data, output, &retcrc_sw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT, NULL))
 							continue;
 
 						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
 						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
 						if (!get_multiplane_crc(data, output, &retcrc_hw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT, &retcrc_sw))
 							continue;
 
 						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
-- 
2.7.4



More information about the igt-dev mailing list