All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kunal Joshi <kunal1.joshi@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Kunal Joshi <kunal1.joshi@intel.com>
Subject: [PATCH i-g-t 10/13] tests/intel/kms_dp_link_training: Add per connector mode subtests
Date: Wed, 16 Sep 2026 10:17:58 +0530	[thread overview]
Message-ID: <20260916044801.1279102-11-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20260916044801.1279102-1-kunal1.joshi@intel.com>

The four existing subtests cover whichever connector mode the machine
presents. On a machine with a Thunderbolt dock they train a tunneled
link, on one without they train a direct link, and the result is
identical either way, so a lab that never had a dock looks the same as
one where the tunnel works.

Add eight subtests selecting links by connector mode:

	uhbr-sst-tbtalt-train        non-uhbr-sst-tbtalt-train
	uhbr-mst-tbtalt-train        non-uhbr-mst-tbtalt-train
	uhbr-sst-direct-train        non-uhbr-sst-direct-train
	uhbr-mst-direct-train        non-uhbr-mst-direct-train

with the same per configuration dynamic subtests as the existing ones.
"direct" is native, DP alt mode and legacy together: they all take the
link clock from the PHY PLL, and only tbt-alt takes it from the
Thunderbolt PLL, so that is the only split that changes which driver
code runs. The raw mode stays in the inventory line, so dp-alt against
legacy is still diagnosable from a failing run.

The connector mode has to be in the static subtest name rather than a
dynamic one, because a dynamic subtest that skips is not counted as
executed: a container with one pass and twenty skips reports PASS, so a
lab with no dock would look green.

Keep the four existing names and their PHY agnostic scope. They are not
redundant: they are what to run on a machine nobody provisioned for
this matrix.

Expect most of the eight to skip on any one machine, since dp-alt and
tbt-alt are mutually exclusive on a port at a given moment. The skip
reasons name the connector mode so the two causes - no such link, and a
link that allows no configuration in the encoding class - stay
greppable apart.

Assisted-by: GitHub_Copilot:claude-opus-5
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
 tests/intel/kms_dp_link_training.c | 142 ++++++++++++++++++++++++++++-
 1 file changed, 137 insertions(+), 5 deletions(-)

diff --git a/tests/intel/kms_dp_link_training.c b/tests/intel/kms_dp_link_training.c
index e6160cee5..229eb3d69 100644
--- a/tests/intel/kms_dp_link_training.c
+++ b/tests/intel/kms_dp_link_training.c
@@ -21,6 +21,40 @@
  * Description: Test we can drive non-UHBR rates over MST.
  */
 
+/**
+ * SUBTEST: uhbr-sst-tbtalt-train
+ * Description: Test we can drive UHBR rates over an SST link tunneled over
+ *              USB4/Thunderbolt.
+ *
+ * SUBTEST: uhbr-mst-tbtalt-train
+ * Description: Test we can drive UHBR rates over an MST link tunneled over
+ *              USB4/Thunderbolt.
+ *
+ * SUBTEST: uhbr-sst-direct-train
+ * Description: Test we can drive UHBR rates over a directly connected SST
+ *              link.
+ *
+ * SUBTEST: uhbr-mst-direct-train
+ * Description: Test we can drive UHBR rates over a directly connected MST
+ *              link.
+ *
+ * SUBTEST: non-uhbr-sst-tbtalt-train
+ * Description: Test we can drive non-UHBR rates over an SST link tunneled over
+ *              USB4/Thunderbolt.
+ *
+ * SUBTEST: non-uhbr-mst-tbtalt-train
+ * Description: Test we can drive non-UHBR rates over an MST link tunneled over
+ *              USB4/Thunderbolt.
+ *
+ * SUBTEST: non-uhbr-sst-direct-train
+ * Description: Test we can drive non-UHBR rates over a directly connected SST
+ *              link.
+ *
+ * SUBTEST: non-uhbr-mst-direct-train
+ * Description: Test we can drive non-UHBR rates over a directly connected MST
+ *              link.
+ */
+
 #include "i915/i915_dp.h"
 #include "igt.h"
 #include "igt_kms.h"
@@ -60,6 +94,38 @@ struct dp_link {
 	enum i915_dp_tc_mode tc_mode;
 };
 
+/*
+ * enum phy_filter - Which links a subtest selects.
+ *
+ * PHY_ANY is the PHY agnostic scope of the original subtests. The split
+ * between PHY_TBTALT and PHY_DIRECT is where the link clock comes from: only a
+ * tbt-alt link is clocked by the Thunderbolt PLL, native, DP alt mode and
+ * legacy all use the PHY PLL, so folding the latter three together does not
+ * change which driver code runs.
+ */
+enum phy_filter {
+	PHY_ANY,
+	PHY_TBTALT,
+	PHY_DIRECT,
+};
+
+static const char *phy_filter_name(enum phy_filter phy)
+{
+	return phy == PHY_TBTALT ? "tbt-alt" : "direct";
+}
+
+static bool link_matches_phy(const struct dp_link *link, enum phy_filter phy)
+{
+	switch (phy) {
+	case PHY_TBTALT:
+		return link->tc_mode == I915_DP_TC_TBT_ALT;
+	case PHY_DIRECT:
+		return link->tc_mode != I915_DP_TC_TBT_ALT;
+	default:
+		return true;
+	}
+}
+
 /*
  * check_condition_with_timeout - Polls check_fn until it returns 0
  * or until 'timeout' seconds elapse.
@@ -606,7 +672,8 @@ static int discover_links(data_t *data, struct dp_link *links, int max_links)
 	return num_links;
 }
 
-static bool test_link_rate(data_t *data, bool mst, bool uhbr)
+static bool test_link_rate(data_t *data, bool mst, bool uhbr,
+			   enum phy_filter phy)
 {
 	struct dp_link links[MAX_LINKS];
 	bool ran_any_link = false;
@@ -628,6 +695,15 @@ static bool test_link_rate(data_t *data, bool mst, bool uhbr)
 			continue;
 		}
 
+		if (!link_matches_phy(&links[i], phy)) {
+			igt_info("Skipping %s: %s requested but it's %s.\n",
+				 igt_output_name(links[i].output),
+				 phy_filter_name(phy),
+				 i915_dp_tc_mode_name(links[i].tc_mode));
+			igt_info("----------------------------------------------------\n");
+			continue;
+		}
+
 		data->output = links[i].output;
 		igt_info("Running link training test for %s\n",
 			 igt_output_name(data->output));
@@ -665,7 +741,7 @@ int igt_main()
 	igt_subtest_with_dynamic("uhbr-sst") {
 		igt_require_f(intel_display_ver(data.devid) > 13,
 			      "UHBR not supported on platform\n");
-		igt_require_f(test_link_rate(&data, false, true),
+		igt_require_f(test_link_rate(&data, false, true, PHY_ANY),
 			      "Didn't find any SST output with UHBR rates.\n");
 	}
 
@@ -673,22 +749,78 @@ int igt_main()
 	igt_subtest_with_dynamic("uhbr-mst") {
                 igt_require_f(intel_display_ver(data.devid) > 13,
                               "UHBR not supported on platform\n");
-		igt_require_f(test_link_rate(&data, true, true),
+		igt_require_f(test_link_rate(&data, true, true, PHY_ANY),
 			      "Didn't find any MST output with UHBR rates.\n");
 	}
 
 	igt_describe("Test we can drive NON-UHBR rates over SST");
 	igt_subtest_with_dynamic("non-uhbr-sst") {
-		igt_require_f(test_link_rate(&data, false, false),
+		igt_require_f(test_link_rate(&data, false, false, PHY_ANY),
 			      "Didn't find any SST output with NON-UHBR rates.\n");
 	}
 
 	igt_describe("Test we can drive NON-UHBR rates over MST");
 	igt_subtest_with_dynamic("non-uhbr-mst") {
-		igt_require_f(test_link_rate(&data, true, false),
+		igt_require_f(test_link_rate(&data, true, false, PHY_ANY),
 			      "Didn't find any MST output with NON-UHBR rates.\n");
 	}
 
+	igt_describe("Test we can drive UHBR rates over a tunneled SST link");
+	igt_subtest_with_dynamic("uhbr-sst-tbtalt-train") {
+		igt_require_f(intel_display_ver(data.devid) > 13,
+			      "UHBR not supported on platform\n");
+		igt_require_f(test_link_rate(&data, false, true, PHY_TBTALT),
+			      "No tbt-alt DP SST link allows a UHBR config\n");
+	}
+
+	igt_describe("Test we can drive UHBR rates over a tunneled MST link");
+	igt_subtest_with_dynamic("uhbr-mst-tbtalt-train") {
+		igt_require_f(intel_display_ver(data.devid) > 13,
+			      "UHBR not supported on platform\n");
+		igt_require_f(test_link_rate(&data, true, true, PHY_TBTALT),
+			      "No tbt-alt DP MST link allows a UHBR config\n");
+	}
+
+	igt_describe("Test we can drive UHBR rates over a direct SST link");
+	igt_subtest_with_dynamic("uhbr-sst-direct-train") {
+		igt_require_f(intel_display_ver(data.devid) > 13,
+			      "UHBR not supported on platform\n");
+		igt_require_f(test_link_rate(&data, false, true, PHY_DIRECT),
+			      "No direct DP SST link allows a UHBR config\n");
+	}
+
+	igt_describe("Test we can drive UHBR rates over a direct MST link");
+	igt_subtest_with_dynamic("uhbr-mst-direct-train") {
+		igt_require_f(intel_display_ver(data.devid) > 13,
+			      "UHBR not supported on platform\n");
+		igt_require_f(test_link_rate(&data, true, true, PHY_DIRECT),
+			      "No direct DP MST link allows a UHBR config\n");
+	}
+
+	igt_describe("Test we can drive non-UHBR rates over a tunneled SST link");
+	igt_subtest_with_dynamic("non-uhbr-sst-tbtalt-train") {
+		igt_require_f(test_link_rate(&data, false, false, PHY_TBTALT),
+			      "No tbt-alt DP SST link allows a non-UHBR config\n");
+	}
+
+	igt_describe("Test we can drive non-UHBR rates over a tunneled MST link");
+	igt_subtest_with_dynamic("non-uhbr-mst-tbtalt-train") {
+		igt_require_f(test_link_rate(&data, true, false, PHY_TBTALT),
+			      "No tbt-alt DP MST link allows a non-UHBR config\n");
+	}
+
+	igt_describe("Test we can drive non-UHBR rates over a direct SST link");
+	igt_subtest_with_dynamic("non-uhbr-sst-direct-train") {
+		igt_require_f(test_link_rate(&data, false, false, PHY_DIRECT),
+			      "No direct DP SST link allows a non-UHBR config\n");
+	}
+
+	igt_describe("Test we can drive non-UHBR rates over a direct MST link");
+	igt_subtest_with_dynamic("non-uhbr-mst-direct-train") {
+		igt_require_f(test_link_rate(&data, true, false, PHY_DIRECT),
+			      "No direct DP MST link allows a non-UHBR config\n");
+	}
+
 	igt_fixture() {
 		igt_reset_connectors();
 		igt_display_fini(&data.display);
-- 
2.25.1


  parent reply	other threads:[~2026-09-16  4:31 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  4:47 [PATCH i-g-t 00/13] Expand kms_dp_link_training coverage Kunal Joshi
2026-09-16  4:47 ` [PATCH i-g-t 01/13] lib/i915/i915_dp: Add helpers for the allowed link configs debugfs Kunal Joshi
2026-09-21  8:37   ` S, Sowmiya
2026-09-16  4:47 ` [PATCH i-g-t 02/13] tests/intel/kms_dp_link_training: Use the UHBR helpers from lib Kunal Joshi
2026-09-21  8:38   ` S, Sowmiya
2026-09-16  4:47 ` [PATCH i-g-t 03/13] tests/intel/kms_dp_link_training: Extract train_link_config() Kunal Joshi
2026-09-22 11:51   ` S, Sowmiya
2026-09-16  4:47 ` [PATCH i-g-t 04/13] tests/intel/kms_dp_link_training: Check the config survived training Kunal Joshi
2026-09-22  5:25   ` S, Sowmiya
2026-09-16  4:47 ` [PATCH i-g-t 05/13] tests/intel/kms_dp_link_training: Drive the smallest mode the sink offers Kunal Joshi
2026-09-22 11:59   ` S, Sowmiya
2026-09-16  4:47 ` [PATCH i-g-t 06/13] tests/intel/kms_dp_link_training: Train every allowed link config Kunal Joshi
2026-09-22 13:51   ` S, Sowmiya
2026-09-16  4:47 ` [PATCH i-g-t 07/13] lib/i915/i915_dp: Add a Type-C port mode query Kunal Joshi
2026-09-22 14:55   ` S, Sowmiya
2026-09-16  4:47 ` [PATCH i-g-t 08/13] tests/intel/kms_dp_link_training: Log the DP link inventory in the fixture Kunal Joshi
2026-09-23 12:46   ` S, Sowmiya
2026-09-16  4:47 ` [PATCH i-g-t 09/13] tests/intel/kms_dp_link_training: Group the outputs into links Kunal Joshi
2026-09-23 13:10   ` S, Sowmiya
2026-09-16  4:47 ` Kunal Joshi [this message]
2026-09-23 13:29   ` [PATCH i-g-t 10/13] tests/intel/kms_dp_link_training: Add per connector mode subtests S, Sowmiya
2026-09-16  4:47 ` [PATCH i-g-t 11/13] lib/igt_dp: Add DPCD read helpers Kunal Joshi
2026-09-23 13:34   ` S, Sowmiya
2026-09-16  4:48 ` [PATCH i-g-t 12/13] lib/igt_dp: Add link status predicates for both channel codings Kunal Joshi
2026-09-23 13:55   ` S, Sowmiya
2026-09-16  4:48 ` [PATCH i-g-t 13/13] tests/intel/kms_dp_link_training: Verify the trained link from the sink side Kunal Joshi
2026-09-23 14:00   ` S, Sowmiya
2026-09-16  5:08 ` ✓ Xe.CI.BAT: success for Expand kms_dp_link_training coverage Patchwork
2026-09-16  5:25 ` ✓ i915.CI.BAT: " Patchwork
2026-09-16  6:15 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-16 11:59 ` ✗ i915.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260916044801.1279102-11-kunal1.joshi@intel.com \
    --to=kunal1.joshi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.