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: 10367465 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 8FAFB602DC for ; Fri, 27 Apr 2018 06:17:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8062B284C4 for ; Fri, 27 Apr 2018 06:17:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74A242855D; Fri, 27 Apr 2018 06:17:43 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C2A828385 for ; Fri, 27 Apr 2018 06:17:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755199AbeD0GRh (ORCPT ); Fri, 27 Apr 2018 02:17:37 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:38345 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752348AbeD0GRf (ORCPT ); Fri, 27 Apr 2018 02:17:35 -0400 Received: by mail-wm0-f65.google.com with SMTP id i3so801142wmf.3 for ; Thu, 26 Apr 2018 23:17:34 -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=nyexenZct779fsrWYAEEaC3oRXboxshorc2Di8s856mjosXN6+tu7oJSCqgm0TCG+n hxSj+WQK4DqSvNNEIdocRTsUaf9U+8wXEashHl2Iui7+6ARc8PIKyRt+FmZuKK9mP96p DnldZEekn5cvRk466FEJjkbjH0etoalC8Pi0seRsBZgg4eTF4g+XSWMWcMcvPIuTeey0 7VdlUshi4ecu32KIi71A9oFwvBVqv5/e7fhktlbWlTimZrpIEdpjtCyVloPGfYJVGMfb yvAWbUsMbI5VER7UEfoGnbpZe23GHe46kOCfI/r8hq5CwbeuQEjIhy/+NRcGbcOiaC4K Nmhw== X-Gm-Message-State: ALQs6tBHPzp1Dyo0LQtO+qAkVFgZur0XMUm2H9Lsvk4QuUOKvg9bCOaa QoN5EIn0TrFJ8IF89BUwGjYQHQ== 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 Cc: Intel Graphics Development , Daniel Vetter , Daniel Vetter , Sumit Semwal , Gustavo Padovan , linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher Subject: [PATCH 04/17] dma-fence: Allow wait_any_timeout for all fences 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 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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)) {