Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752124AbdFUSu2 (ORCPT ); Wed, 21 Jun 2017 14:50:28 -0400 Received: from anholt.net ([50.246.234.109]:50716 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223AbdFUSuH (ORCPT ); Wed, 21 Jun 2017 14:50:07 -0400 From: Eric Anholt To: dri-devel@lists.freedesktop.org, Boris Brezillon Cc: linux-kernel@vger.kernel.org, Eric Anholt Subject: [PATCH 2/4] drm/vc4: Wait for fences interruptibly in blocking mode. Date: Wed, 21 Jun 2017 11:50:00 -0700 Message-Id: <20170621185002.28563-2-eric@anholt.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170621185002.28563-1-eric@anholt.net> References: <20170621185002.28563-1-eric@anholt.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 973 Lines: 32 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 --- drivers/gpu/drm/vc4/vc4_kms.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index bc6ecdc6f104..6b1ccea76243 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -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 = -- 2.11.0