From: Lukasz Laguna <lukasz.laguna@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: michal.wajdeczko@intel.com, piotr.piorkowski@intel.com,
lukasz.laguna@intel.com
Subject: [PATCH v2 2/4] drm/xe/pf: Configure LMTT in MERT
Date: Fri, 31 Oct 2025 09:04:59 +0100 [thread overview]
Message-ID: <20251031080501.844-3-lukasz.laguna@intel.com> (raw)
In-Reply-To: <20251031080501.844-1-lukasz.laguna@intel.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 2136 bytes --]
On platforms with standalone MERT, the PF driver needs to program LMTT
in MERT's LMEM_CFG register.
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
drivers/gpu/drm/xe/regs/xe_mert_regs.h | 13 +++++++++++++
drivers/gpu/drm/xe/xe_lmtt.c | 10 +++++++++-
2 files changed, 22 insertions(+), 1 deletion(-)
create mode 100644 drivers/gpu/drm/xe/regs/xe_mert_regs.h
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 000000000000..5b7c15e08747
--- /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 4dc1de482eee..f50c5a4b9edf 100644
--- a/drivers/gpu/drm/xe/xe_lmtt.c
+++ b/drivers/gpu/drm/xe/xe_lmtt.c
@@ -8,6 +8,7 @@
#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"
@@ -17,6 +18,7 @@
#include "xe_mmio.h"
#include "xe_res_cursor.h"
#include "xe_sriov.h"
+#include "xe_tile.h"
#include "xe_tile_sriov_printk.h"
/**
@@ -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(>->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.40.0
next prev parent reply other threads:[~2025-10-31 8:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-31 8:04 [PATCH v2 0/4] PF: Add support for MERT Lukasz Laguna
2025-10-31 8:04 ` [PATCH v2 1/4] drm/xe: Add device flag to indicate standalone MERT Lukasz Laguna
2025-10-31 8:04 ` Lukasz Laguna [this message]
2025-11-24 10:47 ` [PATCH v2 2/4] drm/xe/pf: Configure LMTT in MERT Piotr Piórkowski
2025-10-31 8:05 ` [PATCH v2 3/4] drm/xe/pf: Add TLB invalidation support for MERT Lukasz Laguna
2025-11-24 13:43 ` Piotr Piórkowski
2025-10-31 8:05 ` [PATCH v2 4/4] drm/xe/pf: Handle MERT catastrophic errors Lukasz Laguna
2025-11-24 13:52 ` Piotr Piórkowski
2025-10-31 8:12 ` ✗ CI.checkpatch: warning for PF: Add support for MERT Patchwork
2025-10-31 8:14 ` ✓ CI.KUnit: success " Patchwork
2025-10-31 9:29 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-31 19:25 ` ✓ Xe.CI.Full: " 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=20251031080501.844-3-lukasz.laguna@intel.com \
--to=lukasz.laguna@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@intel.com \
--cc=piotr.piorkowski@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