From: Jeevan B <jeevan.b@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: karthik.b.s@intel.com, Jeevan B <jeevan.b@intel.com>
Subject: [PATCH i-g-t] tests/intel/kms_joiner: Add a new test to validate non-joiner mode
Date: Sun, 26 Jan 2025 23:49:31 +0530 [thread overview]
Message-ID: <20250126181931.3356853-1-jeevan.b@intel.com> (raw)
We need to ensure that the system does not use a joiner for modes that do
not require it. This test will validate that the correct non-joiner mode
is selected, and then forcing a modeset and flip on the last pipe. If the
joiner is mistakenly enabled for a non-joiner mode, the test should fail.
otherwise, the commit should proceed as expected.
v2: Fix nonjoiner_mode_found to find the required case(6K@30).
Remove clk sort and minor fixes. (Karthik)
Signed-off-by: Jeevan B <jeevan.b@intel.com>
---
tests/intel/kms_joiner.c | 78 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
diff --git a/tests/intel/kms_joiner.c b/tests/intel/kms_joiner.c
index 086cfeb71..3d9fa095b 100644
--- a/tests/intel/kms_joiner.c
+++ b/tests/intel/kms_joiner.c
@@ -74,6 +74,9 @@
*
* SUBTEST: switch-modeset-ultra-joiner-big-joiner
* Description: Verify switching between ultra joiner and big joiner modeset.
+ *
+ * SUBTEST: basic-non-joiner
+ * Description: Vefiry basic non-joiner mode across all pipes.
*/
IGT_TEST_DESCRIPTION("Test joiner / force joiner");
@@ -85,6 +88,7 @@ typedef struct {
int ultra_joiner_output_count;
int non_big_joiner_output_count;
int non_ultra_joiner_output_count;
+ int nonjoiner_output_count;
int mixed_output_count;
int output_count;
int n_pipes;
@@ -94,6 +98,7 @@ typedef struct {
igt_output_t *non_big_joiner_output[IGT_MAX_PIPES];
igt_output_t *non_ultra_joiner_output[IGT_MAX_PIPES];
igt_output_t *mixed_output[IGT_MAX_PIPES];
+ igt_output_t *nonjoiner_output[IGT_MAX_PIPES];
enum pipe pipe_seq[IGT_MAX_PIPES];
igt_display_t display;
} data_t;
@@ -164,6 +169,23 @@ static enum pipe setup_pipe(data_t *data, igt_output_t *output, enum pipe pipe,
return master_pipe;
}
+static bool nonjoiner_mode_found(int drm_fd, drmModeConnector *connector,
+ drmModeModeInfo *mode)
+{
+ igt_sort_connector_modes(connector, sort_drm_modes_by_res_dsc);
+
+ for (int i = 0; i < connector->count_modes; i++) {
+ drmModeModeInfo *current_mode = &connector->modes[i];
+
+ if ((current_mode->hdisplay == 6144 && current_mode->vrefresh == 30) ||
+ mode->clock < max_dotclock) {
+ *mode = *current_mode;
+ return true;
+ }
+ }
+ return false;
+}
+
static void set_joiner_mode(data_t *data, igt_output_t *output, drmModeModeInfo *mode)
{
igt_plane_t *primary;
@@ -491,6 +513,48 @@ static void test_ultra_joiner(data_t *data, bool invalid_pipe, bool two_display,
}
}
+static void test_single_non_joiner(data_t *data)
+{
+ int count;
+ igt_output_t **outputs, *output;
+ igt_fb_t fb;
+ igt_plane_t *primary;
+ drmModeModeInfo mode;
+ drmModeConnector *con;
+
+ count = data->nonjoiner_output_count;
+ outputs = data->nonjoiner_output;
+ igt_display_reset(&data->display);
+ igt_display_commit2(&data->display, COMMIT_ATOMIC);
+
+ for (int i = 0; i < count; i++) {
+ output = outputs[i];
+ con = output->config.connector;
+
+ if (nonjoiner_mode_found(data->drm_fd, con, &mode)) {
+ igt_output_override_mode(output, &mode);
+ igt_info("Assigning pipe %s to %s with mode %dx%d@%d\n",
+ kmstest_pipe_name(data->pipe_seq[data->n_pipes - 1]),
+ igt_output_name(output), mode.hdisplay,
+ mode.vdisplay, mode.vrefresh);
+
+ igt_output_set_pipe(output, data->pipe_seq[data->n_pipes - 1]);
+
+ primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+
+ igt_create_pattern_fb(data->drm_fd, mode.hdisplay, mode.vdisplay, DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_MOD_LINEAR, &fb);
+
+ igt_plane_set_fb(primary, &fb);
+ igt_assert(igt_display_try_commit2(&data->display, COMMIT_ATOMIC));
+ igt_plane_set_fb(primary, NULL);
+ igt_remove_fb(data->drm_fd, &fb);
+ } else {
+ igt_warn("No valid non-joiner mode found for output %s\n", igt_output_name(output));
+ }
+ }
+}
+
igt_main
{
bool ultra_joiner_supported, is_dgfx;
@@ -505,6 +569,7 @@ igt_main
data.ultra_joiner_output_count = 0;
data.non_big_joiner_output_count = 0;
data.non_ultra_joiner_output_count = 0;
+ data.nonjoiner_output_count = 0;
data.mixed_output_count = 0;
data.output_count = 0;
j = 0;
@@ -523,6 +588,7 @@ igt_main
for_each_connected_output(&data.display, output) {
bool ultrajoiner_found = false, bigjoiner_found = false, force_joiner_supported = false;
+ bool nonjoiner_found = false;
drmModeConnector *connector = output->config.connector;
/*
@@ -533,6 +599,7 @@ igt_main
*/
bigjoiner_found = bigjoiner_mode_found(data.drm_fd, connector, max_dotclock, &mode);
ultrajoiner_found = ultrajoiner_mode_found(data.drm_fd, connector, max_dotclock, &mode);
+ nonjoiner_found = nonjoiner_mode_found(data.drm_fd, connector, &mode);
if (igt_has_force_joiner_debugfs(data.drm_fd, output->name))
force_joiner_supported = true;
@@ -548,6 +615,9 @@ igt_main
else if (force_joiner_supported)
data.non_big_joiner_output[data.non_big_joiner_output_count++] = output;
+ if (nonjoiner_found)
+ data.nonjoiner_output[data.nonjoiner_output_count++] = output;
+
data.output_count++;
}
if (data.big_joiner_output_count == 1 && data.non_big_joiner_output_count >= 1) {
@@ -713,6 +783,14 @@ igt_main
}
}
+ igt_describe("Verify the basic modeset on big joiner mode on all pipes");
+ igt_subtest_with_dynamic("basic-non-joiner") {
+ igt_require_f(data.n_pipes >= 1,
+ "Minimum of 1 pipes are required\n");
+ igt_dynamic_f("non-joiner")
+ test_single_non_joiner(&data);
+ }
+
igt_fixture {
igt_display_fini(&data.display);
drm_close_driver(data.drm_fd);
--
2.25.1
next reply other threads:[~2025-01-26 18:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-26 18:19 Jeevan B [this message]
2025-01-26 19:27 ` ✓ Xe.CI.BAT: success for tests/intel/kms_joiner: Add a new test to validate non-joiner mode Patchwork
2025-01-26 19:44 ` ✓ i915.CI.BAT: " Patchwork
2025-01-26 20:35 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-26 22:04 ` ✗ i915.CI.Full: " Patchwork
2025-01-27 5:50 ` [PATCH i-g-t] " B, Jeevan
2025-01-27 8:56 ` Karthik B S
2025-01-28 6:30 ` Sharma, Swati2
-- strict thread matches above, loose matches on Subject: below --
2025-01-29 17:17 Jeevan B
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=20250126181931.3356853-1-jeevan.b@intel.com \
--to=jeevan.b@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=karthik.b.s@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