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 05/13] tests/intel/kms_dp_link_training: Drive the smallest mode the sink offers
Date: Wed, 16 Sep 2026 10:17:53 +0530 [thread overview]
Message-ID: <20260916044801.1279102-6-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20260916044801.1279102-1-kunal1.joshi@intel.com>
The test modesets the output's preferred mode, which on a modern
monitor needs most of the link. The driver picks the lowest
configuration that carries the mode, so a large mode leaves most of the
link configurations below the threshold where they can be used at all.
Override the smallest mode the sink offers instead. That keeps the
largest number of configurations usable, and it stays out of the
compressed regime, where the bpp the driver picks rather than the link
configuration absorbs the difference.
The override is cleared by the igt_display_reset() each run starts
with, so it needs no explicit teardown.
Prep for training every allowed configuration.
Assisted-by: GitHub_Copilot:claude-opus-5
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
tests/intel/kms_dp_link_training.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/tests/intel/kms_dp_link_training.c b/tests/intel/kms_dp_link_training.c
index b2d686f28..6a174da88 100644
--- a/tests/intel/kms_dp_link_training.c
+++ b/tests/intel/kms_dp_link_training.c
@@ -183,6 +183,25 @@ static void train_link_config(data_t *data, bool mst,
assert_link_recovery_idle(data, config);
}
+/*
+ * override_lowest_mode - Drive the mode with the lowest pixel clock, so that
+ * the largest number of link configurations can carry it.
+ */
+static void override_lowest_mode(data_t *data, igt_output_t *output)
+{
+ drmModeConnector *connector = output->config.connector;
+ drmModeModeInfo *mode = NULL;
+ int i;
+
+ for (i = 0; i < connector->count_modes; i++)
+ if (!mode || connector->modes[i].clock < mode->clock)
+ mode = &connector->modes[i];
+
+ igt_assert_f(mode, "No mode on output %s\n", igt_output_name(output));
+
+ igt_output_override_mode(output, mode);
+}
+
/*
* setup_planes_fbs - Create solid-color FBs and attach them to the primary plane.
*/
@@ -222,6 +241,7 @@ static void do_modeset(data_t *data, bool mst)
int n_pipes = 0;
int out_count = 0;
igt_crtc_t *crtc;
+ int i;
for_each_crtc(&data->display, crtc) {
valid_pipes_mask |= BIT(crtc->hardware_pipe);
@@ -241,6 +261,9 @@ static void do_modeset(data_t *data, bool mst)
igt_assert_f(out_count > 0, "Require at least one output\n");
+ for (i = 0; i < out_count; i++)
+ override_lowest_mode(data, outs[i]);
+
igt_set_all_master_pipes_for_platform(&data->display, &master_pipes_mask);
igt_assert_f(igt_assign_pipes_for_outputs(data->drm_fd,
--
2.25.1
next prev parent reply other threads:[~2026-09-16 4:30 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 ` Kunal Joshi [this message]
2026-09-22 11:59 ` [PATCH i-g-t 05/13] tests/intel/kms_dp_link_training: Drive the smallest mode the sink offers 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 ` [PATCH i-g-t 10/13] tests/intel/kms_dp_link_training: Add per connector mode subtests Kunal Joshi
2026-09-23 13:29 ` 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-6-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.