From f8aecdffada438306dff8923cdfc0df527509672 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 4 Dec 2014 11:23:11 +0000 Subject: [PATCH] sna: Clear the read flags for the shared drm fd after use In ZaphodHeads, we may reuse the same select read flags and attempt to read from a blocking drm fd multiple times. However, if we clear the read flags after first exhausting the fd, we shouldn't then block on subsequent heads. Signed-off-by: Chris Wilson --- src/sna/sna_driver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 79442f4b..d4accebf 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -772,8 +772,11 @@ sna_wakeup_handler(WAKEUPHANDLER_ARGS_DECL) sna_accel_wakeup_handler(sna); - if (FD_ISSET(sna->kgem.fd, (fd_set*)read_mask)) + if (FD_ISSET(sna->kgem.fd, (fd_set*)read_mask)) { sna_mode_wakeup(sna); + /* Clear the flag so that subsequent ZaphodHeads don't block */ + FD_CLR(sna->kgem.fd, (fd_set*)read_mask); + } } #if HAVE_UDEV