public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_kms: Be more verbose about failure in kmstest_wait_for_pageflip
@ 2019-04-04 13:17 Arkadiusz Hiler
  2019-04-04 14:32 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arkadiusz Hiler @ 2019-04-04 13:17 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

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@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@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

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-05  7:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-04 13:17 [igt-dev] [PATCH i-g-t] lib/igt_kms: Be more verbose about failure in kmstest_wait_for_pageflip Arkadiusz Hiler
2019-04-04 14:32 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-05  6:09 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-04-05  7:28 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox