From patchwork Tue Aug 8 22:46:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Ekstrand X-Patchwork-Id: 9889183 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 99C88603F9 for ; Tue, 8 Aug 2017 22:47:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C3C628951 for ; Tue, 8 Aug 2017 22:47:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 812DA28A1C; Tue, 8 Aug 2017 22:47:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9E98F28A20 for ; Tue, 8 Aug 2017 22:47:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF4576E25C; Tue, 8 Aug 2017 22:46:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 74A606E260 for ; Tue, 8 Aug 2017 22:46:39 +0000 (UTC) Received: by mail-pf0-x241.google.com with SMTP id p13so4351068pfd.4 for ; Tue, 08 Aug 2017 15:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jlekstrand-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yxq3M0BJLFLU33tpG9ZzMGkWRxCbnanEaskRNLIDwEw=; b=Lxv0Chr6pw1lOQl2SvxNmo9OzijpnWGCH8ml0EAVcB2/4spEtAIqqHkp2LpdeaiBJm iUJKavVj24Kwa7xUDnz7XjiNE/Q+1JBBujyyJ27HIbsam9E/ff684PEgFW/Wo/VNmF4l 2W2zMZ77XpBZDEMsPLZr8sLbZt/TVI/bf4eFfJIbuw3LqThA83jAEVn4zHobAwEh6rSR KM606W5eCnOvWj1SK2wSOpSv3CjIbPk21lKwCIimo/ednxzYR+4dP023DNGcpxkQSeSf yxvtgVDe+C5JdYcPjwa8SjLPdUPYO7mf1AZRdFLCDhEPUMn4HeXlcqcnSZCX0Mq17Ijf mwHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yxq3M0BJLFLU33tpG9ZzMGkWRxCbnanEaskRNLIDwEw=; b=ulXbbxChQYHhPom6lU+c5Qu+qcYk39pGB9yu1bvePfSuwBgHdeXgxoWL0xyu0z7gYF 5+DiOiEiOMa0/NvwgXcoCsxtVGRVrTbbIF0g7fqSwK6dVoNjIDv/5x9VUFrApXV4Fj5a hcMTi3tdjKrScIGVTAHRHcfTUoa2493qDmWdYSLu26Ohyfb5WnQj7mOr8ioa6Ir9hEVK xhD3SQ0ju5LOo4HNQSj7+/zOqNrT8Q8R4KbOT/QpHDf8ZJVIfed2utEDANqxBLOA4fxl ArzzDxDR3N85owo7sz+z3GYNmYA9Jc73Uum9sS8K+hSDtFBLXEkApp4RIVK1y1Ve8HPo A54w== X-Gm-Message-State: AHYfb5gBG4DyZkyNmmlPjRwzn0zUpmMMw9G4QyFyvrdg+VKgn2FtBsmF uCxd+GxrULh5aegZX7rd4A== X-Received: by 10.101.85.196 with SMTP id k4mr5488859pgs.150.1502232398588; Tue, 08 Aug 2017 15:46:38 -0700 (PDT) Received: from omlet.jf.intel.com ([192.55.54.45]) by smtp.gmail.com with ESMTPSA id l24sm56129pfi.99.2017.08.08.15.46.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Aug 2017 15:46:37 -0700 (PDT) From: Jason Ekstrand X-Google-Original-From: Jason Ekstrand To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/9] dma-buf/dma-fence: Allow wait_any_timeout without default_wait Date: Tue, 8 Aug 2017 15:46:06 -0700 Message-Id: <1502232369-19753-7-git-send-email-jason.ekstrand@intel.com> X-Mailer: git-send-email 2.5.0.400.gff86faf In-Reply-To: <1502232369-19753-1-git-send-email-jason.ekstrand@intel.com> References: <1502232369-19753-1-git-send-email-jason.ekstrand@intel.com> Cc: Jason Ekstrand , Jason Ekstrand 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-Virus-Scanned: ClamAV using ClamSMTP dma_fence_wait_any_timeout only relies on two things to work correctly: 1) The SIGNALED flag to be set upon fence signal 2) The callback list to get called upon fence signal Both of these are part of the core dma-fence API so it should work fine even with a non-default wait function. Signed-off-by: Jason Ekstrand --- drivers/dma-buf/dma-fence.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 57da14c..1218692 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -501,11 +501,6 @@ dma_fence_wait_any_timeout(struct dma_fence **fences, uint32_t count, for (i = 0; i < count; ++i) { struct dma_fence *fence = fences[i]; - if (fence->ops->wait != dma_fence_default_wait) { - ret = -EINVAL; - goto fence_rm_cb; - } - cb[i].task = current; if (dma_fence_add_callback(fence, &cb[i].base, dma_fence_default_wait_cb)) {