[Intel-gfx] [PATCH i-g-t 03/11] lib/debugs: nuke igt_crc_equal again

Daniel Vetter daniel.vetter at ffwll.ch
Wed Jul 27 12:38:09 UTC 2016


This was intentionally left out of the abi since CRC have fairly low
entropy and can't be reliably compared for inequality in testcases.

Spotted while fixing up warnigns in docs, but given that igt_assert_crc_equal
has a big comment explaining why only the positive assert exists I'm not
sure all those docs are all that useful :(

Cc: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Cc: Matt Roper <matthew.d.roper at intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 lib/igt_debugfs.c         | 17 -----------------
 lib/igt_debugfs.h         |  1 -
 tests/kms_panel_fitting.c | 13 -------------
 tests/kms_pipe_color.c    |  2 +-
 4 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 103fe4d4c2d3..afb83617b85b 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -252,23 +252,6 @@ bool igt_debugfs_search(const char *filename, const char *substring)
  * @a: first pipe CRC value
  * @b: second pipe CRC value
  *
- * Compares two CRC values.
- */
-bool igt_crc_equal(igt_crc_t *a, igt_crc_t *b)
-{
-	int i;
-
-	for (i = 0; i < a->n_words; i++)
-		if (a->crc[i] != b->crc[i])
-			return false;
-	return true;
-}
-
-/**
- * igt_assert_crc_equal:
- * @a: first pipe CRC value
- * @b: second pipe CRC value
- *
  * Compares two CRC values and fails the testcase if they don't match with
  * igt_fail(). Note that due to CRC collisions CRC based testcase can only
  * assert that CRCs match, never that they are different. Otherwise there might
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 6a3cb07f1649..1a757b84a19a 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -124,7 +124,6 @@ __attribute__((warn_unused_result))
 int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
 			  igt_crc_t **out_crcs);
 void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
-bool igt_crc_equal(igt_crc_t *a, igt_crc_t *b);
 
 /*
  * Drop caches
diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index acc51ec5cc88..68887bf19858 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -219,9 +219,6 @@ test_panel_fitting_fastset(igt_display_t *display, const enum pipe pipe, igt_out
 {
 	igt_plane_t *primary, *sprite;
 	drmModeModeInfo mode;
-	igt_crc_t topleft, cur_crc;
-	igt_pipe_crc_t *pipe_crc;
-
 	struct igt_fb black, red;
 
 	igt_assert(kmstest_get_connector_default_mode(display->drm_fd, output->config.connector, &mode));
@@ -245,9 +242,6 @@ test_panel_fitting_fastset(igt_display_t *display, const enum pipe pipe, igt_out
 
 	igt_display_commit2(display, COMMIT_ATOMIC);
 
-	pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
-	igt_pipe_crc_collect_crc(pipe_crc, &topleft);
-
 	mode.hdisplay = 640;
 	mode.vdisplay = 480;
 	igt_output_override_mode(output, &mode);
@@ -258,15 +252,9 @@ test_panel_fitting_fastset(igt_display_t *display, const enum pipe pipe, igt_out
 	/* Don't pass ALLOW_MODESET with overridden mode, force fastset. */
 	igt_display_commit_atomic(display, 0, NULL);
 
-	igt_pipe_crc_collect_crc(pipe_crc, &cur_crc);
-
-	igt_assert(!igt_crc_equal(&topleft, &cur_crc));
-
 	igt_plane_set_fb(primary, NULL);
 	igt_output_set_pipe(output, PIPE_NONE);
 	igt_output_override_mode(output, NULL);
-
-	igt_pipe_crc_free(pipe_crc);
 }
 
 static void test_atomic_fastset(igt_display_t *display)
@@ -280,7 +268,6 @@ static void test_atomic_fastset(igt_display_t *display)
 	if (stat("/sys/module/i915/parameters/fastboot", &sb) == 0)
 		igt_set_module_param_int("fastboot", 1);
 
-	igt_require_pipe_crc();
 	igt_require(display->is_atomic);
 	igt_require(intel_gen(intel_get_drm_devid(display->drm_fd)) >= 5);
 
diff --git a/tests/kms_pipe_color.c b/tests/kms_pipe_color.c
index 9f7ac7ea4dba..b0a2f07e1405 100644
--- a/tests/kms_pipe_color.c
+++ b/tests/kms_pipe_color.c
@@ -724,7 +724,7 @@ static bool test_pipe_ctm(data_t *data,
 		/* Verify that the CRC of the software computed output is
 		 * equal to the CRC of the CTM matrix transformation output.
 		 */
-		ret &= igt_crc_equal(&crc_software, &crc_hardware);
+		igt_assert_crc_equal(&crc_software, &crc_hardware);
 
 		igt_output_set_pipe(output, PIPE_ANY);
 	}
-- 
2.8.1



More information about the Intel-gfx mailing list