[PATCH v2 4/5] drm/i915/reset: Add "display_reset_count" debugfs file

Ville Syrjala
2026-04-14T14:23:15Z

Expose the number of display resets performed in a new
"display_reset_count" debugfs file. kms_busy can use this to
confirm that the kernel actually took the full display reset path.

v2: Give the file an "intel_" namespace (Jani)

Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Testcase: igt/kms_busy/*-with-reset
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_display_core.h | 4 ++++
drivers/gpu/drm/i915/display/intel_display_debugfs.c | 2 ++
drivers/gpu/drm/i915/display/intel_display_reset.c | 10 ++++++++++
drivers/gpu/drm/i915/display/intel_display_reset.h | 2 ++
drivers/gpu/drm/xe/Makefile | 1 +
5 files changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
index 38296a38372c..c5a07090cba6 100644
--- a/drivers/gpu/drm/i915/display/intel_display_core.h
+++ b/drivers/gpu/drm/i915/display/intel_display_core.h
@@ -559,6 +559,10 @@ struct intel_display {
unsigned long mask;
} quirks;

+ struct {
+ u32 count;
+ } reset;
+
struct {
/* restore state for suspend/resume and display reset */
struct drm_atomic_state *modeset_state;
diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index f244a2b5d139..81bef000a4e3 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -27,6 +27,7 @@
#include "intel_display_power.h"
#include "intel_display_power_well.h"
#include "intel_display_regs.h"
+#include "intel_display_reset.h"
#include "intel_display_rpm.h"
#include "intel_display_types.h"
#include "intel_dmc.h"
@@ -838,6 +839,7 @@ void intel_display_debugfs_register(struct intel_display *display)

intel_bios_debugfs_register(display);
intel_cdclk_debugfs_register(display);
+ intel_display_reset_debugfs_register(display);
intel_dmc_debugfs_register(display);
intel_dp_test_debugfs_register(display);
intel_fbc_debugfs_register(display);
diff --git a/drivers/gpu/drm/i915/display/intel_display_reset.c b/drivers/gpu/drm/i915/display/intel_display_reset.c
index ca15dc18ef0f..e06a8c933cf0 100644
--- a/drivers/gpu/drm/i915/display/intel_display_reset.c
+++ b/drivers/gpu/drm/i915/display/intel_display_reset.c
@@ -3,6 +3,8 @@
* Copyright © 2023 Intel Corporation
*/

+#include <linux/debugfs.h>
+
#include <drm/drm_atomic_helper.h>
#include <drm/drm_print.h>

@@ -66,6 +68,7 @@ void intel_display_reset_prepare(struct intel_display *display)
return;
}

+ display->reset.count++;
display->restore.modeset_state = state;
state->acquire_ctx = ctx;
}
@@ -114,3 +117,10 @@ void intel_display_reset_finish(struct intel_display *display, bool test_only)
drm_modeset_acquire_fini(ctx);
mutex_unlock(&display->drm->mode_config.mutex);
}
+
+void intel_display_reset_debugfs_register(struct intel_display *display)
+{
+ debugfs_create_u32("intel_display_reset_count", 0400,
+ display->drm->debugfs_root,
+ &display->reset.count);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_display_reset.h b/drivers/gpu/drm/i915/display/intel_display_reset.h
index a8aa7729d33f..b88c330a3441 100644
--- a/drivers/gpu/drm/i915/display/intel_display_reset.h
+++ b/drivers/gpu/drm/i915/display/intel_display_reset.h
@@ -15,4 +15,6 @@ bool intel_display_reset_test(struct intel_display *display);
void intel_display_reset_prepare(struct intel_display *display);
void intel_display_reset_finish(struct intel_display *display, bool test_only);

+void intel_display_reset_debugfs_register(struct intel_display *display);
+
#endif /* __INTEL_RESET_H__ */
diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
index e42e582aca5c..95666f950a6f 100644
--- a/drivers/gpu/drm/xe/Makefile
+++ b/drivers/gpu/drm/xe/Makefile
@@ -263,6 +263,7 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
i915-display/intel_display_power.o \
i915-display/intel_display_power_map.o \
i915-display/intel_display_power_well.o \
+ i915-display/intel_display_reset.o \
i915-display/intel_display_rpm.o \
i915-display/intel_display_rps.o \
i915-display/intel_display_trace.o \
--
2.52.0