From patchwork Mon Nov 6 12:36:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 13446887 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70CA8C4167B for ; Mon, 6 Nov 2023 12:36:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC26410E2E2; Mon, 6 Nov 2023 12:36:35 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id C6B9A10E06F for ; Mon, 6 Nov 2023 12:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699274191; x=1730810191; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=5CRMsZ/Xo77x8MpOTWT2wIbKnZJOTNjBNZ7D9PYtkWk=; b=RIwViav27W5d1nHH1eH12qd4YkVId7N5UaHmBf95KFT3NZOWcNEwKwbn OblirKTVcQgcpCtGI6ljaw4f+zaxhqkkQs/UwugEe1gL8+37PqFw9Ql8V eqDdCL+8LoBkBCQuG8hl4VYLExVaB2wrSN3uVlt5h2MDx05Qua23OskuT ++AOPgCSbk7eERosGaWpS6lzPx1H9sdfMGkfJznY7lSYo7MLyLx24vmue /YklU2ubHUqF0ApdWzN64pG5kQmGu+RiY+QtjMRPoFNZz2AQREYW81UzN YsI2kAI99ELqCf+DAfVEcwOdV/H9SUXXt1Vomo0vTs9BOn8FjFc0qVY7P A==; X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="374293571" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="374293571" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 04:36:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="906046118" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="906046118" Received: from ajayshan-mobl.ger.corp.intel.com (HELO localhost.localdomain) ([10.213.234.152]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 04:36:30 -0800 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Mon, 6 Nov 2023 12:36:22 +0000 Message-Id: <20231106123625.588659-4-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231106123625.588659-1-tvrtko.ursulin@linux.intel.com> References: <20231106123625.588659-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [CI 3/6] drm/i915: Track page table backing store usage X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" From: Tvrtko Ursulin Account page table backing store against the owning client memory usage stats. Signed-off-by: Tvrtko Ursulin Reviewed-by: Aravind Iddamsetty --- drivers/gpu/drm/i915/gt/intel_gtt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.c b/drivers/gpu/drm/i915/gt/intel_gtt.c index 4fbed27ef0ec..3bef6d0769c6 100644 --- a/drivers/gpu/drm/i915/gt/intel_gtt.c +++ b/drivers/gpu/drm/i915/gt/intel_gtt.c @@ -63,6 +63,9 @@ struct drm_i915_gem_object *alloc_pt_lmem(struct i915_address_space *vm, int sz) if (!IS_ERR(obj)) { obj->base.resv = i915_vm_resv_get(vm); obj->shares_resv_from = vm; + + if (vm->fpriv) + i915_drm_client_add_object(vm->fpriv->client, obj); } return obj; @@ -84,6 +87,9 @@ struct drm_i915_gem_object *alloc_pt_dma(struct i915_address_space *vm, int sz) if (!IS_ERR(obj)) { obj->base.resv = i915_vm_resv_get(vm); obj->shares_resv_from = vm; + + if (vm->fpriv) + i915_drm_client_add_object(vm->fpriv->client, obj); } return obj;