diff options
author | Paul Kocialkowski <paul.kocialkowski@linux.intel.com> | 2017-07-19 16:46:09 +0300 |
---|---|---|
committer | Lyude <lyude@redhat.com> | 2017-07-19 12:05:27 -0400 |
commit | 5e4e8295e1c89fb33cbc84de11aaa30abba6f4f9 (patch) | |
tree | 20f6852f47664f419a17cec9e706fd01e7f02caf /tests/chamelium.c | |
parent | 34a54192e1fb25041d032d92da59d143afa67464 (diff) |
chamelium: Dump captured and reference frames to png on crc error
This adds support for dumping both the frame capture from the chamelium
and the reference frame generated by cairo when the captured crc does
not match the crc calculated from the reference, using common helpers.
Getting a dump of the frames is quite useful in order to compare them.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
Reviewed-by: Lyude <lyude@redhat.com>
Diffstat (limited to 'tests/chamelium.c')
-rw-r--r-- | tests/chamelium.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/chamelium.c b/tests/chamelium.c index ecd0434c..1567386e 100644 --- a/tests/chamelium.c +++ b/tests/chamelium.c @@ -431,7 +431,7 @@ test_display_crc_single(data_t *data, struct chamelium_port *port) struct igt_fb fb; drmModeModeInfo *mode; drmModeConnector *connector; - int fb_id, i; + int fb_id, i, captured_frame_count; reset_state(data, port); @@ -456,11 +456,15 @@ test_display_crc_single(data_t *data, struct chamelium_port *port) igt_debug("Testing single CRC fetch\n"); - crc = chamelium_get_crc_for_area(data->chamelium, port, - 0, 0, 0, 0); + chamelium_capture(data->chamelium, port, 0, 0, 0, 0, 1); + crc = chamelium_read_captured_crcs(data->chamelium, + &captured_frame_count); expected_crc = chamelium_calculate_fb_crc_async_finish(fb_crc); + chamelium_assert_crc_eq_or_dump(data->chamelium, expected_crc, + crc, &fb, 0); + igt_assert_crc_equal(crc, expected_crc); free(expected_crc); free(crc); @@ -522,7 +526,9 @@ test_display_crc_multiple(data_t *data, struct chamelium_port *port) expected_crc = chamelium_calculate_fb_crc_async_finish(fb_crc); for (j = 0; j < captured_frame_count; j++) - igt_assert_crc_equal(&crc[j], expected_crc); + chamelium_assert_crc_eq_or_dump(data->chamelium, + expected_crc, &crc[j], + &fb, j); free(expected_crc); free(crc); |