From patchwork Fri Nov 2 09:15:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10665199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0FBA317D5 for ; Fri, 2 Nov 2018 09:15:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1BF42BA63 for ; Fri, 2 Nov 2018 09:15:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E63D12BA84; Fri, 2 Nov 2018 09:15:56 +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.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 A217D2BA63 for ; Fri, 2 Nov 2018 09:15:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE6BF6E55A; Fri, 2 Nov 2018 09:15:55 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 05CDC6E542 for ; Fri, 2 Nov 2018 09:15:53 +0000 (UTC) Received: by mail-ed1-x542.google.com with SMTP id y20-v6so1268907eds.10 for ; Fri, 02 Nov 2018 02:15:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q3IDMIBRwheka09D/N0RHTebGGKal8W73vQfBiBemM4=; b=q4UhqD4qKA3WkCZjKmI3dZvFQ+OcqWuOrHyuA2OeyCrphxIqY+RpA4Xihb/XYe8DQL IDCCXzqylA8lYp4Dek4XGNzH4z1IBvQ2nYT6uVTGay0dGDRAt4zR9icjElwjSQnjKgwX 01L4tDU/C53xbcGulgu7StMy8YaSyZ7VkHgI92Q7Kn1Vi63VRHncSwY9wcyWfkCdxr2x 5h2fel82ZoymbZ85lQ2mzcAyezM8/xPaAPZulzP9mkgVAlIIjZLtXgevGwEVSN3AxwcZ Xxzk+GXdaQvTJewysyDF7dGt1SAmvNGn20Kx8fjr77XTxG2kr8EfueShHK/KX7q3xMyk cE1w== X-Gm-Message-State: AGRZ1gK5J+epXqNUCfDWR+P/Ej8CjRQ4lzh+IgJq9UdV+NT/RUgA9sKR 92e6FZABAGhfkKNuSfz+daGL/QUjNBo= X-Google-Smtp-Source: AJdET5cmhtHZKLI/FYACzb0sYyERCgL1ENCAz6WZAKz1W1gEPMIGW723mILxBTFVtKZgIYT4mRKcyg== X-Received: by 2002:a50:9665:: with SMTP id y92-v6mr8165305eda.122.1541150151393; Fri, 02 Nov 2018 02:15:51 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id p19-v6sm5658103ejw.69.2018.11.02.02.15.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 02:15:50 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Fri, 2 Nov 2018 10:15:29 +0100 Message-Id: <20181102091531.7775-10-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102091531.7775-1-daniel.vetter@ffwll.ch> References: <20181102091531.7775-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 10/12] drm/i915: Annotate dma_fence waits 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP i915_request_wait is simply our i915-optimized version of dma_fence_wait. They both use the exact same code. To help lockdep discovering all the dependencies, annotate it. Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: intel-gfx@lists.freedesktop.org Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_request.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index 71107540581d..6b9722782d12 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c @@ -30,6 +30,10 @@ #include "i915_drv.h" +static long __i915_request_wait(struct i915_request *rq, + unsigned int flags, + long timeout); + static const char *i915_fence_get_driver_name(struct dma_fence *fence) { return "i915"; @@ -66,7 +70,7 @@ static signed long i915_fence_wait(struct dma_fence *fence, bool interruptible, signed long timeout) { - return i915_request_wait(to_request(fence), interruptible, timeout); + return __i915_request_wait(to_request(fence), interruptible, timeout); } static void i915_fence_release(struct dma_fence *fence) @@ -1201,6 +1205,19 @@ static bool __i915_wait_request_check_and_reset(struct i915_request *request) long i915_request_wait(struct i915_request *rq, unsigned int flags, long timeout) +{ + long ret; + + dma_fence_wait_acquire(); + ret = __i915_request_wait(rq, flags, timeout); + dma_fence_wait_release(); + + return ret; +} + +static long __i915_request_wait(struct i915_request *rq, + unsigned int flags, + long timeout) { const int state = flags & I915_WAIT_INTERRUPTIBLE ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE;