[igt-dev] [PATCH i-g-t] lib/igt_kms: only check chamelium's presence in chamelium tests

Kunal Joshi kunal1.joshi at intel.com
Mon Mar 22 05:26:53 UTC 2021


Avoid checking if chamelium is present or not in non chamelium
tests as its just an overhead.

Cc: Petri Latvala <petri.latvala at intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi at intel.com>
---
 lib/igt_kms.c | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 08d429a8..397635d8 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1958,21 +1958,26 @@ void igt_display_require(igt_display_t *display, int drm_fd)
 
 #ifdef HAVE_CHAMELIUM
 	{
-		struct chamelium *chamelium;
-
-		chamelium = chamelium_init_rpc_only();
-		if (chamelium) {
-			igt_abort_on_f(!chamelium_wait_reachable(chamelium, 20),
-				       "cannot reach the configured chamelium!\n");
-			igt_abort_on_f(!chamelium_plug_all(chamelium),
-				       "failed to plug all the chamelium ports!\n");
-			igt_abort_on_f(!chamelium_wait_all_configured_ports_connected(chamelium, drm_fd),
-				       "not all configured chamelium ports are connected!\n");
-			chamelium_deinit_rpc_only(chamelium);
-		}
-	}
+		if (strstr(igt_test_name(), "feature_discovery") != NULL ||
+		    strstr(igt_test_name(), "cham") != NULL) {
+
+			struct chamelium *chamelium;
+
+			chamelium = chamelium_init_rpc_only();
+			if (chamelium) {
+				igt_abort_on_f(!chamelium_wait_reachable(chamelium, 20),
+					       "cannot reach the configured chamelium!\n");
+				igt_abort_on_f(!chamelium_plug_all(chamelium),
+					       "failed to plug all the chamelium ports!\n");
+				igt_abort_on_f(!chamelium_wait_all_configured_ports_connected(chamelium, drm_fd),
+					       "not all configured chamelium ports are connected!\n");
+				chamelium_deinit_rpc_only(chamelium);
+			}
+		}
+	}
 #endif
 
+
 	/*
 	 * With non-contiguous pipes display, crtc mapping is not always same
 	 * as pipe mapping, In i915 pipe is enum id of i915's crtc object.
-- 
2.25.1



More information about the igt-dev mailing list