Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tejas Upadhyay <tejas.upadhyay@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [Intel-xe] [PATCH V2 6/7] drm/xe: Account ring buffer and context state storage
Date: Tue, 12 Sep 2023 17:22:38 +0530	[thread overview]
Message-ID: <20230912115239.3554341-7-tejas.upadhyay@intel.com> (raw)
In-Reply-To: <20230912115239.3554341-1-tejas.upadhyay@intel.com>

Account ring buffers and logical context space against the owning client
memory usage stats.

Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
---
 drivers/gpu/drm/xe/xe_lrc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c
index 6f899b6a4877..8518cccdf4e1 100644
--- a/drivers/gpu/drm/xe/xe_lrc.c
+++ b/drivers/gpu/drm/xe/xe_lrc.c
@@ -12,6 +12,7 @@
 #include "regs/xe_regs.h"
 #include "xe_bo.h"
 #include "xe_device.h"
+#include "xe_drm_client.h"
 #include "xe_exec_queue_types.h"
 #include "xe_gt.h"
 #include "xe_hw_fence.h"
@@ -739,9 +740,13 @@ int xe_lrc_init(struct xe_lrc *lrc, struct xe_hw_engine *hwe,
 		kfree(init_data);
 	}
 
-	if (vm)
+	if (vm) {
 		xe_lrc_set_ppgtt(lrc, vm);
 
+		if (vm->xef)
+			xe_drm_client_add_bo(vm->xef->client, lrc->bo);
+	}
+
 	xe_lrc_write_ctx_reg(lrc, CTX_RING_START, __xe_lrc_ring_ggtt_addr(lrc));
 	xe_lrc_write_ctx_reg(lrc, CTX_RING_HEAD, 0);
 	xe_lrc_write_ctx_reg(lrc, CTX_RING_TAIL, lrc->ring.tail);
-- 
2.25.1


  parent reply	other threads:[~2023-09-12 11:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 11:52 [Intel-xe] [PATCH V2 0/7] drm/xe: fdinfo memory stats Tejas Upadhyay
2023-09-12 11:52 ` [Intel-xe] [PATCH V2 1/7] drm/xe: Add drm-client infrastructure Tejas Upadhyay
2023-09-12 11:52 ` [Intel-xe] [PATCH V2 2/7] drm/xe: Interface xe drm client with fdinfo interface Tejas Upadhyay
2023-09-12 11:52 ` [Intel-xe] [PATCH V2 3/7] drm/xe: Add tracking support for bos per client Tejas Upadhyay
2023-09-13  8:39   ` Ghimiray, Himal Prasad
2023-09-12 11:52 ` [Intel-xe] [PATCH V2 4/7] drm/xe: Record each drm client with its VM Tejas Upadhyay
2023-09-13  8:58   ` Ghimiray, Himal Prasad
2023-09-12 11:52 ` [Intel-xe] [PATCH V2 5/7] drm/xe: Track page table memory usage for client Tejas Upadhyay
2023-09-13  8:38   ` Ghimiray, Himal Prasad
2023-09-12 11:52 ` Tejas Upadhyay [this message]
2023-09-12 11:52 ` [Intel-xe] [PATCH V2 7/7] drm/xe: Implement fdinfo memory stats printing Tejas Upadhyay
2023-09-12 12:06 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: fdinfo memory stats (rev2) Patchwork
2023-09-12 12:07 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-09-12 12:08 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-09-12 12:15 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-09-12 12:15 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-09-12 12:17 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-09-12 12:49 ` [Intel-xe] ✓ CI.BAT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230912115239.3554341-7-tejas.upadhyay@intel.com \
    --to=tejas.upadhyay@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox