[igt-dev] [PATCH i-g-t] lib/igt_chamelium: Retry DP FSM on Failure

Kunal Joshi kunal1.joshi at intel.com
Tue May 4 06:12:26 UTC 2021


We have a thread called chamelium_fsm_mon which monitors HPD events
triggered by chamelium, Unfortunately not always the HPD event arrives
in a fixed interval (mostly does), Quick fix to this is to retry.

Fixes :- https://gitlab.freedesktop.org/drm/intel/-/issues/262
         https://jira.devtools.intel.com/browse/VLK-8093
Cc: Petri Latvala <petri.latvala at intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi at intel.com>
---
 lib/igt_chamelium.c | 38 +++++++++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 7 deletions(-)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index 7085122a7..39f0d01bf 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -522,15 +522,39 @@ static xmlrpc_value *chamelium_rpc(struct chamelium *chamelium,
 {
 	xmlrpc_value *res;
 	va_list va_args;
+	int fsm_trials_left = 5;
 
-	va_start(va_args, format_str);
-	res = __chamelium_rpc_va(chamelium, fsm_port, method_name,
-				 format_str, va_args);
-	va_end(va_args);
+	if (strcmp(method_name, "CaptureVideo") == 0) {
 
-	igt_assert_f(!chamelium->env.fault_occurred,
-		     "Chamelium RPC call failed: %s\n",
-		     chamelium->env.fault_string);
+		while (fsm_trials_left) {
+
+			va_start(va_args, format_str);
+			res = __chamelium_rpc_va(chamelium, fsm_port,
+						 method_name, format_str,
+						 va_args);
+			va_end(va_args);
+
+			if (!chamelium->env.fault_occurred)
+				break;
+
+			igt_debug("DP FSM failed retrying, tries left %d\n", fsm_trials_left);
+			--fsm_trials_left;
+		}
+
+		igt_assert_f(!chamelium->env.fault_occurred,
+			     "Chamelium RPC call failed: %s\n",
+			     chamelium->env.fault_string);
+	} else {
+
+		va_start(va_args, format_str);
+		res = __chamelium_rpc_va(chamelium, fsm_port, method_name,
+					 format_str, va_args);
+		va_end(va_args);
+
+		igt_assert_f(!chamelium->env.fault_occurred,
+			     "Chamelium RPC call failed: %s\n",
+			     chamelium->env.fault_string);
+	}
 
 	return res;
 }
-- 
2.25.1



More information about the igt-dev mailing list