summaryrefslogtreecommitdiffstats
path: root/include/drm/drmP.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-11-25 15:39:03 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-11-26 15:21:27 +0100
commit9b2c0b7fb4ce79566d830d03ce7aa11cccc39f97 (patch)
tree9d5e5e095ceb0b817f7666412a9772caacb46d57 /include/drm/drmP.h
parentdrm: Drop dev->event_lock spinlock around faulting copy_to_user() (diff)
downloadlinux-9b2c0b7fb4ce79566d830d03ce7aa11cccc39f97.tar.xz
linux-9b2c0b7fb4ce79566d830d03ce7aa11cccc39f97.zip
drm: Serialise multiple event readers
The previous patch reintroduced a race condition whereby a failure in one reader may allow a second reader to see out-of-order events. Introduce a mutex to serialise readers so that an event is completed in its entirety before another reader may process an event. The two readers may race against each other, but the events each retrieves are in the correct order. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Thomas Hellstrom <thellstrom@vmware.com> Cc: Takashi Iwai <tiwai@suse.de> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1448462343-2072-2-git-send-email-chris@chris-wilson.co.uk Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r--include/drm/drmP.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 30d4a5a495e2..8e1df1f7057c 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -344,6 +344,8 @@ struct drm_file {
struct list_head event_list;
int event_space;
+ struct mutex event_read_lock;
+
struct drm_prime_file_private prime;
};