diff mbox

[i-g-t,v2,01/12] tests/kms_atomic_transition: use igt timeout instead of blocking

Message ID 20161214090509.15716-2-robert.foss@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Robert Foss Dec. 14, 2016, 9:04 a.m. UTC
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

If the event never arrives we can timeout and end the test.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
---
 tests/kms_atomic_transition.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index 19779935..fb8864e8 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -297,7 +297,9 @@  static void commit_display(igt_display_t *display, unsigned event_mask, bool non
 		struct drm_event_vblank *vblank = (void *)buf;
 		uint32_t crtc_id, pipe = I915_MAX_PIPES;
 
+		igt_set_timeout(3, "Timed out while reading drm_fd\n");
 		ret = read(display->drm_fd, buf, sizeof(buf));
+		igt_reset_timeout();
 		if (ret < 0 && (errno == EINTR || errno == EAGAIN))
 			continue;