From patchwork Fri Feb 17 18:35:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9580537 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 800B8600C5 for ; Fri, 17 Feb 2017 18:35:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 722CD28744 for ; Fri, 17 Feb 2017 18:35:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 672D72874F; Fri, 17 Feb 2017 18:35:47 +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=unavailable 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 3BEB428744 for ; Fri, 17 Feb 2017 18:35:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 36FAE6EDA1; Fri, 17 Feb 2017 18:35:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0234A6E031; Fri, 17 Feb 2017 18:35:41 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id r18so3981253wmd.3; Fri, 17 Feb 2017 10:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZYXccuclWt0Blq9ZNgfMs+C2dpe9O5IHB1vJ837fG2o=; b=jWz2uzk+RWUD8odmizvBeIWLjTMZxJq4Edl4Zw+zw1IKMzFNDkrTCBm9Pz38tQiHxP PcDQDIWwu6OyJPOpf7ib/tGuBatSUzg6gskimWyDWYXk7wO2jZP9IdZrU+Qzc1MK6L5H mFDnEVWO2NUQr7JMpypwcLvmkKxpiCJf2Q/TxMQv+ktTdkdOi6BaRDWI6vx5VMiigk83 28XxORovyYgHLLga3OfGvrQRDBO9o+UYxMCLhNcqX6PF4Cl6KNjPoO+cmHFkyPzylJlF ba58GNoQUlBNoa8tGIVwmS0+Ar4E7pYVfFscjxI02GVX4Gf7qZLFxhIYAt3DfNoTwEuq pGng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ZYXccuclWt0Blq9ZNgfMs+C2dpe9O5IHB1vJ837fG2o=; b=k3zBojAV8hIjlz7snUYtA/zBMM10z39qXBwT3EE7Q3/Mr8dhzlHE6yYAgDjejwhVpf XGzZRyIXvoQOKmOxD351+fBivJ9vrVoeQL1JSQCN8qN2hxPVt6c/fjJd6xH+nKBvb9jB Qwahd5ui/c/SIr8ex0kT2UkT7rVIF5pgUpQ+ffCwRAaqFiQdVm8vEZ/D2kipHaba6p87 NF2bBBCqIBceoruKQm4NRKiDf9Hsq0VnR3Nck3jgVHBVk21lGh5j+HKq8JN5+5vz91lS zwNHwLMOTX1cTNtoqWWZRErfLhOKT4TkfFCLt7Ya29ezM00lAr4WIe7rbNOCti9dNoUc cj3g== X-Gm-Message-State: AMke39l7m6Hxw3nyBvbiPGfACL1wZ3ZVOJIc+213pAk+D297gL7PKelB9DTtz/WZY0OLJA== X-Received: by 10.28.102.67 with SMTP id a64mr5429717wmc.140.1487356539710; Fri, 17 Feb 2017 10:35:39 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id 136sm2630154wms.32.2017.02.17.10.35.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 10:35:39 -0800 (PST) From: Chris Wilson To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array Date: Fri, 17 Feb 2017 18:35:36 +0000 Message-Id: <20170217183536.26100-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170217183536.26100-1-chris@chris-wilson.co.uk> References: <20170217183536.26100-1-chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin , Joonas Lahtinen 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 The code currently assumes that all fence arrays it sees are the normal signal-on-all variety, and decomposes the array into its individual fences so that it can extract the native i915 fences. If the fence array is using signal-on-any, we should not decompose as we must not wait on them all, just the first in *that* set. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_gem_request.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c index 2f6cfa47dc61..2ab96c35cc5e 100644 --- a/drivers/gpu/drm/i915/i915_gem_request.c +++ b/drivers/gpu/drm/i915/i915_gem_request.c @@ -696,7 +696,8 @@ i915_gem_request_await_dma_fence(struct drm_i915_gem_request *req, if (dma_fence_is_i915(fence)) return i915_gem_request_await_request(req, to_request(fence)); - if (!dma_fence_is_array(fence)) { + if (!dma_fence_is_array(fence) || + test_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &fence->flags)) { ret = i915_sw_fence_await_dma_fence(&req->submit, fence, I915_FENCE_TIMEOUT, GFP_KERNEL);