Expose the HPD polling state so the runtime resume path can tell
whether polling was enabled on suspend.

Assisted-by: GitHub_Copilot:claude-opus-5
Signed-off-by: Vinod Govindapillai <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_hotplug.c | 11 +++++++++++
 drivers/gpu/drm/i915/display/intel_hotplug.h |  1 +
 2 files changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c 
b/drivers/gpu/drm/i915/display/intel_hotplug.c
index 970aa95ee344..cc3aabbff687 100644
--- a/drivers/gpu/drm/i915/display/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
@@ -932,6 +932,17 @@ void intel_hpd_poll_fini(struct intel_display *display)
        drm_connector_list_iter_end(&conn_iter);
 }
 
+/**
+ * intel_hpd_polling_enabled - check if HPD polling is enabled
+ * @display: display device instance
+ *
+ * Returns true if HPD polling is currently enabled.
+ */
+bool intel_hpd_polling_enabled(struct intel_display *display)
+{
+       return READ_ONCE(display->hotplug.poll_enabled);
+}
+
 void intel_hpd_init_early(struct intel_display *display)
 {
        INIT_DELAYED_WORK(&display->hotplug.hotplug_work,
diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.h 
b/drivers/gpu/drm/i915/display/intel_hotplug.h
index edc41c9d3d65..b17fdeb808ca 100644
--- a/drivers/gpu/drm/i915/display/intel_hotplug.h
+++ b/drivers/gpu/drm/i915/display/intel_hotplug.h
@@ -17,6 +17,7 @@ struct intel_encoder;
 void intel_hpd_poll_enable(struct intel_display *display);
 void intel_hpd_poll_disable(struct intel_display *display);
 void intel_hpd_poll_fini(struct intel_display *display);
+bool intel_hpd_polling_enabled(struct intel_display *display);
 enum intel_hotplug_state intel_encoder_hotplug(struct intel_encoder *encoder,
                                               struct intel_connector 
*connector);
 void intel_hpd_irq_handler(struct intel_display *display,
-- 
2.43.0

Reply via email to