All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [v5 i-g-t 05/14] tests/kms_content_protection: Fix mode selection for 2x tests
Date: Sat,  8 May 2021 21:52:54 +0530	[thread overview]
Message-ID: <20210508162303.8235-6-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20210508162303.8235-1-bhanuprakash.modem@intel.com>

When two monitors connected through MST, the second monitor also
tries to use the same mode. So two such modes may not fit into the
link bandwidth.

This patch will find a combination of modes that fit into the BW.

Cc: Imre Deak <imre.deak@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/kms_content_protection.c | 41 +++++++++++++---------------------
 1 file changed, 16 insertions(+), 25 deletions(-)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 5a75b871c..1d1a439a9 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -452,39 +452,18 @@ static bool sink_hdcp2_capable(igt_output_t *output)
 	return strstr(buf, "HDCP2.2");
 }
 
-static void prepare_modeset_on_mst_output(igt_output_t *output, enum pipe pipe)
+static void prepare_modeset_on_mst_output(igt_output_t *output)
 {
-	drmModeConnectorPtr c = output->config.connector;
 	drmModeModeInfo *mode;
 	igt_plane_t *primary;
-	int i, width, height;
+	int width, height;
+	enum pipe pipe = output->pending_pipe;
 
 	mode = igt_output_get_mode(output);
 
-	/*
-	 * TODO: Add logic to use the highest possible modes on each output.
-	 * Currently using 2k modes by default on all the outputs.
-	 */
-	igt_debug("Before mode override: Output %s Mode hdisplay %d Mode vdisplay %d\n",
-		   output->name, mode->hdisplay, mode->vdisplay);
-
-	if (mode->hdisplay > 1920 && mode->vdisplay > 1080) {
-		for (i = 0; i < c->count_modes; i++) {
-			if (c->modes[i].hdisplay <= 1920 && c->modes[i].vdisplay <= 1080) {
-				mode = &c->modes[i];
-				igt_output_override_mode(output, mode);
-				break;
-			}
-		}
-	}
-
-	igt_debug("After mode overide: Output %s Mode hdisplay %d Mode vdisplay %d\n",
-		   output->name, mode->hdisplay, mode->vdisplay);
-
 	width = mode->hdisplay;
 	height = mode->vdisplay;
 
-	igt_output_set_pipe(output, pipe);
 	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 	igt_plane_set_fb(primary, NULL);
 	igt_plane_set_fb(primary, pipe % 2 ? &data.red : &data.green);
@@ -624,7 +603,8 @@ test_content_protection_mst(int content_type)
 
 		igt_assert_f(igt_pipe_connector_valid(pipe, output), "Output-pipe combination invalid\n");
 
-		prepare_modeset_on_mst_output(output, pipe);
+		igt_output_set_pipe(output, pipe);
+		prepare_modeset_on_mst_output(output);
 		mst_output[dp_mst_outputs++] = output;
 
 		pipe++;
@@ -635,6 +615,17 @@ test_content_protection_mst(int content_type)
 
 	igt_require_f(dp_mst_outputs > 1, "No DP MST set up with >= 2 outputs found in a single topology\n");
 
+	if (igt_display_try_commit_atomic(display,
+				DRM_MODE_ATOMIC_TEST_ONLY |
+				DRM_MODE_ATOMIC_ALLOW_MODESET,
+				NULL) != 0) {
+		bool found = igt_override_all_active_output_modes_to_fit_bw(display);
+		igt_require_f(found, "No valid mode combo found for MST modeset\n");
+
+		for (count = 0; count < dp_mst_outputs; count++)
+			prepare_modeset_on_mst_output(mst_output[count]);
+	}
+
 	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
 	igt_require_f(ret == 0, "Commit failure during MST modeset\n");
 
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2021-05-08  8:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08 16:22 [igt-dev] [v5 i-g-t 00/14] Fix mode selection for 2x tests Bhanuprakash Modem
2021-05-08  9:23 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix mode selection for 2x tests (rev5) Patchwork
2021-05-08 10:19 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 01/14] lib/igt_kms: helper to override the mode on all connectors Bhanuprakash Modem
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 02/14] tests/kms_frontbuffer_tracking: Fix mode selection for 2x tests Bhanuprakash Modem
2021-05-11  4:27   ` Nautiyal, Ankit K
2021-05-12  6:37     ` Modem, Bhanuprakash
2021-05-12  6:46       ` Nautiyal, Ankit K
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 03/14] tests/kms_cursor_legacy: " Bhanuprakash Modem
2021-05-11  5:23   ` Nautiyal, Ankit K
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 04/14] tests/debugfs_test: Fix mode selection for MST Bhanuprakash Modem
2021-05-11 10:07   ` Nautiyal, Ankit K
2021-05-08 16:22 ` Bhanuprakash Modem [this message]
2021-05-11  5:54   ` [igt-dev] [v5 i-g-t 05/14] tests/kms_content_protection: Fix mode selection for 2x tests Nautiyal, Ankit K
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 06/14] tests/kms_plane_scaling: " Bhanuprakash Modem
2021-05-11  6:02   ` Nautiyal, Ankit K
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 07/14] tests/kms_atomic_transition: " Bhanuprakash Modem
2021-05-11  9:30   ` Nautiyal, Ankit K
2021-05-11 11:58     ` Modem, Bhanuprakash
2021-05-12  6:19       ` Nautiyal, Ankit K
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 08/14] tests/kms_plane: Reset the state before exiting the test Bhanuprakash Modem
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 09/14] tests/kms_plane_alpha_blend: " Bhanuprakash Modem
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 10/14] tests/kms_cursor_edge_walk: " Bhanuprakash Modem
2021-05-08 16:23 ` [igt-dev] [v5 i-g-t 11/14] tests/kms_plane_lowres: " Bhanuprakash Modem
2021-05-08 16:23 ` [igt-dev] [v5 i-g-t 12/14] tests/kms_plane_cursor: " Bhanuprakash Modem
2021-05-08 16:23 ` [igt-dev] [v5 i-g-t 13/14] tests/kms_flip_scaled_crc: " Bhanuprakash Modem
2021-05-08 16:23 ` [igt-dev] [v5 i-g-t 14/14] tests/kms_vblank: " Bhanuprakash Modem

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=20210508162303.8235-6-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@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.