From: Stuart Summers <stuart.summers@intel.com>
Cc: intel-xe@lists.freedesktop.org, rodrigo.vivi@intel.com,
matthew.brost@intel.com, umesh.nerlige.ramappa@intel.com,
gustavo.sousa@intel.com, matthew.d.roper@intel.com,
daniele.ceraolospurio@intel.com, shuicheng.lin@intel.com,
Stuart Summers <stuart.summers@intel.com>
Subject: [PATCH 16/16] drm/xe: Add enable_media module parameter
Date: Thu, 24 Sep 2026 23:01:35 +0000 [thread overview]
Message-ID: <20260924230120.389685-34-stuart.summers@intel.com> (raw)
In-Reply-To: <20260924230120.389685-18-stuart.summers@intel.com>
The gt_types_allowed configfs attribute is debug-only, so provide a
supported way to disable the media GT on production builds. The
modparam takes precedence over configfs so a single knob is enough to
guarantee the media GT is left alone.
Signed-off-by: Stuart Summers <stuart.summers@intel.com>
Assisted-by: Copilot:claude-opus-5
---
drivers/gpu/drm/xe/xe_configfs_debug.c | 3 +++
drivers/gpu/drm/xe/xe_defaults.h | 1 +
drivers/gpu/drm/xe/xe_module.c | 6 ++++++
drivers/gpu/drm/xe/xe_module.h | 1 +
drivers/gpu/drm/xe/xe_pci.c | 19 ++++++++++++++++---
5 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_configfs_debug.c b/drivers/gpu/drm/xe/xe_configfs_debug.c
index aa8b73cb2a64..e6a0b1f960bc 100644
--- a/drivers/gpu/drm/xe/xe_configfs_debug.c
+++ b/drivers/gpu/drm/xe/xe_configfs_debug.c
@@ -184,6 +184,9 @@
* will always return one GT type per line. "primary" and "media" are the
* GT type names supported by this interface.
*
+ * Note that the ``enable_media=0`` module parameter takes precedence over
+ * this attribute: it disables the media GT even if "media" is listed here.
+ *
* This attribute can only be set before binding to the device.
*
* Examples:
diff --git a/drivers/gpu/drm/xe/xe_defaults.h b/drivers/gpu/drm/xe/xe_defaults.h
index 20292e682bf9..fdb12ebfa4e4 100644
--- a/drivers/gpu/drm/xe/xe_defaults.h
+++ b/drivers/gpu/drm/xe/xe_defaults.h
@@ -18,6 +18,7 @@
/* Sentinel value for guc_log_level configfs: not set, fall back to module param */
#define XE_GUC_LOG_LEVEL_UNSET -1
+#define XE_DEFAULT_ENABLE_MEDIA true
#define XE_DEFAULT_PROBE_DISPLAY IS_ENABLED(CONFIG_DRM_XE_DISPLAY)
#define XE_DEFAULT_VRAM_BAR_SIZE 0
#define XE_DEFAULT_FORCE_PROBE CONFIG_DRM_XE_FORCE_PROBE
diff --git a/drivers/gpu/drm/xe/xe_module.c b/drivers/gpu/drm/xe/xe_module.c
index 4bc28dfc1992..17a8becae24f 100644
--- a/drivers/gpu/drm/xe/xe_module.c
+++ b/drivers/gpu/drm/xe/xe_module.c
@@ -22,6 +22,7 @@
#include "xe_sched_job.h"
struct xe_modparam xe_modparam = {
+ .enable_media = XE_DEFAULT_ENABLE_MEDIA,
.probe_display = XE_DEFAULT_PROBE_DISPLAY,
.guc_log_level = XE_DEFAULT_GUC_LOG_LEVEL,
.force_probe = XE_DEFAULT_FORCE_PROBE,
@@ -38,6 +39,11 @@ module_param_named(svm_notifier_size, xe_modparam.svm_notifier_size, uint, 0600)
MODULE_PARM_DESC(svm_notifier_size, "Set the svm notifier size in MiB, must be power of 2 "
"[default=" __stringify(XE_DEFAULT_SVM_NOTIFIER_SIZE) "]");
+module_param_named(enable_media, xe_modparam.enable_media, bool, 0444);
+MODULE_PARM_DESC(enable_media, "Enable the media GT, when present. Disabling overrides any "
+ "media GT selected via the gt_types_allowed configfs attribute "
+ "[default=" __stringify(XE_DEFAULT_ENABLE_MEDIA) "])");
+
#if IS_ENABLED(CONFIG_DRM_XE_DISPLAY)
module_param_named(probe_display, xe_modparam.probe_display, bool, 0444);
MODULE_PARM_DESC(probe_display, "Probe display HW, otherwise it's left untouched "
diff --git a/drivers/gpu/drm/xe/xe_module.h b/drivers/gpu/drm/xe/xe_module.h
index 6272d9e41207..b10010e0a007 100644
--- a/drivers/gpu/drm/xe/xe_module.h
+++ b/drivers/gpu/drm/xe/xe_module.h
@@ -12,6 +12,7 @@ struct work_struct;
/* Module modprobe variables */
struct xe_modparam {
+ bool enable_media;
bool probe_display;
int force_vram_bar_size;
int guc_log_level;
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index 1c29708276b8..72a21ebab9d6 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -610,6 +610,19 @@ enum xe_gmdid_type {
GMDID_MEDIA
};
+/*
+ * The media GT is usable only if both the enable_media modparam and the
+ * gt_types_allowed configfs attribute allow it; the modparam takes
+ * precedence and disables the media GT regardless of the configfs setting.
+ */
+static bool media_gt_allowed(struct xe_device *xe)
+{
+ if (!xe_modparam.enable_media)
+ return false;
+
+ return xe_configfs_media_gt_allowed(to_pci_dev(xe->drm.dev));
+}
+
static int read_gmdid(struct xe_device *xe, enum xe_gmdid_type type, u32 *ver, u32 *revid)
{
struct xe_mmio *mmio = xe_root_tile_mmio(xe);
@@ -631,7 +644,7 @@ static int read_gmdid(struct xe_device *xe, enum xe_gmdid_type type, u32 *ver, u
int err;
/* Don't try to read media ver if media GT is not allowed */
- if (type == GMDID_MEDIA && !xe_configfs_media_gt_allowed(to_pci_dev(xe->drm.dev))) {
+ if (type == GMDID_MEDIA && !media_gt_allowed(xe)) {
*ver = *revid = 0;
return 0;
}
@@ -924,8 +937,8 @@ static struct xe_gt *alloc_media_gt(struct xe_tile *tile,
struct xe_device *xe = tile_to_xe(tile);
struct xe_gt *gt;
- if (!xe_configfs_media_gt_allowed(to_pci_dev(xe->drm.dev))) {
- xe_tile_info(tile, "Media GT disabled via configfs\n");
+ if (!media_gt_allowed(xe)) {
+ xe_tile_info(tile, "Media GT disabled\n");
return NULL;
}
--
2.43.0
next prev parent reply other threads:[~2026-09-24 23:01 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 23:01 [PATCH 00/16] Add new debug infrastructure for configfs Stuart Summers
2026-09-24 23:01 ` [PATCH 01/16] drm/xe: Guard configfs attribute reads in getters Stuart Summers
2026-09-24 23:01 ` [PATCH 02/16] drm/xe/configfs: Fix out-of-bounds read in parse_wa_bb_lines() Stuart Summers
2026-09-24 23:01 ` [PATCH 03/16] drm/xe/configfs: Copy wa_bb out under the configfs lock Stuart Summers
2026-09-24 23:01 ` [PATCH 04/16] drm/xe: Require CONFIGFS_FS Stuart Summers
2026-09-25 23:16 ` Matt Roper
2026-09-28 16:46 ` Summers, Stuart
2026-09-24 23:01 ` [PATCH 05/16] drm/xe: Invert vram_page_offline configfs attribute Stuart Summers
2026-09-24 23:01 ` [PATCH 06/16] drm/xe: Make survivability_mode configfs attribute a bitmap Stuart Summers
2026-09-24 23:01 ` [PATCH 07/16] drm/xe: Sort xe_config_device fields Stuart Summers
2026-09-24 23:01 ` [PATCH 08/16] drm/xe: Split out configfs data structures Stuart Summers
2026-09-24 23:01 ` [PATCH 09/16] drm/xe: Add a new debug focused configfs group Stuart Summers
2026-09-24 23:01 ` [PATCH 10/16] drm/xe: Move debug configfs entries to xe_configfs_debug.c Stuart Summers
2026-09-24 23:01 ` [PATCH 11/16] drm/xe/guc: Add configfs support for guc_log_level Stuart Summers
2026-09-24 23:01 ` [PATCH 12/16] drm/xe/guc: Add support for NPK as a GuC log target Stuart Summers
2026-09-24 23:01 ` [PATCH 13/16] drm/xe: Add infrastructure for debug configfs parameters Stuart Summers
2026-09-24 23:01 ` [PATCH 14/16] drm/xe: Migrate existing debug configfs entries to params infrastructure Stuart Summers
2026-09-24 23:01 ` [PATCH 15/16] drm/xe: Taint kernel when debug configfs parameters are set Stuart Summers
2026-09-24 23:01 ` Stuart Summers [this message]
2026-09-24 23:08 ` ✗ CI.checkpatch: warning for Add new debug infrastructure for configfs (rev8) Patchwork
2026-09-24 23:10 ` ✓ CI.KUnit: success " Patchwork
2026-09-24 23:27 ` ✗ CI.checksparse: warning " Patchwork
2026-09-25 0:28 ` ✓ Xe.CI.BAT: success " Patchwork
2026-09-25 13:34 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-28 3:34 ` [PATCH 00/16] Add new debug infrastructure for configfs Matthew Brost
2026-09-28 17:07 ` Summers, Stuart
2026-09-28 19:20 ` Rodrigo Vivi
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=20260924230120.389685-34-stuart.summers@intel.com \
--to=stuart.summers@intel.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=gustavo.sousa@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=shuicheng.lin@intel.com \
--cc=umesh.nerlige.ramappa@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