From: Matt Roper <matthew.d.roper@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Matt Roper <matthew.d.roper@intel.com>
Subject: [PATCH 07/10] drm/xe: Move GFX_MODE programming to RTP
Date: Thu, 23 Apr 2026 15:48:54 -0700 [thread overview]
Message-ID: <20260423-engine-setup-v1-7-baa94014e3e5@intel.com> (raw)
In-Reply-To: <20260423-engine-setup-v1-0-baa94014e3e5@intel.com>
The write GFX_MODE to disable engine "legacy mode" and to enable MSI-X
support was unnecessarily open-coded in xe_hw_engine_enable_ring();
it's preferable to do such programming in the engine_entries[] RTP table
since gets reflected/verified in debugfs, and will also automatically
ensure that the register is properly saved/restored around engine
resets. This also helps consolidate common logic that was duplicated
between the main driver initialization path and the dead-code execlist
initialization path.
This also allows us to drop GFX_MODE from the list of extra registers to
be added to the GuC ADS' save-restore list since all registers on the
RTP table are added automatically.
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
drivers/gpu/drm/xe/xe_execlist.c | 5 -----
drivers/gpu/drm/xe/xe_guc_ads.c | 1 -
drivers/gpu/drm/xe/xe_hw_engine.c | 16 ++++++++++------
drivers/gpu/drm/xe/xe_rtp.c | 8 ++++++++
drivers/gpu/drm/xe/xe_rtp.h | 12 ++++++++++++
5 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_execlist.c b/drivers/gpu/drm/xe/xe_execlist.c
index 337b9b4e8b4a..9fb99c038ea8 100644
--- a/drivers/gpu/drm/xe/xe_execlist.c
+++ b/drivers/gpu/drm/xe/xe_execlist.c
@@ -47,7 +47,6 @@ static void __start_lrc(struct xe_hw_engine *hwe, struct xe_lrc *lrc,
struct xe_mmio *mmio = >->mmio;
struct xe_device *xe = gt_to_xe(gt);
u64 lrc_desc;
- u32 ring_mode = REG_MASKED_FIELD_ENABLE(GFX_DISABLE_LEGACY_MODE);
lrc_desc = xe_lrc_descriptor(lrc);
@@ -78,10 +77,6 @@ static void __start_lrc(struct xe_hw_engine *hwe, struct xe_lrc *lrc,
xe_bo_ggtt_addr(hwe->hwsp));
xe_mmio_read32(mmio, RING_HWS_PGA(hwe->mmio_base));
- if (xe_device_has_msix(gt_to_xe(hwe->gt)))
- ring_mode |= REG_MASKED_FIELD_ENABLE(GFX_MSIX_INTERRUPT_ENABLE);
- xe_mmio_write32(mmio, GFX_MODE(hwe->mmio_base), ring_mode);
-
xe_mmio_write32(mmio, RING_EXECLIST_SQ_CONTENTS_LO(hwe->mmio_base),
lower_32_bits(lrc_desc));
xe_mmio_write32(mmio, RING_EXECLIST_SQ_CONTENTS_HI(hwe->mmio_base),
diff --git a/drivers/gpu/drm/xe/xe_guc_ads.c b/drivers/gpu/drm/xe/xe_guc_ads.c
index b403ee0b5e74..ce651da6f318 100644
--- a/drivers/gpu/drm/xe/xe_guc_ads.c
+++ b/drivers/gpu/drm/xe/xe_guc_ads.c
@@ -745,7 +745,6 @@ static unsigned int guc_mmio_regset_write(struct xe_guc_ads *ads,
struct xe_reg reg;
bool skip;
} *e, extra_regs[] = {
- { .reg = GFX_MODE(hwe->mmio_base), },
{ .reg = RING_HWS_PGA(hwe->mmio_base), },
{ .reg = RING_IMR(hwe->mmio_base), },
{ .reg = CCS_MODE,
diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
index d28f50a64d88..8d54f943f507 100644
--- a/drivers/gpu/drm/xe/xe_hw_engine.c
+++ b/drivers/gpu/drm/xe/xe_hw_engine.c
@@ -325,14 +325,8 @@ u32 xe_hw_engine_mmio_read32(struct xe_hw_engine *hwe, struct xe_reg reg)
void xe_hw_engine_enable_ring(struct xe_hw_engine *hwe)
{
- u32 ring_mode = REG_MASKED_FIELD_ENABLE(GFX_DISABLE_LEGACY_MODE);
-
xe_hw_engine_mmio_write32(hwe, RING_HWS_PGA(0),
xe_bo_ggtt_addr(hwe->hwsp));
-
- if (xe_device_has_msix(gt_to_xe(hwe->gt)))
- ring_mode |= REG_MASKED_FIELD_ENABLE(GFX_MSIX_INTERRUPT_ENABLE);
- xe_hw_engine_mmio_write32(hwe, GFX_MODE(0), ring_mode);
xe_hw_engine_mmio_write32(hwe, RING_MI_MODE(0),
REG_MASKED_FIELD_DISABLE(STOP_RING));
xe_hw_engine_mmio_read32(hwe, RING_MI_MODE(0));
@@ -441,6 +435,11 @@ hw_engine_setup_default_state(struct xe_hw_engine *hwe)
XE_RTP_ACTIONS(SET(RING_HWSTAM(0), ~0x0,
XE_RTP_ACTION_FLAG(ENGINE_BASE)))
},
+ { XE_RTP_NAME("Disable engine 'legacy' mode"),
+ XE_RTP_RULES(FUNC(xe_rtp_match_always)),
+ XE_RTP_ACTIONS(SET(GFX_MODE(0), GFX_DISABLE_LEGACY_MODE,
+ XE_RTP_ACTION_FLAG(ENGINE_BASE)))
+ },
/*
* To allow the GSC engine to go idle on MTL we need to enable
* idle messaging and set the hysteresis value (we use 0xA=5us
@@ -473,6 +472,11 @@ hw_engine_setup_default_state(struct xe_hw_engine *hwe)
XE_RTP_ACTIONS(FIELD_SET(RCU_MODE, RCU_MODE_FIXED_SLICE_CCS_MODE,
RCU_MODE_FIXED_SLICE_CCS_MODE))
},
+ { XE_RTP_NAME("Enable MSI-X interrupt support"),
+ XE_RTP_RULES(FUNC(xe_rtp_match_always)),
+ XE_RTP_ACTIONS(SET(GFX_MODE(0), GFX_MSIX_INTERRUPT_ENABLE,
+ XE_RTP_ACTION_FLAG(ENGINE_BASE)))
+ },
};
xe_rtp_process_to_sr(&ctx, engine_entries, ARRAY_SIZE(engine_entries),
diff --git a/drivers/gpu/drm/xe/xe_rtp.c b/drivers/gpu/drm/xe/xe_rtp.c
index 728933a1c34f..1a4dcbbbc176 100644
--- a/drivers/gpu/drm/xe/xe_rtp.c
+++ b/drivers/gpu/drm/xe/xe_rtp.c
@@ -10,6 +10,7 @@
#include <uapi/drm/xe_drm.h>
#include "xe_configfs.h"
+#include "xe_device.h"
#include "xe_gt.h"
#include "xe_gt_topology.h"
#include "xe_reg_sr.h"
@@ -404,3 +405,10 @@ bool xe_rtp_match_has_flat_ccs(const struct xe_device *xe,
{
return xe->info.has_flat_ccs;
}
+
+bool xe_rtp_match_has_msix(const struct xe_device *xe,
+ const struct xe_gt *gt,
+ const struct xe_hw_engine *hwe)
+{
+ return xe_device_has_msix(xe);
+}
diff --git a/drivers/gpu/drm/xe/xe_rtp.h b/drivers/gpu/drm/xe/xe_rtp.h
index d058a629cd3e..562082b18d7b 100644
--- a/drivers/gpu/drm/xe/xe_rtp.h
+++ b/drivers/gpu/drm/xe/xe_rtp.h
@@ -536,4 +536,16 @@ bool xe_rtp_match_has_flat_ccs(const struct xe_device *xe,
const struct xe_gt *gt,
const struct xe_hw_engine *hwe);
+/**
+ * xe_rtp_match_has_msix - Match when platform has MSI-X
+ * @xe: Device structure
+ * @gt: GT structure
+ * @hwe: Engine instance
+ *
+ * Returns: true if platform has MSI-X interrupt support
+ */
+bool xe_rtp_match_has_msix(const struct xe_device *xe,
+ const struct xe_gt *gt,
+ const struct xe_hw_engine *hwe);
+
#endif
--
2.53.0
next prev parent reply other threads:[~2026-04-23 22:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 22:48 [PATCH 00/10] Engine initialization cleanup Matt Roper
2026-04-23 22:48 ` [PATCH 01/10] drm/xe: Move CCS enablement to engine setup RTP Matt Roper
2026-04-24 19:21 ` Matt Roper
2026-04-23 22:48 ` [PATCH 02/10] drm/xe/rtp: Add "always true" match function Matt Roper
2026-04-24 17:17 ` Lin, Shuicheng
2026-04-23 22:48 ` [PATCH 03/10] drm/xe: Stop programming BLIT_CCTL on Xe2 and later platforms Matt Roper
2026-04-23 22:48 ` [PATCH 04/10] drm/xe: Move HWSTAM programming to RTP Matt Roper
2026-04-24 18:15 ` Lin, Shuicheng
2026-04-23 22:48 ` [PATCH 05/10] drm/xe: Fix name and definition of GFX_MODE register Matt Roper
2026-04-23 22:48 ` [PATCH 06/10] drm/xe: Const-ify parameters to xe_device_has_* functions Matt Roper
2026-04-24 7:27 ` Michal Wajdeczko
2026-04-23 22:48 ` Matt Roper [this message]
2026-04-24 17:24 ` [PATCH 07/10] drm/xe: Move GFX_MODE programming to RTP Lin, Shuicheng
2026-04-23 22:48 ` [PATCH 08/10] drm/xe: Drop unnecessary STOP_RING clearing Matt Roper
2026-04-23 22:48 ` [PATCH 09/10] drm/xe: Drop xe_hw_engine_mmio_write32() Matt Roper
2026-04-24 17:06 ` Lin, Shuicheng
2026-04-23 22:48 ` [PATCH 10/10] drm/xe: Mark BCS engines as belonging to the GT forcewake domain Matt Roper
2026-04-24 16:46 ` Lin, Shuicheng
2026-04-23 22:56 ` ✓ CI.KUnit: success for Engine initialization cleanup Patchwork
2026-04-23 23:44 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-04-24 5:34 ` ✓ Xe.CI.FULL: success " 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=20260423-engine-setup-v1-7-baa94014e3e5@intel.com \
--to=matthew.d.roper@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.