[i-g-t V2 5/5] lib/igt_kms: Reset spurious hpd to default on exit

Bhanuprakash Modem bhanuprakash.modem at intel.com
Tue Sep 24 14:26:38 UTC 2024


Add support to force the spurious hpd to default on exit.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 lib/igt_kms.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index c1d80dbb8..e47db0309 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2896,6 +2896,19 @@ static void igt_handle_spurious_hpd(igt_display_t *display)
 	dump_connector_attrs();
 }
 
+static void igt_reset_spurious_hpd(int drm_fd)
+{
+	/* Proceed with spurious HPD handling only if the env var is set */
+	if (!getenv("IGT_KMS_IGNORE_HPD"))
+		return;
+
+	/* Set the ignore HPD for the driver */
+	if (!igt_ignore_long_hpd(drm_fd, false)) {
+		igt_info("Unable set the ignore HPD debugfs entry \n");
+		return;
+	}
+}
+
 /**
  * igt_display_reset_outputs:
  * @display: a pointer to an initialized #igt_display_t structure
@@ -3416,6 +3429,9 @@ void igt_display_fini(igt_display_t *display)
 		igt_output_fini(&display->outputs[i]);
 	}
 
+	if (display->n_pipes && display->n_outputs)
+		igt_reset_spurious_hpd(display->drm_fd);
+
 	free(display->outputs);
 	display->outputs = NULL;
 	free(display->pipes);
-- 
2.43.0



More information about the igt-dev mailing list