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 2/3] lib/igt_kms: Fix max_non_joiner_mode_found
Date: Fri, 20 Feb 2026 20:52:38 +0530 [thread overview]
Message-ID: <20260220152239.276034-3-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20260220152239.276034-1-kunal1.joshi@intel.com>
The function previously required hdisplay == max_pipe_hdisplay (5120 on
pre-Gen30), which means it returned false for any connector whose maximum
resolution is below the pipe limit (e.g. a 4K MST output on a 5K-capable
platform).
Fix this by iterating all modes and tracking the best one (highest
hdisplay, then highest clock as a tiebreaker) that does not require a
big joiner, as determined by igt_bigjoiner_possible(). This correctly
handles connectors with any max resolution.
Fixes: 3830ca6a5068 ("lib/igt_kms: Add support to check joiner mode limit")
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
lib/igt_kms.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 5c4879604..c6678b02b 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6904,19 +6904,24 @@ bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
bool max_non_joiner_mode_found(int drm_fd, drmModeConnector *connector,
int max_dotclock, drmModeModeInfo *mode)
{
- int max_hdisplay = get_max_pipe_hdisplay(drm_fd);
+ bool found = false;
for (int i = 0; i < connector->count_modes; i++) {
drmModeModeInfo *current_mode = &connector->modes[i];
- if (current_mode->hdisplay == max_hdisplay &&
- current_mode->clock < max_dotclock) {
+ if (igt_bigjoiner_possible(drm_fd, current_mode, max_dotclock))
+ continue;
+
+ if (!found ||
+ current_mode->hdisplay > mode->hdisplay ||
+ (current_mode->hdisplay == mode->hdisplay &&
+ current_mode->clock > mode->clock)) {
*mode = *current_mode;
- return true;
+ found = true;
}
}
- return false;
+ return found;
}
/* TODO: Move these lib functions to the joiner-specific library file
--
2.43.0
next prev parent reply other threads:[~2026-02-20 15:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 15:22 [PATCH 0/3] tests/kms_pipe_crc_basic: add mst suspend-resume test Kunal Joshi
2026-02-20 15:22 ` [PATCH i-g-t 1/3] tests/intel/kms_mst_helper: Add helper to check for MST outputs Kunal Joshi
2026-02-23 17:40 ` Thasleem, Mohammed
2026-02-26 4:02 ` Kandpal, Suraj
2026-02-20 15:22 ` Kunal Joshi [this message]
2026-02-24 10:30 ` [PATCH i-g-t 2/3] lib/igt_kms: Fix max_non_joiner_mode_found Thasleem, Mohammed
2026-02-26 4:26 ` Kandpal, Suraj
2026-02-20 15:22 ` [PATCH i-g-t 3/3] tests/kms_pipe_crc_basic: Add MST suspend-resume test Kunal Joshi
2026-02-24 8:35 ` Thasleem, Mohammed
2026-02-24 10:27 ` Thasleem, Mohammed
2026-03-03 6:18 ` Kandpal, Suraj
2026-03-10 4:49 ` Kandpal, Suraj
2026-03-10 4:53 ` Kandpal, Suraj
2026-02-20 18:31 ` ✓ Xe.CI.BAT: success for tests/kms_pipe_crc_basic: add mst suspend-resume test (rev4) Patchwork
2026-02-20 19:02 ` ✓ i915.CI.BAT: " Patchwork
2026-02-21 4:26 ` ✗ i915.CI.Full: failure " Patchwork
2026-02-21 8:38 ` ✗ 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=20260220152239.276034-3-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox