summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2016-05-03 20:48:20 +0300
committerEric Anholt <eric@anholt.net>2016-06-01 01:15:55 +0300
commite7c31f6f25b84fed961dc0dce6248878527693ae (patch)
tree437782986e1050b5a8a5b40f10282b974524f8a3 /drivers/gpu
parentee7c10e10b632e2319ed1d2d49d63df51a611e62 (diff)
downloadlinux-e7c31f6f25b84fed961dc0dce6248878527693ae.tar.xz
drm/vc4: Return -EBUSY if there's already a pending flip event.
As per the documentation in drm_crtc.h, atomic_commit should return -EBUSY if an asynchronous update is requested and there is an earlier update pending. v2: Rebase on the s/async/nonblock/ change. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/vc4/vc4_kms.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
index cb37751bc99f..861a623bc185 100644
--- a/drivers/gpu/drm/vc4/vc4_kms.c
+++ b/drivers/gpu/drm/vc4/vc4_kms.c
@@ -117,10 +117,18 @@ static int vc4_atomic_commit(struct drm_device *dev,
return -ENOMEM;
/* Make sure that any outstanding modesets have finished. */
- ret = down_interruptible(&vc4->async_modeset);
- if (ret) {
- kfree(c);
- return ret;
+ if (nonblock) {
+ ret = down_trylock(&vc4->async_modeset);
+ if (ret) {
+ kfree(c);
+ return -EBUSY;
+ }
+ } else {
+ ret = down_interruptible(&vc4->async_modeset);
+ if (ret) {
+ kfree(c);
+ return ret;
+ }
}
ret = drm_atomic_helper_prepare_planes(dev, state);