From patchwork Thu May 3 14:25:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10378481 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 EDF6660353 for ; Thu, 3 May 2018 14:26:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCCC329194 for ; Thu, 3 May 2018 14:26:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0E3E29196; Thu, 3 May 2018 14:26:19 +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 7680329194 for ; Thu, 3 May 2018 14:26:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751088AbeECO0R (ORCPT ); Thu, 3 May 2018 10:26:17 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:55799 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751111AbeECO0O (ORCPT ); Thu, 3 May 2018 10:26:14 -0400 Received: by mail-wm0-f66.google.com with SMTP id a8so28717292wmg.5 for ; Thu, 03 May 2018 07:26:13 -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=YqzbK6e3oxRewHWMf/n/9zC/5ySj5U6PIC5reJxeImU=; b=ZuRJE5Y6HTEk+xzps9HXQlg39xkA7PBLPvBb/1DmPJbYSgfpurfBjPUt7AvHMxqwl2 REHkRQVzt0vBHL5yZ8d0qa4kWxxycAt27r22bFQjbucXHi8etCFulLgixpcWfODAzWKJ 1ggZGlFhWtdoHWWOm6vUmR3GbeBG2arAHi7uI= 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=YqzbK6e3oxRewHWMf/n/9zC/5ySj5U6PIC5reJxeImU=; b=L8hUtTK5y+wFFQwRjZSXsJ0LABhb/E6RuPI2l6byOrXPbxonsIns6AXSq9TDZik6TX BGtourAbwe8umxXx/xzmnAPwbvvQ8FajczRAOBCrnzaYt5ch7pKSLI/BtqLfC4514sBM 6uW4yKMh4wii3ItjNx8duImcEAOQasIlKa0XLgrAA2maICdD/plNY2iQjNCpvAbAEljo FXvbfBWXvu45GCuSNdjJuYfeoMgKmXLKp1QkK3WJUMBoQ4ETwyjok2senYfWm5CHfpn7 riAHbUdmtWXPYDflTbTopu7fYu+Lud1kLU4HMy7KRXShmyhNbvwIZ6I5a/+OyPbasWw9 1FJQ== X-Gm-Message-State: ALQs6tCAsSzJiMOQ/HBCphw/klEOkBN3i9GevJg96e0claElvlDaTpy/ CJEKlMX7SrQVg8Pi6mLsgfAD3A== X-Google-Smtp-Source: AB8JxZoYUVRLQyJ1wNRvoraB51l6kGtspc7LNo3qjTfOte6tcjjBqvmDe9OHbs/23pzqRo74yEiHiA== X-Received: by 2002:a50:c04e:: with SMTP id u14-v6mr31012005edd.202.1525357573285; Thu, 03 May 2018 07:26:13 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id u5-v6sm8095647edi.79.2018.05.03.07.26.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 May 2018 07:26:12 -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 03/15] dma-fence: Allow wait_any_timeout for all fences Date: Thu, 3 May 2018 16:25:51 +0200 Message-Id: <20180503142603.28513-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180503142603.28513-1-daniel.vetter@ffwll.ch> References: <20180503142603.28513-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. Reviewed-by: Christian König 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)) {