From: Sowmiya S <sowmiya.s@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: swati2.sharma@intel.com, kunal1.joshi@intel.com,
Sowmiya S <sowmiya.s@intel.com>
Subject: [PATCH i-g-t v2 1/2] lib/igt_kms: Add MST bandwidth-fitting support and helpers
Date: Wed, 29 Apr 2026 15:51:24 +0530 [thread overview]
Message-ID: <20260429102125.2313449-2-sowmiya.s@intel.com> (raw)
In-Reply-To: <20260429102125.2313449-1-sowmiya.s@intel.com>
Add helpers to handle shared-link DP bandwidth fitting for
MST/daisy-chain configurations.
On MST hubs/daisy-chains multiple streams share one DP link
and a joint atomic commit can be rejected unless modes are
chosen to fit the link BW. This will centralizes MST detection
and fitting so tests can request fitting only when required.
v2: Remove the flag used for caching values and update the
function name to better describe its functionality (Jani)
Signed-off-by: Sowmiya S <sowmiya.s@intel.com>
---
lib/igt_kms.c | 37 +++++++++++++++++++++++++++++++++++++
lib/igt_kms.h | 2 ++
2 files changed, 39 insertions(+)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 2efdfb85f..b6582fcbe 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2744,6 +2744,7 @@ static void igt_output_reset(igt_output_t *output)
{
output->pending_crtc = NULL;
output->use_override_mode = false;
+ output->bw_fit_applied = false;
memset(&output->override_mode, 0, sizeof(output->override_mode));
igt_output_set_prop_value(output, IGT_CONNECTOR_CRTC_ID, 0);
@@ -5376,6 +5377,7 @@ bool __override_all_active_output_modes_to_fit_bw(igt_display_t *display,
int ret;
igt_output_override_mode(output, mode);
+ output->bw_fit_applied = true;
if (__override_all_active_output_modes_to_fit_bw(display, outputs, n_outputs, base + 1))
return true;
@@ -5445,6 +5447,11 @@ bool igt_fit_modes_in_bw(igt_display_t *display)
{
int ret;
+ igt_output_t *output;
+
+ for_each_output(display, output)
+ output->bw_fit_applied = false;
+
if (display->is_atomic)
ret = igt_display_try_commit_atomic(display,
DRM_MODE_ATOMIC_TEST_ONLY |
@@ -5465,6 +5472,36 @@ bool igt_fit_modes_in_bw(igt_display_t *display)
return true;
}
+/**
+ * igt_require_mst_link_bw:
+ * @display: a pointer to an #igt_display_t structure
+ *
+ * When two or more DP-MST streams share the same upstream link, a joint
+ * atomic commit may be rejected by the driver if the combined stream
+ * bandwidth exceeds the link capacity. This function detects that
+ * situation and, when found, calls igt_fit_modes_in_bw() to select mode
+ * overrides that satisfy the shared-link BW budget. The test is skipped
+ * if no valid combination can be found. No-op when fewer than two active
+ * MST streams are present.
+ */
+void igt_require_mst_link_bw(igt_display_t *display)
+{
+ igt_output_t *output;
+ int active_mst = 0;
+
+ for_each_output(display, output) {
+ if (output->pending_crtc &&
+ igt_check_output_is_dp_mst(output))
+ active_mst++;
+ }
+
+ if (active_mst < 2)
+ return;
+
+ igt_require_f(igt_fit_modes_in_bw(display),
+ "No valid mode combination fits available MST link BW\n");
+}
+
/**
* igt_crtc_refresh:
* @crtc: CRTC to refresh
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index fcbb6a5ad..f8ba1a11e 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -506,6 +506,7 @@ typedef struct {
/* bitmask of changed properties */
uint64_t changed;
+ bool bw_fit_applied;
uint32_t props[IGT_NUM_CONNECTOR_PROPS];
uint64_t values[IGT_NUM_CONNECTOR_PROPS];
@@ -1286,6 +1287,7 @@ drmModePropertyBlobRes *igt_get_writeback_formats_blob(igt_output_t *output);
uint64_t igt_get_writeback_fb_id(igt_output_t *output);
void igt_detach_crtc(igt_display_t *display, igt_output_t *output);
void igt_get_and_wait_out_fence(igt_output_t *output);
+void igt_require_mst_link_bw(igt_display_t *display);
igt_colorop_t *igt_find_colorop(igt_display_t *display, uint32_t id);
--
2.48.1
next prev parent reply other threads:[~2026-04-29 10:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 10:21 [PATCH i-g-t v2 0/2] Fix 2-display test for MST shared-link BW Sowmiya S
2026-04-29 10:21 ` Sowmiya S [this message]
2026-04-29 10:21 ` [PATCH i-g-t v2 2/2] tests/kms_plane_multiple: " Sowmiya S
2026-04-29 14:41 ` ✓ i915.CI.BAT: success for Fix 2-display test for MST shared-link BW (rev2) Patchwork
2026-04-29 15:23 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-30 0:19 ` ✗ i915.CI.Full: failure " Patchwork
2026-04-30 1:49 ` ✗ Xe.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=20260429102125.2313449-2-sowmiya.s@intel.com \
--to=sowmiya.s@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kunal1.joshi@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