Commit e7c31f6f authored by Robert Foss's avatar Robert Foss Committed by Eric Anholt

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: default avatarRobert Foss <robert.foss@collabora.com>
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
parent ee7c10e1
...@@ -117,10 +117,18 @@ static int vc4_atomic_commit(struct drm_device *dev, ...@@ -117,10 +117,18 @@ static int vc4_atomic_commit(struct drm_device *dev,
return -ENOMEM; return -ENOMEM;
/* Make sure that any outstanding modesets have finished. */ /* Make sure that any outstanding modesets have finished. */
ret = down_interruptible(&vc4->async_modeset); if (nonblock) {
if (ret) { ret = down_trylock(&vc4->async_modeset);
kfree(c); if (ret) {
return 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); ret = drm_atomic_helper_prepare_planes(dev, state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment