Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	Lukasz Laguna <lukasz.laguna@intel.com>
Subject: [PATCH 09/12] drm/xe/pf: Configure LMTT in MERT
Date: Tue, 21 Oct 2025 22:17:41 -0700	[thread overview]
Message-ID: <20251021-cri-v1-9-bf11e61d9f49@intel.com> (raw)
In-Reply-To: <20251021-cri-v1-0-bf11e61d9f49@intel.com>

From: Lukasz Laguna <lukasz.laguna@intel.com>

On platforms with standalone MERT, the PF driver needs to program LMTT
in MERT's LMEM_CFG register.

While at it, sort the includes in drivers/gpu/drm/xe/xe_lmtt.c.

Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/xe/regs/xe_mert_regs.h | 13 +++++++++++++
 drivers/gpu/drm/xe/xe_lmtt.c           | 12 ++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/regs/xe_mert_regs.h b/drivers/gpu/drm/xe/regs/xe_mert_regs.h
new file mode 100644
index 0000000000000..5b7c15e08747e
--- /dev/null
+++ b/drivers/gpu/drm/xe/regs/xe_mert_regs.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2025 Intel Corporation
+ */
+
+#ifndef _XE_MERT_REGS_H_
+#define _XE_MERT_REGS_H_
+
+#include "regs/xe_reg_defs.h"
+
+#define MERT_LMEM_CFG				XE_REG(0x1448b0)
+
+#endif /* _XE_MERT_REGS_H_ */
diff --git a/drivers/gpu/drm/xe/xe_lmtt.c b/drivers/gpu/drm/xe/xe_lmtt.c
index 4dc1de482eeed..e9f19b2a7b5e1 100644
--- a/drivers/gpu/drm/xe/xe_lmtt.c
+++ b/drivers/gpu/drm/xe/xe_lmtt.c
@@ -8,16 +8,18 @@
 #include <drm/drm_managed.h>
 
 #include "regs/xe_gt_regs.h"
+#include "regs/xe_mert_regs.h"
 
 #include "xe_assert.h"
 #include "xe_bo.h"
-#include "xe_tlb_inval.h"
 #include "xe_lmtt.h"
 #include "xe_map.h"
 #include "xe_mmio.h"
 #include "xe_res_cursor.h"
 #include "xe_sriov.h"
+#include "xe_tile.h"
 #include "xe_tile_sriov_printk.h"
+#include "xe_tlb_inval.h"
 
 /**
  * DOC: Local Memory Translation Table
@@ -196,16 +198,22 @@ static void lmtt_setup_dir_ptr(struct xe_lmtt *lmtt)
 	struct xe_device *xe = tile_to_xe(tile);
 	dma_addr_t offset = xe_bo_main_addr(lmtt->pd->bo, XE_PAGE_SIZE);
 	struct xe_gt *gt;
+	u32 config;
 	u8 id;
 
 	lmtt_debug(lmtt, "DIR offset %pad\n", &offset);
 	lmtt_assert(lmtt, xe_bo_is_vram(lmtt->pd->bo));
 	lmtt_assert(lmtt, IS_ALIGNED(offset, SZ_64K));
 
+	config = LMEM_EN | REG_FIELD_PREP(LMTT_DIR_PTR, offset / SZ_64K);
+
 	for_each_gt_on_tile(gt, tile, id)
 		xe_mmio_write32(&gt->mmio,
 				GRAPHICS_VER(xe) >= 20 ? XE2_LMEM_CFG : LMEM_CFG,
-				LMEM_EN | REG_FIELD_PREP(LMTT_DIR_PTR, offset / SZ_64K));
+				config);
+
+	if (xe_device_has_mert(xe) && xe_tile_is_root(tile))
+		xe_mmio_write32(&tile->mmio, MERT_LMEM_CFG, config);
 }
 
 /**

-- 
2.51.0


  parent reply	other threads:[~2025-10-22  5:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22  5:17 [PATCH 00/12] drm/xe: Add support for Crescent Island Lucas De Marchi
2025-10-22  5:17 ` [PATCH 01/12] drm/xe/cri: Add CRI platform definition Lucas De Marchi
2025-10-22 14:58   ` Shekhar Chauhan
2025-10-22 19:45     ` Lucas De Marchi
2025-10-23 10:57       ` Lucas De Marchi
2025-10-23 11:13         ` Lucas De Marchi
2025-10-22  5:17 ` [PATCH 02/12] topic/for-xe-CI: drm/xe/cri: Define GuC firmware for CRI Lucas De Marchi
2025-10-23 10:33   ` Lucas De Marchi
2025-10-22  5:17 ` [PATCH 03/12] drm/xe/cri: Setup MOCS table Lucas De Marchi
2025-10-22  8:06   ` Vivekanandan, Balasubramani
2025-10-22  5:17 ` [PATCH 04/12] drm/xe/cri: Add new performance limit reasons bits Lucas De Marchi
2025-10-22  6:31   ` [PATCH 4/12] " Raag Jadav
2025-10-22 21:22     ` Lucas De Marchi
2025-10-22  5:17 ` [PATCH 05/12] drm/xe/cri: Add check to verify if CSC is a PCIe endpoint Lucas De Marchi
2025-10-22  5:17 ` [PATCH 06/12] drm/xe/pm: Enable D3cold WAKE# support Lucas De Marchi
2025-10-22  6:35   ` [PATCH 6/12] " Raag Jadav
2025-10-22 19:53     ` Lucas De Marchi
2025-10-22  5:17 ` [PATCH 07/12] drm/xe: Add device flag to indicate standalone MERT Lucas De Marchi
2025-10-28 21:53   ` Dixit, Ashutosh
2025-10-22  5:17 ` [PATCH 08/12] drm/xe/oa/uapi: Expose MERT OA unit Lucas De Marchi
2025-10-22 23:09   ` Umesh Nerlige Ramappa
2025-11-24 21:34     ` Dixit, Ashutosh
2025-10-22  5:17 ` Lucas De Marchi [this message]
2025-10-22  5:17 ` [PATCH 10/12] drm/xe: Handle MERT interrupts Lucas De Marchi
2025-10-22 23:19   ` Matt Roper
2025-10-23 14:42     ` Lucas De Marchi
2025-10-28  9:30       ` Laguna, Lukasz
2025-10-22  5:17 ` [PATCH 11/12] drm/xe/pf: Add TLB invalidation support for MERT Lucas De Marchi
2025-10-22 18:28   ` Matthew Brost
2025-10-23 15:11     ` Lucas De Marchi
2025-10-28  9:33       ` Laguna, Lukasz
2025-10-22  5:17 ` [PATCH 12/12] drm/xe/pf: Handle MERT catastrophic errors Lucas De Marchi
2025-10-22  5:40 ` ✗ CI.checkpatch: warning for drm/xe: Add support for Crescent Island Patchwork
2025-10-22  5:41 ` ✓ CI.KUnit: success " Patchwork
2025-10-22  6:29 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-22  7:56 ` ✗ Xe.CI.Full: failure " 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=20251021-cri-v1-9-bf11e61d9f49@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lukasz.laguna@intel.com \
    /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