[i-g-t 5/5] lib/igt_kms: Reset spurious hpd to default on exit
Bhanuprakash Modem
bhanuprakash.modem at intel.com
Tue Aug 13 12:06:18 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 c9f09c524..936fec4ba 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
@@ -3415,6 +3428,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.2
More information about the igt-dev
mailing list