From be913a3336bcc1c933ad448224f09da138f16c0a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 12 Mar 2017 09:28:56 +0000 Subject: sna: Don't stall indefinitely for a missing flip event If we don't see the flip event completion in time for the next Present flip, just report failure - rather than block indefinitely. References: https://bugs.freedesktop.org/show_bug.cgi?id=100162 Signed-off-by: Chris Wilson --- src/sna/sna_present.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/sna') diff --git a/src/sna/sna_present.c b/src/sna/sna_present.c index 7c536ab6..2796d972 100644 --- a/src/sna/sna_present.c +++ b/src/sna/sna_present.c @@ -862,12 +862,10 @@ sna_present_flip(RRCrtcPtr crtc, DBG(("%s: flips still pending, stalling\n", __FUNCTION__)); pfd.fd = sna->kgem.fd; pfd.events = POLLIN; - do { - if (poll(&pfd, 1, -1) != 1) - return FALSE; - + while (poll(&pfd, 1, 0) == 1) sna_mode_wakeup(sna); - } while (sna->mode.flip_active); + if (sna->mode.flip_active) + return FALSE; } bo = get_flip_bo(pixmap); -- cgit v1.2.3