[PATCH 2/8] drm/xe: Add module parameter for GPU frequency monitoring
S Sebinraj
s.sebinraj at intel.com
Tue Aug 19 06:34:11 UTC 2025
Add gpufreq_monitoring_interval_ms module parameter to configure
the interval for GPU frequency monitoring. The parameter is only
available when CONFIG_DRM_XE_GPUFREQTRACER is enabled.
Default value is 5000ms (5 seconds) with valid range of 100-10000ms.
The parameter can be modified at runtime via sysfs.
Signed-off-by: S Sebinraj <s.sebinraj at intel.com>
---
drivers/gpu/drm/xe/xe_module.c | 12 ++++++++++++
drivers/gpu/drm/xe/xe_module.h | 3 +++
2 files changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_module.c b/drivers/gpu/drm/xe/xe_module.c
index d08338fc3bc1..f5d4f8bca61f 100644
--- a/drivers/gpu/drm/xe/xe_module.c
+++ b/drivers/gpu/drm/xe/xe_module.c
@@ -31,6 +31,7 @@
#define DEFAULT_MAX_VFS_STR "unlimited"
#define DEFAULT_WEDGED_MODE 1
#define DEFAULT_SVM_NOTIFIER_SIZE 512
+#define DEFAULT_GPUFREQ_MONITORING_INTERVAL_MS 5000
struct xe_modparam xe_modparam = {
.probe_display = DEFAULT_PROBE_DISPLAY,
@@ -41,6 +42,9 @@ struct xe_modparam xe_modparam = {
#endif
.wedged_mode = DEFAULT_WEDGED_MODE,
.svm_notifier_size = DEFAULT_SVM_NOTIFIER_SIZE,
+#ifdef CONFIG_DRM_XE_GPUFREQTRACER
+ .gpufreq_monitoring_interval_ms = DEFAULT_GPUFREQ_MONITORING_INTERVAL_MS,
+#endif
/* the rest are 0 by default */
};
@@ -93,6 +97,14 @@ MODULE_PARM_DESC(wedged_mode,
"Module's default policy for the wedged mode (0=never, 1=upon-critical-errors, 2=upon-any-hang "
"[default=" __stringify(DEFAULT_WEDGED_MODE) "])");
+#ifdef CONFIG_DRM_XE_GPUFREQTRACER
+module_param_named(gpufreq_monitoring_interval_ms,
+ xe_modparam.gpufreq_monitoring_interval_ms, uint, 0644);
+MODULE_PARM_DESC(gpufreq_monitoring_interval_ms,
+ "GPU frequency monitoring interval in milliseconds (100-10000, default: "
+ __stringify(DEFAULT_GPUFREQ_MONITORING_INTERVAL_MS) ")");
+#endif
+
static int xe_check_nomodeset(void)
{
if (drm_firmware_drivers_only())
diff --git a/drivers/gpu/drm/xe/xe_module.h b/drivers/gpu/drm/xe/xe_module.h
index 5a3bfea8b7b4..fd60de38d24d 100644
--- a/drivers/gpu/drm/xe/xe_module.h
+++ b/drivers/gpu/drm/xe/xe_module.h
@@ -23,6 +23,9 @@ struct xe_modparam {
#endif
int wedged_mode;
u32 svm_notifier_size;
+#ifdef CONFIG_DRM_XE_GPUFREQTRACER
+ u32 gpufreq_monitoring_interval_ms;
+#endif
};
extern struct xe_modparam xe_modparam;
--
2.34.1
More information about the Intel-xe
mailing list