[igt-dev] [PATCH i-g-t 1/3] lib/igt_chamelium: add chamelium_trigger_link_failure

Simon Ser simon.ser at intel.com
Tue Aug 13 14:17:46 UTC 2019


This new function triggers a link failure on the provided port. Another
function called chamelium_supports_trigger_link_failure has been added to
check whether the Chamelium board supports the new method.

Support for TriggerLinkFailure in Chamelium has been added in [1].

[1]: https://chromium.googlesource.com/chromiumos/platform/chameleon/+/44866c7bc2af44da1f7bac4e782d0ed6d7c1400a

Signed-off-by: Simon Ser <simon.ser at intel.com>
---
 lib/igt_chamelium.c | 15 +++++++++++++++
 lib/igt_chamelium.h |  3 +++
 2 files changed, 18 insertions(+)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index 301e9d214dd1..076ee0578c9c 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -1124,6 +1124,21 @@ int chamelium_get_captured_frame_count(struct chamelium *chamelium)
 	return ret;
 }
 
+bool chamelium_supports_trigger_link_failure(struct chamelium *chamelium)
+{
+	return chamelium_supports_method(chamelium, "TriggerLinkFailure");
+}
+
+/**
+ * chamelium_trigger_link_failure: trigger a link failure on the provided port.
+ */
+void chamelium_trigger_link_failure(struct chamelium *chamelium,
+				    struct chamelium_port *port)
+{
+	xmlrpc_DECREF(chamelium_rpc(chamelium, port, "TriggerLinkFailure",
+				    "(i)", port->id));
+}
+
 bool chamelium_has_audio_support(struct chamelium *chamelium,
 				 struct chamelium_port *port)
 {
diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
index b6b7eb4436f8..3f6b1b21cbfc 100644
--- a/lib/igt_chamelium.h
+++ b/lib/igt_chamelium.h
@@ -141,6 +141,9 @@ void chamelium_start_capture(struct chamelium *chamelium,
 void chamelium_stop_capture(struct chamelium *chamelium, int frame_count);
 void chamelium_capture(struct chamelium *chamelium, struct chamelium_port *port,
 		       int x, int y, int w, int h, int frame_count);
+bool chamelium_supports_trigger_link_failure(struct chamelium *chamelium);
+void chamelium_trigger_link_failure(struct chamelium *chamelium,
+				    struct chamelium_port *port);
 bool chamelium_has_audio_support(struct chamelium *chamelium,
 				 struct chamelium_port *port);
 void chamelium_get_audio_channel_mapping(struct chamelium *chamelium,
-- 
2.22.0



More information about the igt-dev mailing list