[PATCH i-g-t v2 3/3] tests/kms_joiner: Add subtests for force ultra joiner validation
Karthik B S
karthik.b.s at intel.com
Wed Sep 11 07:22:04 UTC 2024
Extend the ultrajoiner subtests to validate ultrajoiner on a non
ultrajoiner supported display using force joiner.
Signed-off-by: Karthik B S <karthik.b.s at intel.com>
---
tests/intel/kms_joiner.c | 105 +++++++++++++++++++++++++++++++++------
1 file changed, 89 insertions(+), 16 deletions(-)
diff --git a/tests/intel/kms_joiner.c b/tests/intel/kms_joiner.c
index 13863d5e1..07b49fb08 100644
--- a/tests/intel/kms_joiner.c
+++ b/tests/intel/kms_joiner.c
@@ -51,15 +51,24 @@
* SUBTEST: basic-ultra-joiner
* Description: Verify the basic modeset on ultra joiner mode on all pipes
*
- * SUBTEST: invalid-modeset-force-joiner
- * Description: Verify if modeset on adjacent pipe is declined when force joiner modeset is active.
- * Force joiner applies bigjoiner functionality to non-bigjoiner outputs,
+ * SUBTEST: invalid-modeset-force-big-joiner
+ * Description: Verify if modeset on adjacent pipe is declined when force big joiner modeset is active.
+ * Force big joiner applies bigjoiner functionality to non-bigjoiner outputs,
* so test exclusively targets non-bigjoiner outputs.
*
- * SUBTEST: basic-force-joiner
- * Description: Verify basic modeset in force joiner mode across all pipes.
+ * SUBTEST: basic-force-big-joiner
+ * Description: Verify basic big joiner modeset in force joiner mode across all pipes.
* Force joiner applies bigjoiner functionality to non-bigjoiner outputs thus,
* the test exclusively targets non-bigjoiner outputs.
+ *
+ * SUBTEST: basic-force-ultra-joiner
+ * Description: Verify basic ultra joiner modeset in force joiner mode across all pipes.
+ * Force joiner applies bigjoiner functionality to non-bigjoiner outputs thus,
+ * the test exclusively targets non-bigjoiner outputs.
+ *
+ * SUBTEST: invalid-modeset-force-ultra-joiner
+ * Description: Verify if the modeset on the other pipes are rejected when
+ * the pipe A is active with force ultra joiner modeset.
*/
IGT_TEST_DESCRIPTION("Test joiner / force joiner");
@@ -111,6 +120,19 @@ static void enable_force_joiner_on_all_non_big_joiner_outputs(data_t *data)
}
}
+static void enable_force_joiner_on_all_non_ultra_joiner_outputs(data_t *data)
+{
+ bool status;
+ igt_output_t *output;
+ int i;
+
+ for (i = 0; i < data->non_ultra_joiner_output_count; i++) {
+ output = data->non_ultra_joiner_output[i];
+ status = kmstest_force_connector_joiner(data->drm_fd, output->config.connector, 4);
+ igt_assert_f(status, "Failed to toggle force joiner\n");
+ }
+}
+
static enum pipe get_next_master_pipe(data_t *data, uint32_t available_pipe_mask)
{
if ((data->master_pipes & available_pipe_mask) == 0)
@@ -297,23 +319,36 @@ static void test_joiner_on_last_pipe(data_t *data, bool force_joiner)
}
}
-static void test_ultra_joiner(data_t *data, bool invalid_pipe, bool two_display)
+static void test_ultra_joiner(data_t *data, bool invalid_pipe, bool two_display, bool force_joiner)
{
- int i, j, k, ret;
+ int i, j, k, ret, count;
igt_output_t *output, *non_ultra_joiner_output;
igt_plane_t *primary;
igt_output_t **outputs;
igt_fb_t fb;
drmModeModeInfo mode;
- outputs = data->ultra_joiner_output;
+ if (force_joiner) {
+ outputs = data->non_ultra_joiner_output;
+ count = data->non_ultra_joiner_output_count;
+ } else {
+ outputs = data->ultra_joiner_output;
+ count = data->ultra_joiner_output_count;
+ }
+
igt_display_reset(&data->display);
igt_display_commit2(&data->display, COMMIT_ATOMIC);
- for (i = 0; i < data->ultra_joiner_output_count; i++) {
+ for (i = 0; i < count; i++) {
output = outputs[i];
- igt_require(ultrajoiner_mode_found(data->drm_fd, output->config.connector, max_dotclock, &mode));
- igt_output_override_mode(output, &mode);
+
+ if (!force_joiner) {
+ igt_require(ultrajoiner_mode_found(data->drm_fd, output->config.connector, max_dotclock, &mode));
+ igt_output_override_mode(output, &mode);
+ } else {
+ mode = *igt_output_get_mode(output);
+ }
+
for (j = 0; j < data->n_pipes; j++) {
/* Ultra joiner is only valid on PIPE_A */
if (invalid_pipe && j == PIPE_A)
@@ -461,7 +496,7 @@ igt_main
igt_require_f(data.n_pipes > 3,
"Minimum 4 pipes required\n");
igt_dynamic_f("single-joiner")
- test_ultra_joiner(&data, false, false);
+ test_ultra_joiner(&data, false, false, false);
}
igt_describe("Verify if the modeset on the adjoining pipe is rejected "
@@ -487,15 +522,15 @@ igt_main
igt_require_f(data.n_pipes > 3, "Minimum of 4 pipes are required\n");
igt_dynamic_f("ultra_joiner_on_invalid_pipe")
- test_ultra_joiner(&data, true, false);
+ test_ultra_joiner(&data, true, false, false);
if (data.non_ultra_joiner_output_count > 0) {
igt_dynamic_f("2x")
- test_ultra_joiner(&data, false, true);
+ test_ultra_joiner(&data, false, true, false);
}
}
igt_describe("Verify the basic modeset on big joiner mode on all pipes");
- igt_subtest_with_dynamic("basic-force-joiner") {
+ igt_subtest_with_dynamic("basic-force-big-joiner") {
igt_require_f(force_joiner_supported,
"force joiner not supported on this platform or none of the connected output supports it\n");
igt_require_f(data.non_big_joiner_output_count > 0,
@@ -516,7 +551,7 @@ igt_main
}
}
- igt_subtest_with_dynamic("invalid-modeset-force-joiner") {
+ igt_subtest_with_dynamic("invalid-modeset-force-big-joiner") {
igt_require_f(force_joiner_supported,
"force joiner not supported on this platform or none of the connected output supports it\n");
igt_require_f(data.non_big_joiner_output_count > 0,
@@ -539,6 +574,44 @@ igt_main
}
}
+ igt_describe("Verify the basic modeset on ultra joiner mode on all pipes");
+ igt_subtest_with_dynamic("basic-force-ultra-joiner") {
+ igt_require_f(force_joiner_supported,
+ "force joiner not supported on this platform or none of the connected output supports it\n");
+ igt_require_f(data.non_ultra_joiner_output_count > 0,
+ "No non ultra joiner output found\n");
+ igt_require_f(data.n_pipes > 3,
+ "Minimum 4 pipes required\n");
+ igt_dynamic_f("single") {
+ enable_force_joiner_on_all_non_ultra_joiner_outputs(&data);
+ test_ultra_joiner(&data, false, false, true);
+ igt_reset_connectors();
+ }
+ }
+
+ igt_subtest_with_dynamic("invalid-modeset-force-ultra-joiner") {
+ igt_require_f(force_joiner_supported,
+ "force joiner not supported on this platform or none of the connected output supports it\n");
+ igt_require_f(data.non_ultra_joiner_output_count > 0,
+ "Non ultra joiner output not found\n");
+ igt_require_f(data.n_pipes > 3,
+ "Minimum of 3 pipes are required\n");
+
+ igt_dynamic_f("ultra_joiner_on_invalid_pipe") {
+ enable_force_joiner_on_all_non_ultra_joiner_outputs(&data);
+ test_ultra_joiner(&data, true, false, true);
+ igt_reset_connectors();
+ }
+
+ if (data.non_ultra_joiner_output_count > 1) {
+ igt_dynamic_f("2x") {
+ enable_force_joiner_on_all_non_ultra_joiner_outputs(&data);
+ test_ultra_joiner(&data, false, true, true);
+ igt_reset_connectors();
+ }
+ }
+ }
+
igt_fixture {
igt_display_fini(&data.display);
drm_close_driver(data.drm_fd);
--
2.39.1
More information about the igt-dev
mailing list