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>
This commit is contained in:
Chris Wilson 2014-12-04 11:23:11 +00:00
parent 594470c809
commit f8aecdffad
1 changed files with 4 additions and 1 deletions

View File

@ -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