From: Sowmiya S <sowmiya.s@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: kunal1.joshi@intel.com, swati2.sharma@intel.com,
ramanaidu.naladala@intel.com, Sowmiya S <sowmiya.s@intel.com>
Subject: [PATCH i-g-t v4 3/3] tests/intel/kms_pipe_stress: Fit display modes to MST link budget
Date: Mon, 29 Jun 2026 14:56:11 +0530 [thread overview]
Message-ID: <20260629092611.298235-4-sowmiya.s@intel.com> (raw)
In-Reply-To: <20260629092611.298235-1-sowmiya.s@intel.com>
When multiple displays share a single MST link,
running them at their highest modes can exceed the
available bandwidth.This causes the stress loop to
fail with -ENOSPC when the driver rejects the commit.
Before allocating framebuffers,check that the combined
mode bandwidth fits the link and scale down modes if
needed,so stress loop never commits an impossible config.
Signed-off-by: Sowmiya S <sowmiya.s@intel.com>
---
tests/intel/kms_pipe_stress.c | 51 +++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/tests/intel/kms_pipe_stress.c b/tests/intel/kms_pipe_stress.c
index 36e3842c6..84dcba11f 100644
--- a/tests/intel/kms_pipe_stress.c
+++ b/tests/intel/kms_pipe_stress.c
@@ -763,6 +763,8 @@ static void prepare_test(struct data *data)
int i, j;
int num_connectors;
int num_cpus = (int) sysconf(_SC_NPROCESSORS_ONLN);
+ igt_output_t *output;
+ enum pipe pipe = PIPE_A;
data->number_of_cores = min(num_cpus, MAX_CORES);
@@ -820,6 +822,55 @@ static void prepare_test(struct data *data)
data->num_planes[i], i);
}
+ /*
+ * Assign all connected outputs to their pipes and fit the modes
+ * within the available link bandwidth. On shared-link MST
+ * configurations such as a TBT dock (e.g. 2x4K displays)
+ * the combined DP stream bandwidth can exceed the link capacity
+ * and cause subsequent commits to fail with -ENOSPC.
+ * igt_require_mst_link_bw() detects this and selects the highest
+ * modes that fit the link budget; for non-MST setups it is a
+ * no-op. Update data->highest_mode[] before create_framebuffers()
+ * so that FBs are allocated at the BW-constrained dimensions and
+ * the stress loop commits with a mode the driver will accept.
+ */
+ igt_display_reset(display);
+ for_each_connected_output(display, output) {
+ igt_crtc_t *crtc = igt_crtc_for_pipe(display, pipe);
+
+ if (!crtc || !data->highest_mode[pipe]) {
+ if (++pipe >= IGT_MAX_PIPES)
+ break;
+ continue;
+ }
+
+ igt_output_set_crtc(output, crtc);
+ igt_output_override_mode(output, data->highest_mode[pipe]);
+ pipe++;
+ if (pipe >= IGT_MAX_PIPES)
+ break;
+ }
+
+ igt_require_mst_link_bw(display);
+
+ /* Update highest_mode[] with the (possibly fitted) modes. */
+ for_each_connected_output(display, output) {
+ igt_crtc_t *crtc = output->pending_crtc;
+ enum pipe p;
+
+ if (!crtc)
+ continue;
+
+ p = crtc->pipe;
+ if (!data->highest_mode[p])
+ continue;
+
+ data->highest_mode[p] = igt_output_get_mode(output);
+ igt_assert(data->highest_mode[p]);
+ igt_info("Mode for pipe %d after BW fitting:\n", (int)p);
+ kmstest_dump_mode(data->highest_mode[p]);
+ }
+
create_framebuffers(data);
if (intel_gen(intel_get_drm_devid(data->drm_fd)) > 9)
--
2.51.0
next prev parent reply other threads:[~2026-06-29 9:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 9:26 [PATCH i-g-t v4 0/3] Fix 2-display test for MST shared-link BW Sowmiya S
2026-06-29 9:26 ` [PATCH i-g-t v4 1/3] lib/igt_kms: Add MST bandwidth-fitting support and helpers Sowmiya S
2026-06-29 10:02 ` Jani Nikula
2026-06-29 9:26 ` [PATCH i-g-t v4 2/3] tests/kms_plane_multiple: Fix 2-display test for MST shared-link BW Sowmiya S
2026-06-29 9:26 ` Sowmiya S [this message]
2026-06-29 10:05 ` [PATCH i-g-t v4 3/3] tests/intel/kms_pipe_stress: Fit display modes to MST link budget Jani Nikula
2026-06-29 20:37 ` ✓ i915.CI.BAT: success for Fix 2-display test for MST shared-link BW (rev4) Patchwork
2026-06-29 20:48 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-30 4:28 ` ✓ Xe.CI.FULL: " Patchwork
2026-06-30 7:37 ` ✓ 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=20260629092611.298235-4-sowmiya.s@intel.com \
--to=sowmiya.s@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kunal1.joshi@intel.com \
--cc=ramanaidu.naladala@intel.com \
--cc=swati2.sharma@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