[PATCH i-g-t v3 18/29] lib/unigraf: Add plug/unplug helpers
Louis Chauvet
louis.chauvet at bootlin.com
Sat Aug 23 02:11:38 UTC 2025
The unigraf can emulate a full cable plug/unplug, so add helper to emulate
this.
Signed-off-by: Louis Chauvet <louis.chauvet at bootlin.com>
---
lib/unigraf/unigraf.c | 16 ++++++++++++++++
lib/unigraf/unigraf.h | 14 ++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/lib/unigraf/unigraf.c b/lib/unigraf/unigraf.c
index 0682f383aaa0f5eb8d4b40bb88c2ea88975f311f..b0b6af97acc563d7af163c175bb4a73bd25abdb9 100644
--- a/lib/unigraf/unigraf.c
+++ b/lib/unigraf/unigraf.c
@@ -325,3 +325,19 @@ void unigraf_hpd_deassert(void)
igt_assert(unigraf_device);
unigraf_write(TSI_FORCE_HOT_PLUG_STATE_W, &d, sizeof(d));
}
+
+void unigraf_unplug(void)
+{
+ int d = 2 << 2;
+
+ igt_assert(unigraf_device);
+ unigraf_write(TSI_DPRX_HPD_FORCE, &d, sizeof(d));
+}
+
+void unigraf_plug(void)
+{
+ int d = 3 << 2;
+
+ igt_assert(unigraf_device);
+ unigraf_write(TSI_DPRX_HPD_FORCE, &d, sizeof(d));
+}
diff --git a/lib/unigraf/unigraf.h b/lib/unigraf/unigraf.h
index c5ae949c54729bf293a4629ec3bf5d995de9fb6b..4f32a3632c8dcd6bd9900d821a93dba3cb77d62a 100644
--- a/lib/unigraf/unigraf.h
+++ b/lib/unigraf/unigraf.h
@@ -69,4 +69,18 @@ void unigraf_hpd_pulse(int duration);
*/
void unigraf_hpd_assert(void);
+/**
+ * unigraf_plug() - Emulate a cable plug
+ *
+ * This function will emulate a full cable plug (not a simple HPD line change)
+ */
+void unigraf_plug(void);
+
+/**
+ * unigraf_plug() - Emulate a cable unplug
+ *
+ * This function will emulate a full cable unplug (not a simple HPD line change)
+ */
+void unigraf_unplug(void);
+
#endif // UNIGRAF_H
--
2.50.1
More information about the igt-dev
mailing list