[igt-dev] [PATCH] lib/igt_debugfs: skip test instead of assert if crc/control is invalid
Mark Yacoub
markyacoub at chromium.org
Thu Jul 8 16:01:27 UTC 2021
From: Mark Yacoub <markyacoub at google.com>
[Why]
Some drivers such as msm do not currently support debugfs yet.
[How]
Change igt_assert of opening "crtc-%d/crc/control" to igt_require_f.
Opening this file doesn't involved a complicated logic so assert isn't
required to verify that things are smooth. -1 indicates that the file
isn't supported by the driver.
Test: kms_atomic:plane-immutable-zpos on ChromeOS Trogdor(msm)
Signed-off-by: Mark Yacoub <markyacoub at chromium.org>
---
lib/igt_debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 2f58519a..5042728e 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -691,7 +691,7 @@ pipe_crc_new(int fd, enum pipe pipe, const char *source, int flags)
sprintf(buf, "crtc-%d/crc/control", pipe);
pipe_crc->ctl_fd = openat(debugfs, buf, O_WRONLY);
- igt_assert(pipe_crc->ctl_fd != -1);
+ igt_require_f(pipe_crc->ctl_fd != -1, "CRC isn't supported on this device.\n");
pipe_crc->crc_fd = -1;
pipe_crc->fd = fd;
--
2.32.0.93.g670b81a890-goog
More information about the igt-dev
mailing list