diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-03-05 11:02:03 +0100 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-03-23 11:02:28 +0100 |
| commit | d297e58529217cb70e79639b13608f458332b2d0 (patch) | |
| tree | 71a4e4f5b275bdfdbb386e2e935c691e0bc71ec9 /lib | |
| parent | 562bbe12f6fb75811a746c742a28d32a17b26aa9 (diff) | |
lib: Only warn about suspicious CRCs
It is theoretically possible to hit these in the wild, so only warn
about them. Dropping the test is probably too much since these caught
some real bugs in the past.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/igt_debugfs.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index 61313aad..85c3f222 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -188,22 +188,6 @@ FILE *igt_debugfs_fopen(const char *filename, * Pipe CRC */ -static bool igt_crc_is_null(igt_crc_t *crc) -{ - int i; - - for (i = 0; i < crc->n_words; i++) { - igt_warn_on_f(crc->crc[i] == 0xffffffff, - "Suspicious CRC: it looks like the CRC " - "read back was from a register in a powered " - "down well\n"); - if (crc->crc[i]) - return false; - } - - return true; -} - /** * igt_assert_crc_equal: * @a: first pipe CRC value @@ -498,6 +482,23 @@ igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs, *out_crcs = crcs; } +static void crc_sanity_checks(igt_crc_t *crc) +{ + int i; + bool all_zero = true; + + for (i = 0; i < crc->n_words; i++) { + igt_warn_on_f(crc->crc[i] == 0xffffffff, + "Suspicious CRC: it looks like the CRC " + "read back was from a register in a powered " + "down well\n"); + if (crc->crc[i]) + all_zero = false; + } + + igt_warn_on_f(all_zero, "Suspicious CRC: All values are 0.\n"); +} + /** * igt_pipe_crc_collect_crc: * @pipe_crc: pipe CRC object @@ -515,7 +516,7 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc) read_one_crc(pipe_crc, out_crc); igt_pipe_crc_stop(pipe_crc); - igt_assert(!igt_crc_is_null(out_crc)); + crc_sanity_checks(out_crc); } /* |
