[igt-dev] [PATCH i-g-t] lib/igt_kms: Be more verbose about failure in kmstest_wait_for_pageflip
Arkadiusz Hiler
arkadiusz.hiler at intel.com
Thu Apr 4 13:17:40 UTC 2019
First, we set errno to 0 before doing select() to avoid random pollution
of the assert message with things like:
"Last errno: 25, Inappropriate ioctl for device"
Second, we log explicitly if we exceeded the timeout (ret == 0).
Third, if we fail the select() we log that with some explanation.
Cc: Petri Latvala <petri.latvala at intel.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
---
lib/igt_kms.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index a975ff14..f8b0dab2 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1504,9 +1504,17 @@ void kmstest_wait_for_pageflip(int fd)
FD_ZERO(&fds);
FD_SET(fd, &fds);
do {
+ errno = 0;
ret = select(fd + 1, &fds, NULL, NULL, &timeout);
} while (ret < 0 && errno == EINTR);
- igt_assert_eq(ret, 1);
+
+ igt_fail_on_f(ret == 0,
+ "Exceeded timeout (50ms) while waiting for a pageflip\n");
+
+ igt_assert_f(ret == 1,
+ "Waiting for pageflip failed with %d from select(drmfd)\n",
+ ret);
+
igt_assert(drmHandleEvent(fd, &evctx) == 0);
}
--
2.20.1
More information about the igt-dev
mailing list