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: 10378491 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 9467960353 for ; Thu, 3 May 2018 14:26:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8335E29194 for ; Thu, 3 May 2018 14:26:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7808029196; Thu, 3 May 2018 14:26:26 +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 2E01029194 for ; Thu, 3 May 2018 14:26:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25DD66E6E5; Thu, 3 May 2018 14:26:16 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9383C6E6CD for ; Thu, 3 May 2018 14:26:14 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id a67so21035376wmf.3 for ; Thu, 03 May 2018 07:26:14 -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=l2eNHU6clMRS61kteTs6jsX1VExATUmOEDmK9WRZUREu/My/Y7pdcvxNqP9eFQIBsR 6ZBNWxILYsYJhilW3VQmV86AC0PjF8Jmbthc2gIF+sCGrkspp/TyB539e6r8UJoWhN0E 13JnYQSf9CJoYzaGM+a7A6WZELoNI5pAgwysqSjS7MWxcVRYnrSPCmuN2+rHtb08Sy8N P3Kucax4itSvx9xciQnKrmgySZuZjtxtnXLJI9Ivw9Yt0dGbrpIQ2Aa3F/ghFLfXmlXf 5zrMlWjnzw0gxxnd44GlbWlhwArfI2uDLhQ0AkirYkwbVuk2EMQmPbmEauxsZdWcIYho OFxw== X-Gm-Message-State: ALQs6tCZAFZqfkLXF5R2KCzd6N4LxzdUeXfZbPjXMCvJYpLRinWPgusJ UxluDZn10n8rFb/vA2DTwxy3gQ== 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 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 Subject: [Intel-gfx] [PATCH 03/15] 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. 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)) {