From patchwork Fri Sep 4 16:58:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 7124841 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 05E919F1D5 for ; Fri, 4 Sep 2015 17:00:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E54E20636 for ; Fri, 4 Sep 2015 17:00:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1E033206A0 for ; Fri, 4 Sep 2015 17:00:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 47DAA6E1C6; Fri, 4 Sep 2015 10:00:54 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from gproxy5-pub.mail.unifiedlayer.com (gproxy5-pub.mail.unifiedlayer.com [67.222.38.55]) by gabe.freedesktop.org (Postfix) with SMTP id A61286EC26 for ; Fri, 4 Sep 2015 10:00:52 -0700 (PDT) Received: (qmail 2671 invoked by uid 0); 4 Sep 2015 17:00:50 -0000 Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy5.mail.unifiedlayer.com with SMTP; 4 Sep 2015 17:00:50 -0000 Received: from box514.bluehost.com ([74.220.219.114]) by cmgw3 with id DB0d1r01m2UhLwi01B0gP6; Fri, 04 Sep 2015 17:00:48 -0600 X-Authority-Analysis: v=2.1 cv=GpXRpCFC c=1 sm=1 tr=0 a=9W6Fsu4pMcyimqnCr1W0/w==:117 a=9W6Fsu4pMcyimqnCr1W0/w==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=TBVoxVdAAAAA:8 a=GhZ5P8ky69gA:10 a=noBwr2J6l1kA:10 a=ff-B7xzCdYMA:10 a=p-NxfO9uefyFwziouyIA:9 a=NMzydyIAmgcVsRnK:21 a=Lku0WPgfbKLHqyRC:21 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuousgeek.org; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=NqzcEB+3Yh0KteriJlUCARppX+2dWoFmv6PAcMRIYxQ=; b=Ze5zN/isovWFS+swmBxWN/49KxZMoV5EizqgtB2NmhETkaqrtMZXGD7fGfwCls8wx2fONvYqdygvD0dSj96vTnZea7efCS9tw0RSiarT6lXYblKOwMHbvfZ4awyT2ygT; Received: from [67.161.37.189] (port=52804 helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.84) (envelope-from ) id 1ZXuLu-0003Ni-Pj; Fri, 04 Sep 2015 11:00:38 -0600 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Date: Fri, 4 Sep 2015 09:58:58 -0700 Message-Id: <1441385943-11508-5-git-send-email-jbarnes@virtuousgeek.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441385943-11508-1-git-send-email-jbarnes@virtuousgeek.org> References: <1441385943-11508-1-git-send-email-jbarnes@virtuousgeek.org> X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 67.161.37.189 authed with jbarnes@virtuousgeek.org} Cc: dwmw2@infradead.org Subject: [Intel-gfx] [PATCH 4/9] android/sync: hack: enable fence signaling in Android Native Sync implementation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 --- drivers/staging/android/sync.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index 7f0e919..858278d 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -384,24 +384,29 @@ int sync_fence_wait(struct sync_fence *fence, long timeout) timeout = msecs_to_jiffies(timeout); trace_sync_wait(fence, 1); - for (i = 0; i < fence->num_fences; ++i) + for (i = 0; i < fence->num_fences; ++i) { trace_sync_pt(fence->cbs[i].sync_pt); + ret = fence_wait_timeout(fence->cbs[i].sync_pt, true, timeout); + if (ret < 0) { + trace_sync_wait(fence, 0); + return ret; + } else if (ret == 0) { + trace_sync_wait(fence, 0); + if (timeout) { + pr_info("fence timeout on [%p] after %dms\n", + fence, jiffies_to_msecs(timeout)); + sync_dump(); + } + return -ETIME; + } + } +#if 0 ret = wait_event_interruptible_timeout(fence->wq, atomic_read(&fence->status) <= 0, timeout); +#endif trace_sync_wait(fence, 0); - if (ret < 0) { - return ret; - } else if (ret == 0) { - if (timeout) { - pr_info("fence timeout on [%p] after %dms\n", fence, - jiffies_to_msecs(timeout)); - sync_dump(); - } - return -ETIME; - } - ret = atomic_read(&fence->status); if (ret) { pr_info("fence error %ld on [%p]\n", ret, fence);