From patchwork Fri Apr 27 06:17:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10367489 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 6976B602DC for ; Fri, 27 Apr 2018 06:18:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59F9E28458 for ; Fri, 27 Apr 2018 06:18:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EA4129301; Fri, 27 Apr 2018 06:18:11 +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=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 C9D2E28458 for ; Fri, 27 Apr 2018 06:18:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B76396E7F7; Fri, 27 Apr 2018 06:17:53 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 70C266E1F0 for ; Fri, 27 Apr 2018 06:17:35 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id o78so822120wmg.0 for ; Thu, 26 Apr 2018 23:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pHNo+t9EBQXFlbLQdr5owRTGoMzfjUcs1X+jNGkQxH8=; b=QULqd0aEa3OornAIXgdL3HLSkbWPaNIub4gYww+Ba6PH2a5QZ7COlTj7Q4pnYsZj8j JtPSx4eHyCVnC+R8TJpBPuilN9r0gySBfgD8ldAZ1MlnCu93BcN38bkJ2QMH5DYfbb6L 1DJfk1oJPxd7OuNTDhy+5IMTYVBTX5r17se5g= 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:mime-version:content-transfer-encoding; bh=pHNo+t9EBQXFlbLQdr5owRTGoMzfjUcs1X+jNGkQxH8=; b=P+TSoEu12qFac6WHf+pttDTzvZdq+sDyVh3/u+ri/YxiwBAgK3KcRLhQXLbrZzBFUg +w4A1ffJ/lfqFSFazPjeBlGO1a2Er6xMY1MJAsexalWPs7qjRG1CbAYv2Du7CEkxWzF5 oj4rFkFMk5w4fzqCYJmipJVXWy4zzTAfGQslwfVm/JUeqloQI8oPrFRmPJm159l9VXkR XKM3w7h59RcwtJ7p7vVeKLdhHdBqU6R69LiAZmOQg3fltIPtx5UfpNbwl7bl6zvSgFQZ thIAuQN4taU7sW0zjfNNtRNUwAcp+Lsv4+Jw6PuwX3GJmcxWDeWvxHtDM27+6NSQ3q4y vWJQ== X-Gm-Message-State: ALQs6tDPsWoi3J80PwPIa19ZbFQMnjy/rPlkd0bIC8+2ALjiBjq+UObY KMXZHq59g9Hy2+XkCxMDqiWwkA== X-Google-Smtp-Source: AB8JxZr+qkZ+X6d4MaPBPQtXTq8cVVQl6hNMi7/LqwL17KlwGCdRPR7uKW3RnHk7z9Rby92HzGrAZw== X-Received: by 2002:a50:9874:: with SMTP id h49-v6mr1777016edb.150.1524809854173; Thu, 26 Apr 2018 23:17:34 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id r15-v6sm468897edq.40.2018.04.26.23.17.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 23:17:33 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Fri, 27 Apr 2018 08:17:11 +0200 Message-Id: <20180427061724.28497-5-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427061724.28497-1-daniel.vetter@ffwll.ch> References: <20180427061724.28497-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 04/17] dma-fence: Allow wait_any_timeout for all fences X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel Graphics Development , =?UTF-8?q?Christian=20K=C3=B6nig?= , linaro-mm-sig@lists.linaro.org, Daniel Vetter , Alex Deucher , Daniel Vetter , Sumit Semwal , linux-media@vger.kernel.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP When this was introduced in commit a519435a96597d8cd96123246fea4ae5a6c90b02 Author: Christian König Date: Tue Oct 20 16:34:16 2015 +0200 dma-buf/fence: add fence_wait_any_timeout function v2 there was a restriction added that this only works if the dma-fence uses the dma_fence_default_wait hook. Which works for amdgpu, which is the only caller. Well, until you share some buffers with e.g. i915, then you get an -EINVAL. But there's really no reason for this, because all drivers must support callbacks. The special ->wait hook is only as an optimization; if the driver needs to create a worker thread for an active callback, then it can avoid to do that if it knows that there's a process context available already. So ->wait is just an optimization, just using the logic in dma_fence_default_wait() should work for all drivers. Let's remove this restriction. Signed-off-by: Daniel Vetter Cc: Sumit Semwal Cc: Gustavo Padovan Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Cc: Christian König Cc: Alex Deucher --- 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 7b5b40d6b70e..59049375bd19 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -503,11 +503,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)) {