[i-g-t V3 4/4] lib/igt_kms: Reset spurious hpd to default on exit
Bhanuprakash Modem
bhanuprakash.modem at intel.com
Mon Nov 18 09:59:48 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 | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index f88c7d6c0..275589f70 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2922,6 +2922,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
@@ -3438,6 +3451,10 @@ void igt_display_fini(igt_display_t *display)
for (i = 0; i < display->n_outputs; i++)
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