Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jeevan B <jeevan.b@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: kunal1.joshi@intel.com, Jeevan B <jeevan.b@intel.com>
Subject: [PATCH i-g-t] tests/kms_display_modes: Fit modes within MST bandwidth constraints
Date: Mon, 24 Mar 2025 15:14:19 +0530	[thread overview]
Message-ID: <20250324094419.1180224-1-jeevan.b@intel.com> (raw)

Instead of checking only the current modes, find a combination of
modes in the MST topology that can be accommodated within the
available link bandwidth.

Fixes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1542
Signed-off-by: Jeevan B <jeevan.b@intel.com>
---
 tests/kms_display_modes.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tests/kms_display_modes.c b/tests/kms_display_modes.c
index 588820170..d1083f470 100644
--- a/tests/kms_display_modes.c
+++ b/tests/kms_display_modes.c
@@ -49,6 +49,22 @@ typedef struct {
 	int n_pipes;
 } data_t;
 
+static bool fit_modes_in_bw(data_t *data)
+{
+	bool found;
+	int ret;
+
+	ret = igt_display_try_commit_atomic(&data->display,
+					    DRM_MODE_ATOMIC_TEST_ONLY |
+					    DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+	if (ret != 0) {
+		found = igt_override_all_active_output_modes_to_fit_bw(&data->display);
+		igt_require_f(found,
+			      "No valid mode combo found for modeset\n");
+	}
+	return true;
+}
+
 static bool output_is_dp_mst(data_t *data, igt_output_t *output, int i)
 {
 	int connector_id;
@@ -93,6 +109,8 @@ static void run_extendedmode_basic(data_t *data,
 	mode[0] = igt_output_get_mode(output1);
 	mode[1] = igt_output_get_mode(output2);
 
+	igt_assert(fit_modes_in_bw(data));
+
 	pipe_crc[0] = igt_pipe_crc_new(data->drm_fd, pipe1, IGT_PIPE_CRC_SOURCE_AUTO);
 	pipe_crc[1] = igt_pipe_crc_new(data->drm_fd, pipe2, IGT_PIPE_CRC_SOURCE_AUTO);
 
@@ -138,6 +156,7 @@ static void run_extendedmode_basic(data_t *data,
 	igt_fb_set_size(&fb, plane[1], mode[1]->hdisplay, mode[1]->vdisplay);
 	igt_plane_set_size(plane[1], mode[1]->hdisplay, mode[1]->vdisplay);
 
+	igt_assert(fit_modes_in_bw(data));
 	igt_display_commit2(display, COMMIT_ATOMIC);
 
 	igt_pipe_crc_collect_crc(pipe_crc[0], &crc[0]);
@@ -158,6 +177,7 @@ static void run_extendedmode_basic(data_t *data,
 			  DRM_PLANE_TYPE_PRIMARY), NULL);
 	igt_plane_set_fb(igt_pipe_get_plane_type(&display->pipes[pipe2],
 			  DRM_PLANE_TYPE_PRIMARY), NULL);
+	igt_assert(fit_modes_in_bw(data));
 	igt_display_commit2(display, COMMIT_ATOMIC);
 
 	/*Compare CRC*/
-- 
2.25.1


             reply	other threads:[~2025-03-24  9:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24  9:44 Jeevan B [this message]
2025-03-24 21:45 ` ✓ Xe.CI.BAT: success for tests/kms_display_modes: Fit modes within MST bandwidth constraints Patchwork
2025-03-24 22:02 ` ✓ i915.CI.BAT: " Patchwork
2025-03-25  0:34 ` ✗ Xe.CI.Full: failure " Patchwork
2025-03-25  3:11 ` ✗ i915.CI.Full: " Patchwork
2025-03-25  7:56 ` [PATCH i-g-t] " Sharma, Swati2
  -- strict thread matches above, loose matches on Subject: below --
2025-03-28  8:57 Jeevan B
2025-04-01  6:22 ` Sharma, Swati2
2025-04-03 10:53 Jeevan B
2025-04-04  9:12 ` Reddy Guddati, Santhosh
2025-04-10  7:25   ` B, Jeevan
2025-04-04 16:15 ` Thasleem, Mohammed
2025-04-16  9:47 Jeevan B
2025-04-30  9:46 Jeevan B
2025-05-05  4:25 ` Reddy Guddati, Santhosh
2025-05-05 16:12 Jeevan B
2025-05-06  8:30 ` Thasleem, Mohammed

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=20250324094419.1180224-1-jeevan.b@intel.com \
    --to=jeevan.b@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kunal1.joshi@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