Skip to content

Commit

Permalink
drm/vc4: Return -EBUSY if there's already a pending flip event.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Foss authored and Eric Anholt committed May 31, 2016
1 parent ee7c10e commit e7c31f6
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions drivers/gpu/drm/vc4/vc4_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e7c31f6

Please sign in to comment.