From patchwork Fri Apr 15 01:29:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 8844161 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2C257C0553 for ; Fri, 15 Apr 2016 01:30:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4405720377 for ; Fri, 15 Apr 2016 01:30:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A1C6F202F0 for ; Fri, 15 Apr 2016 01:30:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F28F06EB64; Fri, 15 Apr 2016 01:30:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 581406EB59 for ; Fri, 15 Apr 2016 01:29:49 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id ot11so50061361pab.1 for ; Thu, 14 Apr 2016 18:29:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WfaBMgpIkIInkvru1Pr+dMdddwm83VNat3GDzaw492A=; b=fNZzD1hSVDnZ3h8qt/vzkrPMddBVI8xY0sljMf8bNQ9QK2WpTmcPrLOeui0XhMqtx/ yxTomZj5drmdy56Ij0P1A6jdp0nPLUmNF4silMQA6RADXSvQzuWuSGkDa1vR1xv8JvCP F84+l2Z3m1/t+fRes5GKqFhvbvxHMTWy1eaiB2vZJjxWnYN8U9ryM4pcwvMEWOpgNRhy Iu7YczHCLZhYFtKpxpnJtsLqxTm+aKSEAkk/VN2imKD/swnVYkyBnl1B/xMN6UbJYRPz YdAGS5xRK2dcjFBW4iIwgeAXeyrxubGF8norPJo9LiopTKIJoLAX2CpeTbGVEuRdmIW3 asAQ== X-Gm-Message-State: AOPr4FVYema+FDw38nq7JKvRT4JzgX1EUcB0PeZRXmcNjNE8lQNvajGMq2C4IoIXxPLfiQ== X-Received: by 10.67.14.6 with SMTP id fc6mr25107245pad.55.1460683788648; Thu, 14 Apr 2016 18:29:48 -0700 (PDT) Received: from jade.localdomain (c-73-241-147-137.hsd1.ca.comcast.net. [73.241.147.137]) by smtp.gmail.com with ESMTPSA id 132sm10740538pfw.35.2016.04.14.18.29.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Apr 2016 18:29:48 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [RFC 3/8] drm/fence: allow fence waiting to be interrupted by userspace Date: Thu, 14 Apr 2016 18:29:36 -0700 Message-Id: <1460683781-22535-4-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1460683781-22535-1-git-send-email-gustavo@padovan.org> References: <1460683781-22535-1-git-send-email-gustavo@padovan.org> Cc: marcheu@google.com, Daniel Stone , seanpaul@google.com, Daniel Vetter , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , linux-kernel@vger.kernel.org, Riley Andrews , laurent.pinchart@ideasonboard.com, Gustavo Padovan , John Harrison , m.chehab@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan If userspace is running an synchronously atomic commit and interrupts the atomic operation during fence_wait() it will hang until the timer expires, so here we change the wait to be interruptible so it stop immediately when userspace wants to quit. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/drm_atomic_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 7bf678e..f85ef8c 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1007,7 +1007,7 @@ void drm_atomic_helper_wait_for_fences(struct drm_device *dev, WARN_ON(!plane->state->fb); - fence_wait(plane->state->fence, false); + fence_wait(plane->state->fence, true); fence_put(plane->state->fence); plane->state->fence = NULL; }