From 0412f32670642f88bf6de6afce9179eefe608f13 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 16 Oct 2013 14:12:49 +0200 Subject: [PATCH] tests/debugfs_pipe_crc: correctly skip on unsupported platforms Signed-off-by: Daniel Vetter --- tests/debugfs_pipe_crc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/debugfs_pipe_crc.c b/tests/debugfs_pipe_crc.c index ff00361f..9884fd72 100644 --- a/tests/debugfs_pipe_crc.c +++ b/tests/debugfs_pipe_crc.c @@ -199,6 +199,10 @@ int main(int argc, char **argv) igt_subtest_init(argc, argv); igt_fixture { + size_t written; + int ret; + const char *cmd = "pipe A none"; + data.drm_fd = drm_open_any(); do_or_die(igt_set_vt_graphics_mode()); do_or_die(igt_install_exit_handler(exit_handler)); @@ -208,8 +212,12 @@ int main(int argc, char **argv) igt_debugfs_init(&data.debugfs); data.ctl = igt_debugfs_fopen(&data.debugfs, "i915_display_crc_ctl", "r+"); - if (!data.ctl) - igt_skip("No display_crc_ctl found, kernel too old\n"); + igt_require_f(data.ctl, + "No display_crc_ctl found, kernel too old\n"); + written = fwrite(cmd, 1, strlen(cmd), data.ctl); + ret = fflush(data.ctl); + igt_require_f((written == strlen(cmd) && ret == 0) || errno != ENODEV, + "CRCs not supported on this platform\n"); } igt_subtest("bad-pipe")