diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2016-11-24 12:11:55 -0600 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2016-11-29 15:39:45 -0800 |
commit | 26fc78f6fef39b9d7a15def5e7e9826ff68303f4 (patch) | |
tree | 7110f99026dbefcdb82ac1b46a71acd6714bfa37 /drivers/gpu/drm/vc4/vc4_crtc.c | |
parent | c778cc5df944291dcdb1ca7a6bb781fbc22550c5 (diff) | |
download | talos-op-linux-26fc78f6fef39b9d7a15def5e7e9826ff68303f4.tar.gz talos-op-linux-26fc78f6fef39b9d7a15def5e7e9826ff68303f4.zip |
drm/vc4: Fix race between page flip completion event and clean-up
There was a small window where a userspace program could submit
a pageflip after receiving a pageflip completion event yet still
receive EBUSY.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_crtc.c')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_crtc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 7f08d681a74b..82f914af4156 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -669,6 +669,14 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id) CRTC_WRITE(PV_INTEN, 0); } +/* Must be called with the event lock held */ +bool vc4_event_pending(struct drm_crtc *crtc) +{ + struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); + + return !!vc4_crtc->event; +} + static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) { struct drm_crtc *crtc = &vc4_crtc->base; |