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 08/13] tests/intel/kms_dp_link_training: log the DP link inventory
Date: Thu,  1 Oct 2026 13:06:58 +0530	[thread overview]
Message-ID: <20261001073703.5067-9-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20261001073703.5067-1-kunal1.joshi@intel.com>

When a subtest skips, there's no telling from the log whether the
monitor or the dock is missing, or the link just doesn't allow any
suitable configs.

Log each connected DP output once in the fixture, with SST/MST, the
Type-C port mode, and the allowed link configs:

	DP-2: MST, tbt-alt, pin assignment D, TC max lanes 4
	DP-2: allowed configs: 4x2000000 4x1000000 4x810000 2x810000

This is just logging, with no functional changes.

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 | 68 ++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/tests/intel/kms_dp_link_training.c b/tests/intel/kms_dp_link_training.c
index 7125bd033..9105570d1 100644
--- a/tests/intel/kms_dp_link_training.c
+++ b/tests/intel/kms_dp_link_training.c
@@ -290,6 +290,71 @@ static void train_link_config(data_t *data, bool mst,
 	assert_link_retrain_not_disabled(data, config);
 }
 
+/*
+ * log_link_inventory - Describe every connected DP link once.
+ *
+ * With the configuration in the subtest name, most subtests skip on any one
+ * machine. This is what tells a missing monitor apart from a monitor behind a
+ * dock that offers no UHBR configuration, without having to re-run by hand.
+ */
+static void log_link_inventory(data_t *data)
+{
+	igt_output_t *output;
+
+	for_each_connected_output(&data->display, output) {
+		struct i915_dp_link_config configs[MAX_LINK_CONFIGS];
+		enum i915_dp_tc_mode tc_mode;
+		char configs_str[512];
+		char pin_assignment;
+		int tc_max_lanes;
+		int num_configs;
+		int len = 0;
+		int i;
+
+		if (output->config.connector->connector_type !=
+		    DRM_MODE_CONNECTOR_DisplayPort)
+			continue;
+
+		tc_mode = i915_dp_get_tc_mode(data->drm_fd, output,
+					      &pin_assignment, &tc_max_lanes);
+
+		if (tc_mode == I915_DP_TC_NONE)
+			igt_info("%s: %s, %s\n", igt_output_name(output),
+				 igt_check_output_is_dp_mst(output) ? "MST" : "SST",
+				 i915_dp_tc_mode_name(tc_mode));
+		else
+			igt_info("%s: %s, %s, pin assignment %c, TC max lanes %d\n",
+				 igt_output_name(output),
+				 igt_check_output_is_dp_mst(output) ? "MST" : "SST",
+				 i915_dp_tc_mode_name(tc_mode),
+				 pin_assignment, tc_max_lanes);
+
+		if (!i915_dp_has_allowed_link_configs_debugfs(data->drm_fd, output)) {
+			igt_info("%s: no allowed link configs debugfs\n",
+				 igt_output_name(output));
+			continue;
+		}
+
+		/*
+		 * Enumerate with the forced parameters reset, or the set read
+		 * back is the forced one rather than the real one.
+		 */
+		i915_dp_reset_link_params(data->drm_fd, output);
+
+		num_configs = i915_dp_get_allowed_link_configs(data->drm_fd, output,
+							       configs,
+							       ARRAY_SIZE(configs));
+
+		for (i = 0; i < num_configs && len < (int)sizeof(configs_str); i++)
+			len += snprintf(configs_str + len, sizeof(configs_str) - len,
+					" %dx%d", configs[i].lane_count,
+					configs[i].link_rate);
+
+		igt_info("%s: allowed configs:%s\n", igt_output_name(output),
+			 num_configs ? configs_str : " none");
+	}
+}
+
 /*
  * override_lowest_mode - Drive the mode with the lowest pixel clock, so that
  * the largest number of link configurations can carry it.
@@ -527,6 +592,9 @@ int igt_main()
 		 */
 		igt_assert_f(igt_ignore_long_hpd(data.drm_fd, false),
 			     "Unable to disable ignore long hpd\n");
+
+		if (is_intel_device(data.drm_fd))
+			log_link_inventory(&data);
 	}
 
 	igt_describe("Test we can drive UHBR rates over SST");
-- 
2.25.1


  parent reply	other threads:[~2026-10-01  7:24 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 ` Kunal Joshi [this message]
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 ` [PATCH i-g-t 10/13] tests/intel/kms_dp_link_training: add tbt-alt and direct link subtests Kunal Joshi
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-9-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