summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-12-04 11:23:11 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-12-04 11:25:55 +0000
commitf8aecdffada438306dff8923cdfc0df527509672 (patch)
tree98cea777f91fbcc5758723b90fd1791896d2c0ba /src
parent594470c809627feab4891bade5ec6d80e1d0a919 (diff)
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_driver.c5
1 files changed, 4 insertions, 1 deletions
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