[PATCH i-g-t v2 36/39] lib/chamelium/v3: Implement hot plug toggle scheduling method
Louis Chauvet
louis.chauvet at bootlin.com
Tue Jul 9 15:34:52 UTC 2024
This commit adds a new method to the Chameleon V3 wrapper to schedule hot
plug detect (HPD) toggle events. This feature is useful for testing
suspend and resume behaviors, as it allows the simulation of device
connection and disconnection events at specified times.
Signed-off-by: Louis Chauvet <louis.chauvet at bootlin.com>
---
lib/chamelium/v3/igt_chamelium.c | 16 ++++++++++++++++
lib/chamelium/v3/igt_chamelium.h | 2 ++
2 files changed, 18 insertions(+)
diff --git a/lib/chamelium/v3/igt_chamelium.c b/lib/chamelium/v3/igt_chamelium.c
index 436a3cba139e..fa70e2c1e296 100644
--- a/lib/chamelium/v3/igt_chamelium.c
+++ b/lib/chamelium/v3/igt_chamelium.c
@@ -1173,3 +1173,19 @@ bool chamelium_v3_port_wait_video_input_stable(struct igt_chamelium_v3 *chameliu
return is_on;
}
+
+/**
+ * chamelium_v3_schedule_hpd_toggle - Schedule an hotplug detect toggle
+ *
+ * @chamelium: Chamelium to use
+ * @port_id: Port to schedule the hpd toggle
+ * @delay_ms: Delay before triggering the toggle
+ * @end_level: HPD status after the toggle, where true is connected
+ */
+void chamelium_v3_schedule_hpd_toggle(struct igt_chamelium_v3 *chamelium,
+ chamelium_v3_port_id port_id, int delay_ms, bool end_level)
+{
+ igt_debug("RPC ScheduleHpdToggle(%d, %d, %d)\n", port_id, delay_ms, end_level);
+ xmlrpc_DECREF(__chamelium_rpc(chamelium, "ScheduleHpdToggle", "(iib)", port_id,
+ delay_ms, end_level));
+}
diff --git a/lib/chamelium/v3/igt_chamelium.h b/lib/chamelium/v3/igt_chamelium.h
index bc0645f882c0..fb600e1d771f 100644
--- a/lib/chamelium/v3/igt_chamelium.h
+++ b/lib/chamelium/v3/igt_chamelium.h
@@ -84,4 +84,6 @@ void chamelium_v3_port_get_resolution(struct igt_chamelium_v3 *chamelium,
chamelium_v3_port_id port_id, int *x, int *y);
bool chamelium_v3_port_wait_video_input_stable(struct igt_chamelium_v3 *chamelium,
chamelium_v3_port_id port_id, int timeout_secs);
+void chamelium_v3_schedule_hpd_toggle(struct igt_chamelium_v3 *chamelium,
+ chamelium_v3_port_id port_id, int delay_ms, bool end_level);
#endif //V3_IGT_CHAMELIUM_H
--
2.44.2
More information about the igt-dev
mailing list