drm/vc4: Wait for fences interruptibly in blocking mode.
authorEric Anholt <eric@anholt.net>
Wed, 21 Jun 2017 18:50:00 +0000 (11:50 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 22 Jun 2017 18:14:19 +0000 (11:14 -0700)
We should allow SIGIO and things to interrupt us before we get to the
no-error stage of the commit process.  This code is effectively copied
from drm_atomic_helper_commit().

Signed-off-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170621185002.28563-2-eric@anholt.net
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/gpu/drm/vc4/vc4_kms.c

index c2c9f82b2df1e9dcd1691f1d6272b5349169b45c..86fcdb0bd75f3ca188bc103b1f342d194dfda7c9 100644 (file)
@@ -142,6 +142,16 @@ static int vc4_atomic_commit(struct drm_device *dev,
                return ret;
        }
 
+       if (!nonblock) {
+               ret = drm_atomic_helper_wait_for_fences(dev, state, true);
+               if (ret) {
+                       drm_atomic_helper_cleanup_planes(dev, state);
+                       kfree(c);
+                       up(&vc4->async_modeset);
+                       return ret;
+               }
+       }
+
        for_each_plane_in_state(state, plane, new_state, i) {
                if ((plane->state->fb != new_state->fb) && new_state->fb) {
                        struct drm_gem_cma_object *cma_bo =