From b36664ce9fe796f925692afd8c2dea72b3adb354 Mon Sep 17 00:00:00 2001 From: Erik Gilling Date: Thu, 28 Feb 2013 16:43:04 -0800 Subject: [PATCH] --- yaml --- r: 363264 b: refs/heads/master c: 57b505bbe746dcc011152e79732bdaf96723c51a h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/staging/android/sync.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 555457a42857..fb6a90456b71 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b1489c2704b3db72ff37ecabe054926176e88e50 +refs/heads/master: 57b505bbe746dcc011152e79732bdaf96723c51a diff --git a/trunk/drivers/staging/android/sync.c b/trunk/drivers/staging/android/sync.c index f84caad35d68..9e35ea3e73da 100644 --- a/trunk/drivers/staging/android/sync.c +++ b/trunk/drivers/staging/android/sync.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -221,12 +222,14 @@ static void sync_pt_activate(struct sync_pt *pt) } static int sync_fence_release(struct inode *inode, struct file *file); +static unsigned int sync_fence_poll(struct file *file, poll_table *wait); static long sync_fence_ioctl(struct file *file, unsigned int cmd, unsigned long arg); static const struct file_operations sync_fence_fops = { .release = sync_fence_release, + .poll = sync_fence_poll, .unlocked_ioctl = sync_fence_ioctl, }; @@ -497,6 +500,20 @@ static int sync_fence_release(struct inode *inode, struct file *file) return 0; } +static unsigned int sync_fence_poll(struct file *file, poll_table *wait) +{ + struct sync_fence *fence = file->private_data; + + poll_wait(file, &fence->wq, wait); + + if (fence->status == 1) + return POLLIN; + else if (fence->status < 0) + return POLLERR; + else + return 0; +} + static long sync_fence_ioctl_wait(struct sync_fence *fence, unsigned long arg) { __s32 value;