Igt-dev Archive on 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>, Sowmiya S <sowmiya.s@intel.com>
Subject: [PATCH i-g-t 10/13] tests/intel/kms_dp_link_training: add tbt-alt and direct link subtests
Date: Thu,  1 Oct 2026 13:07:00 +0530	[thread overview]
Message-ID: <20261001073703.5067-11-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20261001073703.5067-1-kunal1.joshi@intel.com>

The existing subtests pass the same with or without a Thunderbolt dock,
so there's no telling whether the tunneled path was tested at all.

Add {uhbr,non-uhbr}-{sst,mst}-{tbtalt,direct}-train subtests, which
filter the links by Type-C port mode. Only tbt-alt uses the Thunderbolt
PLL, so lump native, dp-alt and legacy together as direct.

The mode needs to be in the subtest name, not in the dynamic subtest
name. Otherwise, a missing dock would just mean fewer dynamic subtests,
and the subtest would still pass.

Keep the existing subtests for machines not set up for the new ones.
Expect most of the new ones to skip on any given machine.

Assisted-by: GitHub_Copilot:claude-opus-5
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
Reviewed-by: Sowmiya S <sowmiya.s@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 477dc03ba..8f99f43f0 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.
@@ -609,7 +675,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;
@@ -631,6 +698,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));
@@ -668,7 +744,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");
 	}
 
@@ -676,22 +752,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-10-01  7:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01  7:36 [PATCH i-g-t 00/13] Expand kms_dp_link_training coverage Kunal Joshi
2026-10-01  7:36 ` [PATCH i-g-t 01/13] lib/i915/i915_dp: add helpers for the allowed link configs debugfs Kunal Joshi
2026-10-01  7:36 ` [PATCH i-g-t 02/13] tests/intel/kms_dp_link_training: use i915_dp_is_uhbr_rate() Kunal Joshi
2026-10-01  7:36 ` [PATCH i-g-t 03/13] tests/intel/kms_dp_link_training: extract train_link_config() Kunal Joshi
2026-10-01  7:36 ` [PATCH i-g-t 04/13] tests/intel/kms_dp_link_training: detect links that failed training Kunal Joshi
2026-10-01  9:05   ` S, Sowmiya
2026-10-01  7:36 ` [PATCH i-g-t 05/13] tests/intel/kms_dp_link_training: use the lowest pixel clock mode Kunal Joshi
2026-10-01  7:36 ` [PATCH i-g-t 06/13] tests/intel/kms_dp_link_training: train all allowed link configs Kunal Joshi
2026-10-01  9:05   ` S, Sowmiya
2026-10-01  7:36 ` [PATCH i-g-t 07/13] lib/i915/i915_dp: add i915_dp_get_tc_mode() Kunal Joshi
2026-10-01  7:36 ` [PATCH i-g-t 08/13] tests/intel/kms_dp_link_training: log the DP link inventory Kunal Joshi
2026-10-01  7:36 ` [PATCH i-g-t 09/13] tests/intel/kms_dp_link_training: train each MST topology only once Kunal Joshi
2026-10-01  7:37 ` Kunal Joshi [this message]
2026-10-01  7:37 ` [PATCH i-g-t 11/13] lib/igt_dp: add DPCD read helpers Kunal Joshi
2026-10-01  7:37 ` [PATCH i-g-t 12/13] lib/igt_dp: add DPCD link status and channel coding checks Kunal Joshi
2026-10-01  7:37 ` [PATCH i-g-t 13/13] tests/intel/kms_dp_link_training: check the link from the sink side Kunal Joshi
2026-10-01 13:13 ` ✓ i915.CI.BAT: success for Expand kms_dp_link_training coverage (rev2) Patchwork
2026-10-01 16:42 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-01 21:02 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-10-05 16:06   ` Joshi, Kunal1
2026-10-02 17:18 ` ✗ i915.CI.Full: " Patchwork
2026-10-05 16:04   ` Joshi, Kunal1

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=20261001073703.5067-11-kunal1.joshi@intel.com \
    --to=kunal1.joshi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=sowmiya.s@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox