[PATCH] tests/unigraf: Hoist static DP link rate bounds and purge eDP rate

Mark Yacoub <[email protected]>
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <[email protected]>
Currently, the link rate subtest dynamically iterates across
UNIGRAF_RATE_6_75_GHZ during its testing sweep. However, 6.75 Gbps is
structurally an exclusive eDP link rate parameter that physical external
DP sink testbeds do not natively map to. Iterating over it on external
chassis outputs reliably wastes execution cycles only to inevitably fail
a hardware constraint validation.

Additionally, the existing igt_require(max_supported_rate... validation
is currently executed at the very end of the loop, specifically after
the testbed has already triggered an expensive HPD pulse, retrained the
physical link, and rebuilt the IGT output wrapper.

This patch cleans out the test execution array, and physically hoists
the igt_dp_get_max_supported_rate() capability check completely outside
the active dynamic initialization context to serve strictly as a
zero-cost pre-flight evaluator. The subtest now cleanly skips
hardware-unsupported rate ceilings in 0.00s natively, significantly
shrinking the cumulative latency footprint of an automated CI pipeline.
---
 tests/unigraf/unigraf_lt.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/tests/unigraf/unigraf_lt.c b/tests/unigraf/unigraf_lt.c
index 81e6ecd3f..c82607e14 100644
--- a/tests/unigraf/unigraf_lt.c
+++ b/tests/unigraf/unigraf_lt.c
@@ -127,13 +127,20 @@ int igt_main()
 		int rates[] = {UNIGRAF_RATE_1_62_GHZ,
 			       UNIGRAF_RATE_2_7_GHZ,
 			       UNIGRAF_RATE_5_4_GHZ,
-			       UNIGRAF_RATE_6_75_GHZ,
 			       UNIGRAF_RATE_8_10_GHZ};
 		int current_rate;
-		int max_supported_rate;
+		int max_supported_rate = 0;
+
+		output = igt_output_from_connector(&display, connector);
+		if (output)
+			max_supported_rate = igt_dp_get_max_supported_rate(drm_fd, output);
 
 		for (i = 0; i < ARRAY_SIZE(rates); i++) {
 			igt_dynamic_f("unigraf-dp-link-rate-%d", rates[i]) {
+				igt_require_f(max_supported_rate >= unigraf_rate_to_kbs(rates[i]),
+					      "Host port physically caps below test rate bounds (Host: %d, Test: %d)\n",
+					      max_supported_rate, unigraf_rate_to_kbs(rates[i]));
+
 				unigraf_reset();
 				unigraf_set_max_link_rate(rates[i]);
 				unigraf_hpd_pulse(1000000);
@@ -147,8 +154,6 @@ int igt_main()
 				init_output_and_display_pattern(&display, output);
 
 				current_rate = igt_dp_get_max_link_rate(drm_fd, output);
-				max_supported_rate = igt_dp_get_max_supported_rate(drm_fd, output);
-				igt_require(max_supported_rate >= unigraf_rate_to_kbs(rates[i]));
 				igt_assert_eq(current_rate, unigraf_rate_to_kbs(rates[i]));
 			}
 		}
-- 
2.55.0.691.gc56d675ccc-goog
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.