@@ -252,6 +252,23 @@ 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
@@ -124,6 +124,7 @@ __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
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> --- lib/igt_debugfs.c | 17 +++++++++++++++++ lib/igt_debugfs.h | 1 + 2 files changed, 18 insertions(+)