summaryrefslogtreecommitdiff
path: root/tests/kms_pipe_crc_basic.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-12-18 14:35:05 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2016-01-08 15:01:59 +0200
commit909074503012a11fc631118cd3180b4a1c27646e (patch)
tree1f6998c5d989db7d4f20aabd4df4e9498081ff51 /tests/kms_pipe_crc_basic.c
parent5b113d323dde18ef3bbae2f57d613be4ab7eb267 (diff)
lib: Add igt_pipe_crc_new_nonblock()
Add support for reading the CRC in non-blocking mode. Useful for tests that want to start the CRC capture, then do a bunch of operations, then collect however many CRCs that got generated. The current igt_pipe_crc_new() + igt_pipe_crc_get_crcs() method would block until it gets the requested number of CRCs, whreas in non-blocking mode we can just read as many as got generated thus far. v2: __attribute__((warn_unused_result)), document the new igt_pipe_crc_get_crcs() return value (Daniel) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_pipe_crc_basic.c')
-rw-r--r--tests/kms_pipe_crc_basic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index a3292c22..6b99e57c 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -124,6 +124,7 @@ test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output,
for (c = 0; c < ARRAY_SIZE(colors); c++) {
char *crc_str;
+ int n_crcs;
igt_output_set_pipe(output, pipe);
igt_display_commit(display);
@@ -156,7 +157,8 @@ test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output,
igt_pipe_crc_start(pipe_crc);
/* wait for N_CRCS vblanks and the corresponding N_CRCS CRCs */
- igt_pipe_crc_get_crcs(pipe_crc, N_CRCS, &crcs);
+ n_crcs = igt_pipe_crc_get_crcs(pipe_crc, N_CRCS, &crcs);
+ igt_assert_eq(n_crcs, N_CRCS);
igt_pipe_crc_stop(pipe_crc);