Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp497203imw; Wed, 13 Jul 2022 02:31:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vWPGP57CyeF48e9vKN5y1N39xM0kGPHinR5r/MxhuwEKJZUn/yx6i+gyuha8z8CbR1+S3B X-Received: by 2002:a17:90a:8c0a:b0:1ef:7c95:3f00 with SMTP id a10-20020a17090a8c0a00b001ef7c953f00mr2794242pjo.180.1657704697877; Wed, 13 Jul 2022 02:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657704697; cv=none; d=google.com; s=arc-20160816; b=FlNzgySe3Hj1pFEE9NAxGNokE0n3HNoEqc7OS3gflg+iiO/n9kSLP54uUb32yLHNKK yIpkL5ZciJ9Bq7f9g3cwnELC5KXPOV5gGSSWoglRoNh4x7X9QYSfMU7w1wG+WNE8o6kl yYuPF6DqvCQC0Qm+U+fX7lyJf4kdQpwdFAlciaJZGmHf/6XULg/1kFxKWZvgCq4md/3o Mw56+QAXInuQavz+L4uUWVLsEgBL8hQZdqTpy9oGjIFQbFeHcWIntOthd3zbpaPkNWh6 ERgQ0Le7upW4INp+qgnhFRGMGdMzYaT2imTbN/RXR2Vd3Rv8PaJ9Fa4nbMyWo9UvaFrT TxCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=YH5rQeu43biXDjdaLmp8vS0Pk/exOwVeiVTX12d2eb4=; b=TP/qG+Thc9/R6T4WdMaINDNwtnQcpqHTstD0go7mhYPmVR0fNarw/oUfAK5tEFfh6W m4IuJlSw3TITgQ9KWYSxStWnFmg5lYZRkNd/kyXNozAEFah5QvAWoWzTYKGqUHtKdSJL 95bVy5YBFPSCar3uo8AKFgH88JRelF/vNC85t0hQ+lF7qK5DAlwC82csJXRmpr37CdAx fyiXFKTRJDxH6xf6EWhpRox6BltEFUqCn1Obcb3ukOxahKzo79wxVvtIbw/t39Ve8DE8 czKsDPDKa6Hyv+slliEZxtyVBA+g2GQeiyyCzQ4CsCCYQhjlK9Q6StB/+Pxoqn9Y7siu CD0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=P7K0y2Z9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x189-20020a6386c6000000b00415ef8c15f1si12067944pgd.486.2022.07.13.02.31.25; Wed, 13 Jul 2022 02:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=P7K0y2Z9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235512AbiGMJa2 (ORCPT + 99 others); Wed, 13 Jul 2022 05:30:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235030AbiGMJaX (ORCPT ); Wed, 13 Jul 2022 05:30:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02D79EEA9C for ; Wed, 13 Jul 2022 02:30:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9081661C63 for ; Wed, 13 Jul 2022 09:30:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E505FC341C8; Wed, 13 Jul 2022 09:30:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657704621; bh=smG9F2RXMNXCU8+/rdRMph25oHjT7Q2WcPhpkWuHDgo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P7K0y2Z9Vs9n9sU15b+DrTXWHH58JYmo2jAunLW/rw5GihE1pJ/RFTReKKJi/f9yG uBpNNO7K7BzKqbIrHuLvMYV6mKtFa0zzNpsjk7VtUWiXwn6NFvKzNKds6GdPY81ODj S/bfgZ4h861narp4RQeYoO7IxDDVMotcyJl3B5ICckeg32oP7jPAyUtSxHO3gjWqsw PfUIfpQpr/EYE2Je0P5IG5lXOcSBwgjOt7J/Ah49rLc+4c1Fmv+FkBdaVH3XI5UCFO d7sT0aUK09aIRAA8huPew1Fb+xwP7ZT4h0Jd+qiEqSgYZ3DyN8XX1zWN6e5s4SWuRw CTqj0DXT8WOSA== Received: from mchehab by mail.kernel.org with local (Exim 4.95) (envelope-from ) id 1oBYhH-0050LU-Lr; Wed, 13 Jul 2022 10:30:19 +0100 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Daniel Vetter , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/21] drm/i915/gt: describe the new tlb parameter at i915_vma_resource Date: Wed, 13 Jul 2022 10:30:04 +0100 Message-Id: <29c9a422328bc7c644dbc1e83a28f09e502d34d6.1657703926.git.mchehab@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org TLB cache invalidation can happen on two different situations: 1. synchronously, at __vma_put_pages(); 2. asynchronously. On the first case, TLB cache invalidation happens inside __vma_put_pages(). So, no need to do it later on. However, on the second case, the pages will keep in memory until __i915_vma_evict() is called. So, we need to store the TLB data at struct i915_vma_resource, in order to do a TLB cache invalidation before allowing userspace to re-use the same memory. So, i915_vma_resource_unbind() has gained a new parameter in order to store the TLB data at the second case. Document it. Signed-off-by: Mauro Carvalho Chehab --- See [PATCH 00/21] at: https://lore.kernel.org/all/cover.1657703926.git.mchehab@kernel.org/ drivers/gpu/drm/i915/i915_vma_resource.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_vma_resource.c b/drivers/gpu/drm/i915/i915_vma_resource.c index 5a67995ea5fe..4fe09ea0a825 100644 --- a/drivers/gpu/drm/i915/i915_vma_resource.c +++ b/drivers/gpu/drm/i915/i915_vma_resource.c @@ -216,6 +216,10 @@ i915_vma_resource_fence_notify(struct i915_sw_fence *fence, /** * i915_vma_resource_unbind - Unbind a vma resource * @vma_res: The vma resource to unbind. + * @tlb: pointer to vma->obj->mm.tlb associated with the resource + * to be stored at vma_res->tlb. When not-NULL, it will be used + * to do TLB cache invalidation before freeing a VMA resource. + * used only for async unbind. * * At this point this function does little more than publish a fence that * signals immediately unless signaling is held back. -- 2.36.1