Otherwise drmHandleEvent will block if accidentally read too often... Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Cc: Phillip Haddad <phillip.haddad@xxxxxxxxx> --- drivers/gpu/drm/drm_fops.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 2ec7d48..279aa95 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -617,6 +617,9 @@ ssize_t drm_read(struct file *filp, char __user *buffer, size_t total; ssize_t ret; + if (filp->f_flags & O_NONBLOCK && list_empty(&file_priv->event_list)) + return -EAGAIN; + ret = wait_event_interruptible(file_priv->event_wait, !list_empty(&file_priv->event_list)); if (ret < 0) -- 1.7.5.3 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel