summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-18 18:43:30 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-20 16:11:57 +0200
commitf698984bae5e907eedfa335b463ab717a45ecc2a (patch)
tree92d197a94af4211c167689266017302f29a92094 /tests
parent09e9f0b216dd7ee06b857ce5fd5cc9cb5ca491dc (diff)
tests/debugfs_pipe_crc: new subtest to check CRC frame numbers
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r--tests/debugfs_pipe_crc.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/debugfs_pipe_crc.c b/tests/debugfs_pipe_crc.c
index 3d025543..32572c8b 100644
--- a/tests/debugfs_pipe_crc.c
+++ b/tests/debugfs_pipe_crc.c
@@ -146,7 +146,9 @@ static void display_fini(data_t *data)
drmModeFreeResources(data->resources);
}
-static void test_read_crc(data_t *data, int pipe)
+#define TEST_SEQUENCE (1<<0)
+
+static void test_read_crc(data_t *data, int pipe, unsigned flags)
{
connector_t *connector;
igt_pipe_crc_t *pipe_crc;
@@ -193,6 +195,11 @@ static void test_read_crc(data_t *data, int pipe)
igt_assert(igt_crc_equal(&crcs[0], &crcs[1]));
igt_assert(igt_crc_equal(&crcs[1], &crcs[2]));
+ if (flags & TEST_SEQUENCE) {
+ igt_assert(crcs[0].frame + 1 == crcs[1].frame);
+ igt_assert(crcs[1].frame + 1 == crcs[2].frame);
+ }
+
free(crcs);
igt_pipe_crc_free(pipe_crc);
kmstest_remove_fb(data->drm_fd, &connector->fb);
@@ -247,14 +254,13 @@ int main(int argc, char **argv)
igt_subtest("bad-nb-words-3")
test_bad_command(&data, "pipe A none option");
- igt_subtest("read-crc-pipe-A")
- test_read_crc(&data, 0);
+ for (int i = 0; i < 3; i++) {
+ igt_subtest_f("read-crc-pipe-%c", 'A'+i)
+ test_read_crc(&data, i, 0);
- igt_subtest("read-crc-pipe-B")
- test_read_crc(&data, 1);
-
- igt_subtest("read-crc-pipe-C")
- test_read_crc(&data, 2);
+ igt_subtest_f("read-crc-pipe-%c-frame-sequence", 'A'+i)
+ test_read_crc(&data, i, TEST_SEQUENCE);
+ }
igt_fixture {
igt_pipe_crc_reset();