All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 0/4] revamp big joiner test
@ 2024-03-28  8:39 Kunal Joshi
  2024-03-28  8:39 ` [PATCH i-g-t 1/4] lib/igt_kms: move bigjoiner_mode_found to lib Kunal Joshi
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Kunal Joshi @ 2024-03-28  8:39 UTC (permalink / raw)
  To: igt-dev; +Cc: Kunal Joshi

modify test to support multiple big joiner outputs
simultaneously, support for ignoring fused pipes and
addition of subtests for testing force joiner support for
which is added by below in kmd.

drm/i915: Add bigjoiner force enable option to debugfs

Kunal Joshi (4):
  lib/igt_kms: move bigjoiner_mode_found to lib
  tests/intel/kms_big_joiner: revamp bigjoiner
  lib/igt_kms: add helper to enable/disable force joiner
  tests/intel/kms_big_joiner: add tests for force joiner

 lib/igt_kms.c                |  79 ++++++
 lib/igt_kms.h                |   4 +
 tests/intel/kms_big_joiner.c | 477 ++++++++++++++++++++---------------
 3 files changed, 359 insertions(+), 201 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH i-g-t 1/4] lib/igt_kms: move bigjoiner_mode_found to lib
  2024-03-28  8:39 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
@ 2024-03-28  8:39 ` Kunal Joshi
  2024-03-28  8:39 ` [PATCH i-g-t 2/4] tests/intel/kms_big_joiner: revamp bigjoiner Kunal Joshi
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Kunal Joshi @ 2024-03-28  8:39 UTC (permalink / raw)
  To: igt-dev
  Cc: Kunal Joshi, Stanislav Lisovskiy, Ankit Nautiyal, Karthik B S,
	Bhanuprakash Modem

move bigjoiner_mode_found to lib

v2: correct documentation (Ankit)
    fix usage of mode (Ankit)
v3: state mode is filled in doc (Ankit)

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 lib/igt_kms.c                | 28 ++++++++++++++++++++++++++++
 lib/igt_kms.h                |  2 ++
 tests/intel/kms_big_joiner.c | 14 +-------------
 3 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e18f6fe59..548c9d1f3 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6143,6 +6143,34 @@ bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock)
 		mode->clock > max_dotclock);
 }
 
+/**
+ * bigjoiner_mode_found:
+ * @drm_fd: drm file descriptor
+ * @connector: libdrm connector
+ * @max_dot_clock: max dot clock frequency
+ * @mode: libdrm mode to be filled
+ *
+ * Bigjoiner will come in to the picture when the
+ * resolution > 5K or clock > max-dot-clock.
+ *
+ * Returns: True if big joiner found in connector modes
+ */
+bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
+			  int max_dotclock, drmModeModeInfo *mode)
+{
+	bool found = false;
+
+	igt_sort_connector_modes(connector, sort_drm_modes_by_res_dsc);
+	found = igt_bigjoiner_possible(&connector->modes[0], max_dotclock);
+	if (!found) {
+		igt_sort_connector_modes(connector, sort_drm_modes_by_clk_dsc);
+		found = igt_bigjoiner_possible(&connector->modes[0], max_dotclock);
+	}
+	if (found)
+		*mode = connector->modes[0];
+	return found;
+}
+
 /**
  * igt_check_bigjoiner_support:
  * @display: a pointer to an #igt_display_t structure
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index b3882808b..0fa7a2ea1 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1212,6 +1212,8 @@ bool igt_max_bpc_constraint(igt_display_t *display, enum pipe pipe,
 		igt_output_t *output, int bpc);
 int igt_get_max_dotclock(int fd);
 bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
+bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
+			  int max_dotclock, drmModeModeInfo *mode);
 bool igt_check_bigjoiner_support(igt_display_t *display);
 bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
 bool intel_pipe_output_combo_valid(igt_display_t *display);
diff --git a/tests/intel/kms_big_joiner.c b/tests/intel/kms_big_joiner.c
index aba2adfbe..99b1b898d 100644
--- a/tests/intel/kms_big_joiner.c
+++ b/tests/intel/kms_big_joiner.c
@@ -199,16 +199,6 @@ static void test_dual_display(data_t *data)
 	igt_display_commit2(display, COMMIT_ATOMIC);
 }
 
-static bool bigjoiner_mode_found(drmModeConnector *connector,
-				 int (*sort_method)(const void *, const void*),
-				 drmModeModeInfo *mode)
-{
-	igt_sort_connector_modes(connector, sort_method);
-	*mode = connector->modes[0];
-
-	return igt_bigjoiner_possible(mode, max_dotclock);
-}
-
 igt_main
 {
 	data_t data;
@@ -235,9 +225,7 @@ igt_main
 			 * Bigjoiner will come in to the picture when the
 			 * resolution > 5K or clock > max-dot-clock.
 			 */
-			found = (bigjoiner_mode_found(connector, sort_drm_modes_by_res_dsc, &mode) ||
-				 bigjoiner_mode_found(connector, sort_drm_modes_by_clk_dsc, &mode)) ?
-					true : false;
+			found = bigjoiner_mode_found(data.drm_fd, connector, max_dotclock, &mode);
 
 			if (found) {
 				data.output[count].output_id = output->id;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH i-g-t 2/4] tests/intel/kms_big_joiner: revamp bigjoiner
  2024-03-28  8:39 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
  2024-03-28  8:39 ` [PATCH i-g-t 1/4] lib/igt_kms: move bigjoiner_mode_found to lib Kunal Joshi
@ 2024-03-28  8:39 ` Kunal Joshi
  2024-03-28  9:18   ` Nautiyal, Ankit K
  2024-03-28  8:39 ` [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner Kunal Joshi
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Kunal Joshi @ 2024-03-28  8:39 UTC (permalink / raw)
  To: igt-dev
  Cc: Kunal Joshi, Stanislav Lisovskiy, Ankit Nautiyal, Karthik B S,
	Bhanuprakash Modem

modify test to support simultaneously testing multiple bigjoiner
output and ignoring fused off pipes.

v2: Don't change license (Bhanu)
    Print the pipe name (Bhanu)
    Remove unwanted commit (Bhanu)
    Move combine output logic to igt_fixture (Bhanu)
    split revamp and force joiner (Bhanu)

v3: Ignored fused pipes (Stan)

v4: Ignore master pipes who doesn't have slave (Ankit)
    Retain subtest names (Ankit)
    Use commit instead of try_commit (Ankit)
    Fix typo (Ankit)

v5: Fix condition and remove last pipe (Ankit)
    Remove nested if (Ankit)
    Use pointer to output instead of id (Ankit)
    Add missing igt_describe (Ankit)

v6: Use uint_32 (Ankit)
    Cosmetic changes (Ankit)

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
 tests/intel/kms_big_joiner.c | 402 ++++++++++++++++++-----------------
 1 file changed, 207 insertions(+), 195 deletions(-)

diff --git a/tests/intel/kms_big_joiner.c b/tests/intel/kms_big_joiner.c
index 99b1b898d..bc4facead 100644
--- a/tests/intel/kms_big_joiner.c
+++ b/tests/intel/kms_big_joiner.c
@@ -44,177 +44,236 @@
  * SUBTEST: basic
  * Description: Verify the basic modeset on big joiner mode on all pipes
  *
- * SUBTEST: 2x-modeset
- * Description: Verify simultaneous modeset on 2 big joiner outputs
  */
 
 IGT_TEST_DESCRIPTION("Test big joiner");
 
-struct bigjoiner_output {
-	uint32_t output_id;
-	drmModeModeInfo mode;
-};
+#define INVALID_TEST_OUTPUT 2
 
 typedef struct {
 	int drm_fd;
-	igt_display_t display;
-	struct igt_fb fb;
+	int big_joiner_output_count;
+	int non_big_joiner_output_count;
+	int mixed_output_count;
+	int output_count;
 	int n_pipes;
-	enum pipe pipe1;
-	enum pipe pipe2;
-	struct bigjoiner_output output[2];
+	uint32_t master_pipes;
+	igt_output_t *big_joiner_output[IGT_MAX_PIPES];
+	igt_output_t *non_big_joiner_output[IGT_MAX_PIPES];
+	igt_output_t *mixed_output[IGT_MAX_PIPES];
+	enum pipe pipe_seq[IGT_MAX_PIPES];
+	igt_display_t display;
 } data_t;
 
 static int max_dotclock;
 
-static void test_invalid_modeset(data_t *data)
+static void set_all_master_pipes_for_platform(data_t *data)
 {
-	igt_output_t *output;
-	igt_display_t *display = &data->display;
-	int ret;
+	enum pipe pipe;
 
-	igt_info("Bigjoiner test on ");
-	for_each_connected_output(display, output){
-		enum pipe p = output->pending_pipe;
-		drmModeModeInfo *mode;
-		igt_pipe_t *pipe;
-		igt_plane_t *plane;
-
-		if (p == PIPE_NONE)
-			continue;
+	for (pipe = PIPE_A; pipe < IGT_MAX_PIPES - 1; pipe++) {
+		if (data->display.pipes[pipe].enabled && data->display.pipes[pipe + 1].enabled) {
+			data->master_pipes |= BIT(pipe);
+			igt_info("Found master pipe %s\n", kmstest_pipe_name(pipe));
+		}
+	}
+}
 
-		mode = igt_output_get_mode(output);
-		igt_info("pipe:%s, output:%s, mode:", kmstest_pipe_name(p), igt_output_name(output));
-		kmstest_dump_mode(mode);
+static enum pipe get_next_master_pipe(data_t *data, uint32_t available_pipe_mask)
+{
+	if ((data->master_pipes & available_pipe_mask) == 0)
+		return PIPE_NONE;
 
-		pipe = &display->pipes[p];
-		plane = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
+	return ffs(data->master_pipes & available_pipe_mask) - 1;
+}
 
-		igt_plane_set_fb(plane, &data->fb);
-		igt_fb_set_size(&data->fb, plane, mode->hdisplay, mode->vdisplay);
-		igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
-	}
+static enum pipe setup_pipe(data_t *data, igt_output_t *output, enum pipe pipe, unsigned int available_pipe_mask)
+{
+	enum pipe master_pipe;
+	uint32_t attempt_mask;
 
-	igt_assert(!igt_check_bigjoiner_support(display));
+	attempt_mask = BIT(pipe);
+	master_pipe = get_next_master_pipe(data, available_pipe_mask & attempt_mask);
 
-	/* This commit is expectd to fail as this pipe is being used for big joiner */
-	ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_TEST_ONLY |
-					    DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+	if (master_pipe == PIPE_NONE)
+		return PIPE_NONE;
 
-	igt_display_reset(&data->display);
-	igt_display_commit2(display, COMMIT_ATOMIC);
+	igt_info("Using pipe %s as master and %s slave for %s\n", kmstest_pipe_name(pipe),
+		 kmstest_pipe_name(pipe + 1), output->name);
+	igt_output_set_pipe(output, pipe);
 
-	igt_assert_lt(ret, 0);
+	return master_pipe;
 }
 
-static void test_basic_modeset(data_t *data)
+static void test_single_joiner(data_t *data, int output_count)
 {
+	int i;
+	enum pipe pipe, master_pipe;
+	uint32_t available_pipe_mask = BIT(data->n_pipes) - 1;
+	igt_output_t *output;
+	igt_plane_t *primary;
+	igt_output_t **outputs;
+	igt_fb_t fb;
 	drmModeModeInfo *mode;
-	igt_output_t *output, *bigjoiner_output = NULL;
-	igt_display_t *display = &data->display;
-	igt_pipe_t *pipe;
-	igt_plane_t *plane;
 
-	igt_display_reset(display);
+	outputs = data->big_joiner_output;
 
-	for_each_connected_output(display, output) {
-		if (data->output[0].output_id == output->id) {
-			bigjoiner_output = output;
-			break;
+	for (i = 0; i < output_count; i++) {
+		output = outputs[i];
+		for (pipe = 0; pipe < data->n_pipes - 1; pipe++) {
+			igt_display_reset(&data->display);
+			master_pipe = setup_pipe(data, output, pipe, available_pipe_mask);
+			if (master_pipe == PIPE_NONE)
+				continue;
+			mode = igt_output_get_mode(output);
+			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_display_commit2(&data->display, COMMIT_ATOMIC);
+			igt_plane_set_fb(primary, NULL);
+			igt_remove_fb(data->drm_fd, &fb);
 		}
 	}
-
-	igt_output_set_pipe(bigjoiner_output, data->pipe1);
-
-	mode = &data->output[0].mode;
-	igt_output_override_mode(bigjoiner_output, mode);
-
-	pipe = &display->pipes[data->pipe1];
-	plane = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
-
-	igt_plane_set_fb(plane, &data->fb);
-	igt_fb_set_size(&data->fb, plane, mode->hdisplay, mode->vdisplay);
-	igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
-
-	igt_display_commit2(display, COMMIT_ATOMIC);
-
-	igt_output_set_pipe(bigjoiner_output, PIPE_NONE);
-	igt_plane_set_fb(plane, NULL);
-	igt_display_commit2(display, COMMIT_ATOMIC);
 }
 
-static void test_dual_display(data_t *data)
+static void test_multi_joiner(data_t *data, int output_count)
 {
+	int i;
+	uint32_t available_pipe_mask;
+	enum pipe pipe, master_pipe;
+	igt_output_t **outputs;
+	igt_output_t *output;
+	igt_plane_t *primary[output_count];
+	igt_fb_t fb[output_count];
 	drmModeModeInfo *mode;
-	igt_output_t *output, *bigjoiner_output[2];
-	igt_display_t *display = &data->display;
-	igt_pipe_t *pipe;
-	igt_plane_t *plane1, *plane2;
-	int count = 0;
-
-	igt_display_reset(display);
-
-	for_each_connected_output(display, output) {
-		if (data->output[count].output_id == output->id) {
-			bigjoiner_output[count] = output;
-			count++;
-		}
 
-		if (count > 1)
+	available_pipe_mask = BIT(data->n_pipes) - 1;
+	outputs = data->big_joiner_output;
+
+	igt_display_reset(&data->display);
+	for (i = 0; i < output_count; i++) {
+		output = outputs[i];
+		for (pipe = 0; pipe < data->n_pipes; pipe++) {
+			master_pipe = setup_pipe(data, output, pipe, available_pipe_mask);
+			if (master_pipe == PIPE_NONE)
+				continue;
+			mode = igt_output_get_mode(output);
+			primary[i] = 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[i]);
+			igt_plane_set_fb(primary[i], &fb[i]);
+
+			available_pipe_mask &= ~BIT(master_pipe);
+			available_pipe_mask &= ~BIT(master_pipe + 1);
 			break;
+		}
 	}
+	igt_display_commit2(&data->display, COMMIT_ATOMIC);
+	for (i = 0; i < output_count; i++) {
+		igt_plane_set_fb(primary[i], NULL);
+		igt_remove_fb(data->drm_fd, &fb[i]);
+	}
+}
 
-	igt_output_set_pipe(bigjoiner_output[0], data->pipe1);
-	igt_output_set_pipe(bigjoiner_output[1], data->pipe2);
-
-	/* Set up first big joiner output on Pipe A*/
-	mode = &data->output[0].mode;
-	igt_output_override_mode(bigjoiner_output[0], mode);
+static void test_invalid_modeset_two_joiner(data_t *data,
+					    bool mixed)
+{
+	int i, j, ret;
+	uint32_t available_pipe_mask;
+	uint32_t attempt_mask;
+	enum pipe master_pipe;
+	igt_output_t **outputs;
+	igt_output_t *output;
+	igt_plane_t *primary[INVALID_TEST_OUTPUT];
+	igt_fb_t fb[INVALID_TEST_OUTPUT];
+	drmModeModeInfo *mode;
 
-	pipe = &display->pipes[data->pipe1];
-	plane1 = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
+	available_pipe_mask = BIT(data->n_pipes) - 1;
+	outputs = mixed ? data->mixed_output : data->big_joiner_output;
 
-	igt_plane_set_fb(plane1, &data->fb);
-	igt_fb_set_size(&data->fb, plane1, mode->hdisplay, mode->vdisplay);
-	igt_plane_set_size(plane1, mode->hdisplay, mode->vdisplay);
+	for (i = 0; i < data->n_pipes - 1; i++) {
+		igt_display_reset(&data->display);
+		attempt_mask = BIT(data->pipe_seq[i]);
+		master_pipe = get_next_master_pipe(data, available_pipe_mask & attempt_mask);
 
-	/* Set up second big joiner output on Pipe C*/
-	mode = &data->output[1].mode;
-	igt_output_override_mode(bigjoiner_output[1], mode);
+		if (master_pipe == PIPE_NONE)
+			continue;
 
-	pipe = &display->pipes[data->pipe2];
-	plane2 = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
+		for (j = 0; j < INVALID_TEST_OUTPUT; j++) {
+			output = outputs[j];
+			igt_output_set_pipe(output, data->pipe_seq[i + j]);
+			mode = igt_output_get_mode(output);
+			igt_info("Assigning pipe %s to %s with mode %dx%d@%d%s",
+				 kmstest_pipe_name(data->pipe_seq[i + j]),
+				 igt_output_name(output), mode->hdisplay,
+				 mode->vdisplay, mode->vrefresh,
+				 j == INVALID_TEST_OUTPUT - 1 ? "\n" : ", ");
+			primary[j] = 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[j]);
+			igt_plane_set_fb(primary[j], &fb[j]);
+		}
+		ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
+		for (j = 0; j < INVALID_TEST_OUTPUT; j++) {
+			igt_plane_set_fb(primary[j], NULL);
+			igt_remove_fb(data->drm_fd, &fb[j]);
+		}
+		igt_assert_f(ret != 0, "Commit shouldn't have passed\n");
+	}
+}
 
-	igt_plane_set_fb(plane2, &data->fb);
-	igt_fb_set_size(&data->fb, plane2, mode->hdisplay, mode->vdisplay);
-	igt_plane_set_size(plane2, mode->hdisplay, mode->vdisplay);
+static void test_big_joiner_on_last_pipe(data_t *data)
+{
+	int i, len, ret;
+	igt_output_t **outputs;
+	igt_output_t *output;
+	igt_plane_t *primary;
+	igt_fb_t fb;
+	drmModeModeInfo *mode;
 
-	igt_display_commit2(display, COMMIT_ATOMIC);
+	len = data->big_joiner_output_count;
+	outputs = data->big_joiner_output;
 
-	/* Clean up */
-	igt_output_set_pipe(bigjoiner_output[0], PIPE_NONE);
-	igt_output_set_pipe(bigjoiner_output[1], PIPE_NONE);
-	igt_plane_set_fb(plane1, NULL);
-	igt_plane_set_fb(plane2, NULL);
-	igt_display_commit2(display, COMMIT_ATOMIC);
+	for (i = 0; i < len; i++) {
+		igt_display_reset(&data->display);
+		output = outputs[i];
+		igt_output_set_pipe(output, data->pipe_seq[data->n_pipes - 1]);
+		mode = igt_output_get_mode(output);
+		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);
+		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);
+		ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
+		igt_plane_set_fb(primary, NULL);
+		igt_remove_fb(data->drm_fd, &fb);
+		igt_assert_f(ret != 0, "Commit shouldn't have passed\n");
+	}
 }
 
 igt_main
 {
-	data_t data;
+	int i, j;
 	igt_output_t *output;
 	drmModeModeInfo mode;
-	int valid_output = 0, i, count = 0, j = 0;
-	uint16_t width = 0, height = 0;
-	enum pipe pipe_seq[IGT_MAX_PIPES];
+	data_t data;
 
 	igt_fixture {
+		data.big_joiner_output_count = 0;
+		data.non_big_joiner_output_count = 0;
+		data.mixed_output_count = 0;
+		data.output_count = 0;
+		j = 0;
+
 		data.drm_fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_XE);
 		kmstest_set_vt_graphics_mode();
-
 		igt_display_require(&data.display, data.drm_fd);
+		set_all_master_pipes_for_platform(&data);
 		igt_require(data.display.is_atomic);
-
 		max_dotclock = igt_get_max_dotclock(data.drm_fd);
 
 		for_each_connected_output(&data.display, output) {
@@ -228,105 +287,58 @@ igt_main
 			found = bigjoiner_mode_found(data.drm_fd, connector, max_dotclock, &mode);
 
 			if (found) {
-				data.output[count].output_id = output->id;
-				memcpy(&data.output[count].mode, &mode, sizeof(drmModeModeInfo));
-				count++;
-
-				width = max(width, mode.hdisplay);
-				height = max(height, mode.vdisplay);
+				data.big_joiner_output[data.big_joiner_output_count++] = output;
+				igt_output_override_mode(output, &mode);
+			} else {
+				data.non_big_joiner_output[data.non_big_joiner_output_count++] = output;
 			}
-			valid_output++;
+			data.output_count++;
+		}
+		if (data.big_joiner_output_count == 1 && data.non_big_joiner_output_count >= 1) {
+			/*
+			 * Mixed output consists of 1 bigjoiner output and 1 non bigjoiner output
+			 */
+			data.mixed_output[data.mixed_output_count++] = data.big_joiner_output[0];
+			data.mixed_output[data.mixed_output_count++] = data.non_big_joiner_output[0];
 		}
-
 		data.n_pipes = 0;
 		for_each_pipe(&data.display, i) {
 			data.n_pipes++;
-			pipe_seq[j] = i;
+			data.pipe_seq[j] = i;
 			j++;
 		}
-
-		igt_require_f(count > 0, "No output with 5k+ mode (or) clock > max-dot-clock found\n");
-
-		igt_create_pattern_fb(data.drm_fd, width, height, DRM_FORMAT_XRGB8888,
-				      DRM_FORMAT_MOD_LINEAR, &data.fb);
 	}
 
 	igt_describe("Verify the basic modeset on big joiner mode on all pipes");
 	igt_subtest_with_dynamic("basic") {
-		for (i = 0; i < data.n_pipes - 1; i++) {
-			data.pipe1 = pipe_seq[i];
-			igt_dynamic_f("pipe-%s", kmstest_pipe_name(pipe_seq[i]))
-				test_basic_modeset(&data);
-		}
+			igt_require_f(data.big_joiner_output_count > 0,
+				      "No bigjoiner output found\n");
+			igt_require_f(data.n_pipes > 1,
+				      "Minimum 2 pipes required\n");
+			igt_dynamic_f("single-joiner")
+				test_single_joiner(&data, data.big_joiner_output_count);
+			if (data.big_joiner_output_count > 1)
+				igt_dynamic_f("multi-joiner")
+					test_multi_joiner(&data, data.big_joiner_output_count);
 	}
 
 	igt_describe("Verify if the modeset on the adjoining pipe is rejected "
 		     "when the pipe is active with a big joiner modeset");
 	igt_subtest_with_dynamic("invalid-modeset") {
-		data.pipe1 = pipe_seq[j - 1];
-
-		igt_display_reset(&data.display);
-		for_each_connected_output(&data.display, output) {
-			if (data.output[0].output_id != output->id)
-				continue;
-
-			mode = data.output[0].mode;
-			igt_output_set_pipe(output, data.pipe1);
-			igt_output_override_mode(output, &mode);
-
-			igt_dynamic_f("pipe-%s-%s",
-				      kmstest_pipe_name(data.pipe1),
-				      igt_output_name(output))
-				test_invalid_modeset(&data);
-		}
-
-		if(valid_output > 1) {
-			for (i = 0; i < data.n_pipes - 1; i++) {
-				igt_output_t *first_output = NULL, *second_output = NULL;
-
-				data.pipe1 = pipe_seq[i];
-				data.pipe2 = pipe_seq[i + 1];
-
-				igt_display_reset(&data.display);
-				for_each_connected_output(&data.display, output) {
-					if (data.output[0].output_id == output->id) {
-						first_output = output;
-						mode = data.output[0].mode;
-
-						igt_output_set_pipe(output, data.pipe1);
-						igt_output_override_mode(output, &mode);
-					} else if (second_output == NULL) {
-						second_output = output;
-						igt_output_set_pipe(output, data.pipe2);
-
-						break;
-					}
-				}
-
-				igt_dynamic_f("pipe-%s-%s-pipe-%s-%s",
-					      kmstest_pipe_name(data.pipe1),
-					      igt_output_name(first_output),
-					      kmstest_pipe_name(data.pipe2),
-					      igt_output_name(second_output))
-					test_invalid_modeset(&data);
-			}
-		}
-	}
-
-	igt_describe("Verify simultaneous modeset on 2 big joiner outputs");
-	igt_subtest_with_dynamic("2x-modeset") {
-		igt_require_f(count > 1, "2 outputs with big joiner modes are required\n");
-		igt_require_f(data.n_pipes > 3, "Minumum of 4 pipes are required\n");
-		for (i = 0; (i + 2) < data.n_pipes - 1; i++) {
-			data.pipe1 = pipe_seq[i];
-			data.pipe2 = pipe_seq[i + 2];
-			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe_seq[i]), kmstest_pipe_name(pipe_seq[i + 2]))
-				test_dual_display(&data);
-		}
+		igt_require_f(data.big_joiner_output_count > 0, "Non big joiner output not found\n");
+		igt_require_f(data.n_pipes > 1, "Minimum of 2 pipes are required\n");
+		if (data.big_joiner_output_count >= 1)
+			igt_dynamic_f("big_joiner_on_last_pipe")
+				test_big_joiner_on_last_pipe(&data);
+		if (data.big_joiner_output_count > 1)
+			igt_dynamic_f("invalid_combinations")
+				test_invalid_modeset_two_joiner(&data, false);
+		if (data.mixed_output_count)
+			igt_dynamic_f("mixed_output")
+				test_invalid_modeset_two_joiner(&data, true);
 	}
 
 	igt_fixture {
-		igt_remove_fb(data.drm_fd, &data.fb);
 		igt_display_fini(&data.display);
 		drm_close_driver(data.drm_fd);
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner
  2024-03-28  8:39 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
  2024-03-28  8:39 ` [PATCH i-g-t 1/4] lib/igt_kms: move bigjoiner_mode_found to lib Kunal Joshi
  2024-03-28  8:39 ` [PATCH i-g-t 2/4] tests/intel/kms_big_joiner: revamp bigjoiner Kunal Joshi
@ 2024-03-28  8:39 ` Kunal Joshi
  2024-03-28  8:39 ` [PATCH i-g-t 4/4] tests/intel/kms_big_joiner: add tests for " Kunal Joshi
  2024-03-28  9:51 ` ✓ CI.xeBAT: success for revamp big joiner test (rev10) Patchwork
  4 siblings, 0 replies; 14+ messages in thread
From: Kunal Joshi @ 2024-03-28  8:39 UTC (permalink / raw)
  To: igt-dev
  Cc: Kunal Joshi, Stanislav Lisovskiy, Ankit Nautiyal, Karthik B S,
	Bhanuprakash Modem

add helpers to check whether force joiner debugfs exists
and to enable/disable force joiner for a specific connector.

v2: Add documentation and rename (Ankit)
    Combine enable/disable and status check (Ankit)
    Don't assert in igt_has_force_joiner_debugfs (Ankit)

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 lib/igt_kms.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/igt_kms.h |  2 ++
 2 files changed, 53 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 548c9d1f3..c38021dd7 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6171,6 +6171,57 @@ bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
 	return found;
 }
 
+/**
+ * Checks if the force big joiner debugfs is available
+ * for a specific connector.
+ *
+ * @drmfd: file descriptor of the DRM device.
+ * @output: output to check.
+ * Returns:
+ *  true if the debugfs is available, false otherwise.
+ */
+bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output)
+{
+	char buf[512];
+	int debugfs_fd, ret;
+
+	igt_assert_f(output->name, "Connector name cannot be NULL\n");
+	debugfs_fd = igt_debugfs_connector_dir(drmfd, output->name, O_RDONLY);
+	if (debugfs_fd < 0)
+		return false;
+	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
+	close(debugfs_fd);
+	return ret >= 0;
+}
+
+/**
+ * Forces the enable/disable state of big joiner for a specific connector.
+ *
+ * @drmfd The file descriptor of the DRM device.
+ * @connector_name The name of the connector.
+ * @enable The desired state of big joiner (true for enable, false for disable).
+ * Returns:
+ *  true if writing the debugfs was successful
+ *  and the state was set as requested, false otherwise.
+ */
+bool igt_force_and_check_bigjoiner_status(int drmfd, char *connector_name, bool enable)
+{
+	int debugfs_fd, ret;
+	char buf[512];
+
+	igt_assert_f(connector_name, "Connector name cannot be NULL\n");
+	debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_DIRECTORY);
+	igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", connector_name);
+	ret = igt_sysfs_write(debugfs_fd, "i915_bigjoiner_force_enable", enable ? "1" : "0", 1);
+	igt_assert_f(ret > 0, "Could not write i915_bigjoiner_force_enable for connector %s\n", connector_name);
+	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
+	close(debugfs_fd);
+	igt_assert_f(ret > 0, "Could not read i915_bigjoiner_force_enable for connector %s\n", connector_name);
+
+	return enable ? strstr(buf, "Bigjoiner enable: 1") :
+		    strstr(buf, "Bigjoiner enable: 0");
+}
+
 /**
  * igt_check_bigjoiner_support:
  * @display: a pointer to an #igt_display_t structure
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 0fa7a2ea1..6d13e5851 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1214,6 +1214,8 @@ int igt_get_max_dotclock(int fd);
 bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
 bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
 			  int max_dotclock, drmModeModeInfo *mode);
+bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output);
+bool igt_force_and_check_bigjoiner_status(int drmfd, char *connector_name, bool enable);
 bool igt_check_bigjoiner_support(igt_display_t *display);
 bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
 bool intel_pipe_output_combo_valid(igt_display_t *display);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH i-g-t 4/4] tests/intel/kms_big_joiner: add tests for force joiner
  2024-03-28  8:39 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
                   ` (2 preceding siblings ...)
  2024-03-28  8:39 ` [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner Kunal Joshi
@ 2024-03-28  8:39 ` Kunal Joshi
  2024-03-28  9:51 ` ✓ CI.xeBAT: success for revamp big joiner test (rev10) Patchwork
  4 siblings, 0 replies; 14+ messages in thread
From: Kunal Joshi @ 2024-03-28  8:39 UTC (permalink / raw)
  To: igt-dev
  Cc: Kunal Joshi, Stanislav Lisovskiy, Ankit Nautiyal, Karthik B S,
	Bhanuprakash Modem

add tests for force joiner

v2: check status after forcing (Ankit)
    take out commoon code (Ankit)
    fix missing force_joiner (Ankit)

v3: add doc (Ankit)

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 tests/intel/kms_big_joiner.c | 109 +++++++++++++++++++++++++++++------
 1 file changed, 92 insertions(+), 17 deletions(-)

diff --git a/tests/intel/kms_big_joiner.c b/tests/intel/kms_big_joiner.c
index bc4facead..86378101a 100644
--- a/tests/intel/kms_big_joiner.c
+++ b/tests/intel/kms_big_joiner.c
@@ -44,9 +44,20 @@
  * SUBTEST: basic
  * Description: Verify the basic modeset on big joiner mode on all pipes
  *
+ * SUBTEST: invalid-modeset-force-joiner
+ * Description: Verify if the modeset on the adjoining pipe is rejected when
+ *              the pipe is active with a force joiner modeset
+ *              force joiner is to used to force bigjoiner functionality on
+ *              non bigjoiner outputs, hence test will run only on non bigjoiner
+ *              outputs
+ *
+ * SUBTEST: basic-force-joiner
+ * Description: Verify the basic modeset on force joiner mode on all pipes
+ *              force joiner is to used to force bigjoiner functionality on
+ *              non bigjoiner outputs, hence test will run only on non bigjoiner
+ *              outputs
  */
-
-IGT_TEST_DESCRIPTION("Test big joiner");
+IGT_TEST_DESCRIPTION("Test big joiner / force joiner");
 
 #define INVALID_TEST_OUTPUT 2
 
@@ -79,6 +90,19 @@ static void set_all_master_pipes_for_platform(data_t *data)
 	}
 }
 
+static void toggle_force_joiner_on_all_non_big_joiner_outputs(data_t *data, bool toggle)
+{
+	bool status;
+	igt_output_t *output;
+	int i;
+
+	for (i = 0; i < data->non_big_joiner_output_count; i++) {
+		output = data->non_big_joiner_output[i];
+		status = igt_force_and_check_bigjoiner_status(data->drm_fd, output->name, toggle);
+		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)
@@ -105,7 +129,7 @@ static enum pipe setup_pipe(data_t *data, igt_output_t *output, enum pipe pipe,
 	return master_pipe;
 }
 
-static void test_single_joiner(data_t *data, int output_count)
+static void test_single_joiner(data_t *data, int output_count, bool force_joiner)
 {
 	int i;
 	enum pipe pipe, master_pipe;
@@ -116,7 +140,7 @@ static void test_single_joiner(data_t *data, int output_count)
 	igt_fb_t fb;
 	drmModeModeInfo *mode;
 
-	outputs = data->big_joiner_output;
+	outputs = force_joiner ? data->non_big_joiner_output : data->big_joiner_output;
 
 	for (i = 0; i < output_count; i++) {
 		output = outputs[i];
@@ -137,7 +161,7 @@ static void test_single_joiner(data_t *data, int output_count)
 	}
 }
 
-static void test_multi_joiner(data_t *data, int output_count)
+static void test_multi_joiner(data_t *data, int output_count, bool force_joiner)
 {
 	int i;
 	uint32_t available_pipe_mask;
@@ -149,7 +173,7 @@ static void test_multi_joiner(data_t *data, int output_count)
 	drmModeModeInfo *mode;
 
 	available_pipe_mask = BIT(data->n_pipes) - 1;
-	outputs = data->big_joiner_output;
+	outputs = force_joiner ? data->non_big_joiner_output : data->big_joiner_output;
 
 	igt_display_reset(&data->display);
 	for (i = 0; i < output_count; i++) {
@@ -177,7 +201,7 @@ static void test_multi_joiner(data_t *data, int output_count)
 }
 
 static void test_invalid_modeset_two_joiner(data_t *data,
-					    bool mixed)
+					    bool mixed, bool force_joiner)
 {
 	int i, j, ret;
 	uint32_t available_pipe_mask;
@@ -190,7 +214,8 @@ static void test_invalid_modeset_two_joiner(data_t *data,
 	drmModeModeInfo *mode;
 
 	available_pipe_mask = BIT(data->n_pipes) - 1;
-	outputs = mixed ? data->mixed_output : data->big_joiner_output;
+	outputs = force_joiner ? data->non_big_joiner_output :
+		  mixed ? data->mixed_output : data->big_joiner_output;
 
 	for (i = 0; i < data->n_pipes - 1; i++) {
 		igt_display_reset(&data->display);
@@ -223,7 +248,7 @@ static void test_invalid_modeset_two_joiner(data_t *data,
 	}
 }
 
-static void test_big_joiner_on_last_pipe(data_t *data)
+static void test_joiner_on_last_pipe(data_t *data, bool force_joiner)
 {
 	int i, len, ret;
 	igt_output_t **outputs;
@@ -232,8 +257,8 @@ static void test_big_joiner_on_last_pipe(data_t *data)
 	igt_fb_t fb;
 	drmModeModeInfo *mode;
 
-	len = data->big_joiner_output_count;
-	outputs = data->big_joiner_output;
+	len = force_joiner ? data->non_big_joiner_output_count : data->big_joiner_output_count;
+	outputs = force_joiner ? data->non_big_joiner_output : data->big_joiner_output;
 
 	for (i = 0; i < len; i++) {
 		igt_display_reset(&data->display);
@@ -257,12 +282,14 @@ static void test_big_joiner_on_last_pipe(data_t *data)
 
 igt_main
 {
+	bool force_joiner_supported;
 	int i, j;
 	igt_output_t *output;
 	drmModeModeInfo mode;
 	data_t data;
 
 	igt_fixture {
+		force_joiner_supported = false;
 		data.big_joiner_output_count = 0;
 		data.non_big_joiner_output_count = 0;
 		data.mixed_output_count = 0;
@@ -290,7 +317,10 @@ igt_main
 				data.big_joiner_output[data.big_joiner_output_count++] = output;
 				igt_output_override_mode(output, &mode);
 			} else {
-				data.non_big_joiner_output[data.non_big_joiner_output_count++] = output;
+				if (igt_has_force_joiner_debugfs(data.drm_fd, output)) {
+					force_joiner_supported = true;
+					data.non_big_joiner_output[data.non_big_joiner_output_count++] = output;
+				}
 			}
 			data.output_count++;
 		}
@@ -316,10 +346,10 @@ igt_main
 			igt_require_f(data.n_pipes > 1,
 				      "Minimum 2 pipes required\n");
 			igt_dynamic_f("single-joiner")
-				test_single_joiner(&data, data.big_joiner_output_count);
+				test_single_joiner(&data, data.big_joiner_output_count, false);
 			if (data.big_joiner_output_count > 1)
 				igt_dynamic_f("multi-joiner")
-					test_multi_joiner(&data, data.big_joiner_output_count);
+					test_multi_joiner(&data, data.big_joiner_output_count, false);
 	}
 
 	igt_describe("Verify if the modeset on the adjoining pipe is rejected "
@@ -329,13 +359,58 @@ igt_main
 		igt_require_f(data.n_pipes > 1, "Minimum of 2 pipes are required\n");
 		if (data.big_joiner_output_count >= 1)
 			igt_dynamic_f("big_joiner_on_last_pipe")
-				test_big_joiner_on_last_pipe(&data);
+				test_joiner_on_last_pipe(&data, false);
 		if (data.big_joiner_output_count > 1)
 			igt_dynamic_f("invalid_combinations")
-				test_invalid_modeset_two_joiner(&data, false);
+				test_invalid_modeset_two_joiner(&data, false, false);
 		if (data.mixed_output_count)
 			igt_dynamic_f("mixed_output")
-				test_invalid_modeset_two_joiner(&data, true);
+				test_invalid_modeset_two_joiner(&data, true, false);
+	}
+
+	igt_describe("Verify the basic modeset on big joiner mode on all pipes");
+	igt_subtest_with_dynamic("basic-force-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,
+			      "No non big joiner output found\n");
+		igt_require_f(data.n_pipes > 1,
+			      "Minimum 2 pipes required\n");
+		igt_dynamic_f("single") {
+			toggle_force_joiner_on_all_non_big_joiner_outputs(&data, true);
+			test_single_joiner(&data, data.non_big_joiner_output_count, true);
+			toggle_force_joiner_on_all_non_big_joiner_outputs(&data, false);
+		}
+		if (data.non_big_joiner_output_count > 1) {
+			igt_dynamic_f("multi") {
+				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, true);
+				test_multi_joiner(&data, data.non_big_joiner_output_count, true);
+				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, false);
+			}
+		}
+	}
+
+	igt_subtest_with_dynamic("invalid-modeset-force-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,
+			      "Non big joiner output not found\n");
+		igt_require_f(data.n_pipes > 1,
+			      "Minimum of 2 pipes are required\n");
+		if (data.non_big_joiner_output_count >= 1) {
+			igt_dynamic_f("big_joiner_on_last_pipe") {
+				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, true);
+				test_joiner_on_last_pipe(&data, true);
+				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, false);
+			}
+		}
+		if (data.non_big_joiner_output_count > 1) {
+			igt_dynamic_f("invalid_combinations") {
+				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, true);
+				test_invalid_modeset_two_joiner(&data, false, true);
+				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, false);
+			}
+		}
 	}
 
 	igt_fixture {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH i-g-t 2/4] tests/intel/kms_big_joiner: revamp bigjoiner
  2024-03-28  8:39 ` [PATCH i-g-t 2/4] tests/intel/kms_big_joiner: revamp bigjoiner Kunal Joshi
@ 2024-03-28  9:18   ` Nautiyal, Ankit K
  0 siblings, 0 replies; 14+ messages in thread
From: Nautiyal, Ankit K @ 2024-03-28  9:18 UTC (permalink / raw)
  To: Kunal Joshi, igt-dev; +Cc: Stanislav Lisovskiy, Karthik B S, Bhanuprakash Modem


On 3/28/2024 2:09 PM, Kunal Joshi wrote:
> modify test to support simultaneously testing multiple bigjoiner
> output and ignoring fused off pipes.
>
> v2: Don't change license (Bhanu)
>      Print the pipe name (Bhanu)
>      Remove unwanted commit (Bhanu)
>      Move combine output logic to igt_fixture (Bhanu)
>      split revamp and force joiner (Bhanu)
>
> v3: Ignored fused pipes (Stan)
>
> v4: Ignore master pipes who doesn't have slave (Ankit)
>      Retain subtest names (Ankit)
>      Use commit instead of try_commit (Ankit)
>      Fix typo (Ankit)
>
> v5: Fix condition and remove last pipe (Ankit)
>      Remove nested if (Ankit)
>      Use pointer to output instead of id (Ankit)
>      Add missing igt_describe (Ankit)
>
> v6: Use uint_32 (Ankit)
>      Cosmetic changes (Ankit)
>
> Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Karthik B S <karthik.b.s@intel.com>
> Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> ---
>   tests/intel/kms_big_joiner.c | 402 ++++++++++++++++++-----------------
>   1 file changed, 207 insertions(+), 195 deletions(-)
>
> diff --git a/tests/intel/kms_big_joiner.c b/tests/intel/kms_big_joiner.c
> index 99b1b898d..bc4facead 100644
> --- a/tests/intel/kms_big_joiner.c
> +++ b/tests/intel/kms_big_joiner.c
> @@ -44,177 +44,236 @@
>    * SUBTEST: basic
>    * Description: Verify the basic modeset on big joiner mode on all pipes
>    *
> - * SUBTEST: 2x-modeset
> - * Description: Verify simultaneous modeset on 2 big joiner outputs
>    */
>   
>   IGT_TEST_DESCRIPTION("Test big joiner");
>   
> -struct bigjoiner_output {
> -	uint32_t output_id;
> -	drmModeModeInfo mode;
> -};
> +#define INVALID_TEST_OUTPUT 2
>   
>   typedef struct {
>   	int drm_fd;
> -	igt_display_t display;
> -	struct igt_fb fb;
> +	int big_joiner_output_count;
> +	int non_big_joiner_output_count;
> +	int mixed_output_count;
> +	int output_count;
>   	int n_pipes;
> -	enum pipe pipe1;
> -	enum pipe pipe2;
> -	struct bigjoiner_output output[2];
> +	uint32_t master_pipes;
> +	igt_output_t *big_joiner_output[IGT_MAX_PIPES];
> +	igt_output_t *non_big_joiner_output[IGT_MAX_PIPES];
> +	igt_output_t *mixed_output[IGT_MAX_PIPES];
> +	enum pipe pipe_seq[IGT_MAX_PIPES];
> +	igt_display_t display;
>   } data_t;
>   
>   static int max_dotclock;
>   
> -static void test_invalid_modeset(data_t *data)
> +static void set_all_master_pipes_for_platform(data_t *data)
>   {
> -	igt_output_t *output;
> -	igt_display_t *display = &data->display;
> -	int ret;
> +	enum pipe pipe;
>   
> -	igt_info("Bigjoiner test on ");
> -	for_each_connected_output(display, output){
> -		enum pipe p = output->pending_pipe;
> -		drmModeModeInfo *mode;
> -		igt_pipe_t *pipe;
> -		igt_plane_t *plane;
> -
> -		if (p == PIPE_NONE)
> -			continue;
> +	for (pipe = PIPE_A; pipe < IGT_MAX_PIPES - 1; pipe++) {
> +		if (data->display.pipes[pipe].enabled && data->display.pipes[pipe + 1].enabled) {
> +			data->master_pipes |= BIT(pipe);
> +			igt_info("Found master pipe %s\n", kmstest_pipe_name(pipe));
> +		}
> +	}
> +}
>   
> -		mode = igt_output_get_mode(output);
> -		igt_info("pipe:%s, output:%s, mode:", kmstest_pipe_name(p), igt_output_name(output));
> -		kmstest_dump_mode(mode);
> +static enum pipe get_next_master_pipe(data_t *data, uint32_t available_pipe_mask)
> +{
> +	if ((data->master_pipes & available_pipe_mask) == 0)
> +		return PIPE_NONE;
>   
> -		pipe = &display->pipes[p];
> -		plane = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
> +	return ffs(data->master_pipes & available_pipe_mask) - 1;
> +}
>   
> -		igt_plane_set_fb(plane, &data->fb);
> -		igt_fb_set_size(&data->fb, plane, mode->hdisplay, mode->vdisplay);
> -		igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
> -	}
> +static enum pipe setup_pipe(data_t *data, igt_output_t *output, enum pipe pipe, unsigned int available_pipe_mask)

Here too available_pipe_mask needs to be uint32_t.

With this changed, this is:

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>



> +{
> +	enum pipe master_pipe;
> +	uint32_t attempt_mask;
>   
> -	igt_assert(!igt_check_bigjoiner_support(display));
> +	attempt_mask = BIT(pipe);
> +	master_pipe = get_next_master_pipe(data, available_pipe_mask & attempt_mask);
>   
> -	/* This commit is expectd to fail as this pipe is being used for big joiner */
> -	ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_TEST_ONLY |
> -					    DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +	if (master_pipe == PIPE_NONE)
> +		return PIPE_NONE;
>   
> -	igt_display_reset(&data->display);
> -	igt_display_commit2(display, COMMIT_ATOMIC);
> +	igt_info("Using pipe %s as master and %s slave for %s\n", kmstest_pipe_name(pipe),
> +		 kmstest_pipe_name(pipe + 1), output->name);
> +	igt_output_set_pipe(output, pipe);
>   
> -	igt_assert_lt(ret, 0);
> +	return master_pipe;
>   }
>   
> -static void test_basic_modeset(data_t *data)
> +static void test_single_joiner(data_t *data, int output_count)
>   {
> +	int i;
> +	enum pipe pipe, master_pipe;
> +	uint32_t available_pipe_mask = BIT(data->n_pipes) - 1;
> +	igt_output_t *output;
> +	igt_plane_t *primary;
> +	igt_output_t **outputs;
> +	igt_fb_t fb;
>   	drmModeModeInfo *mode;
> -	igt_output_t *output, *bigjoiner_output = NULL;
> -	igt_display_t *display = &data->display;
> -	igt_pipe_t *pipe;
> -	igt_plane_t *plane;
>   
> -	igt_display_reset(display);
> +	outputs = data->big_joiner_output;
>   
> -	for_each_connected_output(display, output) {
> -		if (data->output[0].output_id == output->id) {
> -			bigjoiner_output = output;
> -			break;
> +	for (i = 0; i < output_count; i++) {
> +		output = outputs[i];
> +		for (pipe = 0; pipe < data->n_pipes - 1; pipe++) {
> +			igt_display_reset(&data->display);
> +			master_pipe = setup_pipe(data, output, pipe, available_pipe_mask);
> +			if (master_pipe == PIPE_NONE)
> +				continue;
> +			mode = igt_output_get_mode(output);
> +			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_display_commit2(&data->display, COMMIT_ATOMIC);
> +			igt_plane_set_fb(primary, NULL);
> +			igt_remove_fb(data->drm_fd, &fb);
>   		}
>   	}
> -
> -	igt_output_set_pipe(bigjoiner_output, data->pipe1);
> -
> -	mode = &data->output[0].mode;
> -	igt_output_override_mode(bigjoiner_output, mode);
> -
> -	pipe = &display->pipes[data->pipe1];
> -	plane = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
> -
> -	igt_plane_set_fb(plane, &data->fb);
> -	igt_fb_set_size(&data->fb, plane, mode->hdisplay, mode->vdisplay);
> -	igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
> -
> -	igt_display_commit2(display, COMMIT_ATOMIC);
> -
> -	igt_output_set_pipe(bigjoiner_output, PIPE_NONE);
> -	igt_plane_set_fb(plane, NULL);
> -	igt_display_commit2(display, COMMIT_ATOMIC);
>   }
>   
> -static void test_dual_display(data_t *data)
> +static void test_multi_joiner(data_t *data, int output_count)
>   {
> +	int i;
> +	uint32_t available_pipe_mask;
> +	enum pipe pipe, master_pipe;
> +	igt_output_t **outputs;
> +	igt_output_t *output;
> +	igt_plane_t *primary[output_count];
> +	igt_fb_t fb[output_count];
>   	drmModeModeInfo *mode;
> -	igt_output_t *output, *bigjoiner_output[2];
> -	igt_display_t *display = &data->display;
> -	igt_pipe_t *pipe;
> -	igt_plane_t *plane1, *plane2;
> -	int count = 0;
> -
> -	igt_display_reset(display);
> -
> -	for_each_connected_output(display, output) {
> -		if (data->output[count].output_id == output->id) {
> -			bigjoiner_output[count] = output;
> -			count++;
> -		}
>   
> -		if (count > 1)
> +	available_pipe_mask = BIT(data->n_pipes) - 1;
> +	outputs = data->big_joiner_output;
> +
> +	igt_display_reset(&data->display);
> +	for (i = 0; i < output_count; i++) {
> +		output = outputs[i];
> +		for (pipe = 0; pipe < data->n_pipes; pipe++) {
> +			master_pipe = setup_pipe(data, output, pipe, available_pipe_mask);
> +			if (master_pipe == PIPE_NONE)
> +				continue;
> +			mode = igt_output_get_mode(output);
> +			primary[i] = 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[i]);
> +			igt_plane_set_fb(primary[i], &fb[i]);
> +
> +			available_pipe_mask &= ~BIT(master_pipe);
> +			available_pipe_mask &= ~BIT(master_pipe + 1);
>   			break;
> +		}
>   	}
> +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
> +	for (i = 0; i < output_count; i++) {
> +		igt_plane_set_fb(primary[i], NULL);
> +		igt_remove_fb(data->drm_fd, &fb[i]);
> +	}
> +}
>   
> -	igt_output_set_pipe(bigjoiner_output[0], data->pipe1);
> -	igt_output_set_pipe(bigjoiner_output[1], data->pipe2);
> -
> -	/* Set up first big joiner output on Pipe A*/
> -	mode = &data->output[0].mode;
> -	igt_output_override_mode(bigjoiner_output[0], mode);
> +static void test_invalid_modeset_two_joiner(data_t *data,
> +					    bool mixed)
> +{
> +	int i, j, ret;
> +	uint32_t available_pipe_mask;
> +	uint32_t attempt_mask;
> +	enum pipe master_pipe;
> +	igt_output_t **outputs;
> +	igt_output_t *output;
> +	igt_plane_t *primary[INVALID_TEST_OUTPUT];
> +	igt_fb_t fb[INVALID_TEST_OUTPUT];
> +	drmModeModeInfo *mode;
>   
> -	pipe = &display->pipes[data->pipe1];
> -	plane1 = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
> +	available_pipe_mask = BIT(data->n_pipes) - 1;
> +	outputs = mixed ? data->mixed_output : data->big_joiner_output;
>   
> -	igt_plane_set_fb(plane1, &data->fb);
> -	igt_fb_set_size(&data->fb, plane1, mode->hdisplay, mode->vdisplay);
> -	igt_plane_set_size(plane1, mode->hdisplay, mode->vdisplay);
> +	for (i = 0; i < data->n_pipes - 1; i++) {
> +		igt_display_reset(&data->display);
> +		attempt_mask = BIT(data->pipe_seq[i]);
> +		master_pipe = get_next_master_pipe(data, available_pipe_mask & attempt_mask);
>   
> -	/* Set up second big joiner output on Pipe C*/
> -	mode = &data->output[1].mode;
> -	igt_output_override_mode(bigjoiner_output[1], mode);
> +		if (master_pipe == PIPE_NONE)
> +			continue;
>   
> -	pipe = &display->pipes[data->pipe2];
> -	plane2 = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
> +		for (j = 0; j < INVALID_TEST_OUTPUT; j++) {
> +			output = outputs[j];
> +			igt_output_set_pipe(output, data->pipe_seq[i + j]);
> +			mode = igt_output_get_mode(output);
> +			igt_info("Assigning pipe %s to %s with mode %dx%d@%d%s",
> +				 kmstest_pipe_name(data->pipe_seq[i + j]),
> +				 igt_output_name(output), mode->hdisplay,
> +				 mode->vdisplay, mode->vrefresh,
> +				 j == INVALID_TEST_OUTPUT - 1 ? "\n" : ", ");
> +			primary[j] = 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[j]);
> +			igt_plane_set_fb(primary[j], &fb[j]);
> +		}
> +		ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
> +		for (j = 0; j < INVALID_TEST_OUTPUT; j++) {
> +			igt_plane_set_fb(primary[j], NULL);
> +			igt_remove_fb(data->drm_fd, &fb[j]);
> +		}
> +		igt_assert_f(ret != 0, "Commit shouldn't have passed\n");
> +	}
> +}
>   
> -	igt_plane_set_fb(plane2, &data->fb);
> -	igt_fb_set_size(&data->fb, plane2, mode->hdisplay, mode->vdisplay);
> -	igt_plane_set_size(plane2, mode->hdisplay, mode->vdisplay);
> +static void test_big_joiner_on_last_pipe(data_t *data)
> +{
> +	int i, len, ret;
> +	igt_output_t **outputs;
> +	igt_output_t *output;
> +	igt_plane_t *primary;
> +	igt_fb_t fb;
> +	drmModeModeInfo *mode;
>   
> -	igt_display_commit2(display, COMMIT_ATOMIC);
> +	len = data->big_joiner_output_count;
> +	outputs = data->big_joiner_output;
>   
> -	/* Clean up */
> -	igt_output_set_pipe(bigjoiner_output[0], PIPE_NONE);
> -	igt_output_set_pipe(bigjoiner_output[1], PIPE_NONE);
> -	igt_plane_set_fb(plane1, NULL);
> -	igt_plane_set_fb(plane2, NULL);
> -	igt_display_commit2(display, COMMIT_ATOMIC);
> +	for (i = 0; i < len; i++) {
> +		igt_display_reset(&data->display);
> +		output = outputs[i];
> +		igt_output_set_pipe(output, data->pipe_seq[data->n_pipes - 1]);
> +		mode = igt_output_get_mode(output);
> +		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);
> +		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);
> +		ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
> +		igt_plane_set_fb(primary, NULL);
> +		igt_remove_fb(data->drm_fd, &fb);
> +		igt_assert_f(ret != 0, "Commit shouldn't have passed\n");
> +	}
>   }
>   
>   igt_main
>   {
> -	data_t data;
> +	int i, j;
>   	igt_output_t *output;
>   	drmModeModeInfo mode;
> -	int valid_output = 0, i, count = 0, j = 0;
> -	uint16_t width = 0, height = 0;
> -	enum pipe pipe_seq[IGT_MAX_PIPES];
> +	data_t data;
>   
>   	igt_fixture {
> +		data.big_joiner_output_count = 0;
> +		data.non_big_joiner_output_count = 0;
> +		data.mixed_output_count = 0;
> +		data.output_count = 0;
> +		j = 0;
> +
>   		data.drm_fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_XE);
>   		kmstest_set_vt_graphics_mode();
> -
>   		igt_display_require(&data.display, data.drm_fd);
> +		set_all_master_pipes_for_platform(&data);
>   		igt_require(data.display.is_atomic);
> -
>   		max_dotclock = igt_get_max_dotclock(data.drm_fd);
>   
>   		for_each_connected_output(&data.display, output) {
> @@ -228,105 +287,58 @@ igt_main
>   			found = bigjoiner_mode_found(data.drm_fd, connector, max_dotclock, &mode);
>   
>   			if (found) {
> -				data.output[count].output_id = output->id;
> -				memcpy(&data.output[count].mode, &mode, sizeof(drmModeModeInfo));
> -				count++;
> -
> -				width = max(width, mode.hdisplay);
> -				height = max(height, mode.vdisplay);
> +				data.big_joiner_output[data.big_joiner_output_count++] = output;
> +				igt_output_override_mode(output, &mode);
> +			} else {
> +				data.non_big_joiner_output[data.non_big_joiner_output_count++] = output;
>   			}
> -			valid_output++;
> +			data.output_count++;
> +		}
> +		if (data.big_joiner_output_count == 1 && data.non_big_joiner_output_count >= 1) {
> +			/*
> +			 * Mixed output consists of 1 bigjoiner output and 1 non bigjoiner output
> +			 */
> +			data.mixed_output[data.mixed_output_count++] = data.big_joiner_output[0];
> +			data.mixed_output[data.mixed_output_count++] = data.non_big_joiner_output[0];
>   		}
> -
>   		data.n_pipes = 0;
>   		for_each_pipe(&data.display, i) {
>   			data.n_pipes++;
> -			pipe_seq[j] = i;
> +			data.pipe_seq[j] = i;
>   			j++;
>   		}
> -
> -		igt_require_f(count > 0, "No output with 5k+ mode (or) clock > max-dot-clock found\n");
> -
> -		igt_create_pattern_fb(data.drm_fd, width, height, DRM_FORMAT_XRGB8888,
> -				      DRM_FORMAT_MOD_LINEAR, &data.fb);
>   	}
>   
>   	igt_describe("Verify the basic modeset on big joiner mode on all pipes");
>   	igt_subtest_with_dynamic("basic") {
> -		for (i = 0; i < data.n_pipes - 1; i++) {
> -			data.pipe1 = pipe_seq[i];
> -			igt_dynamic_f("pipe-%s", kmstest_pipe_name(pipe_seq[i]))
> -				test_basic_modeset(&data);
> -		}
> +			igt_require_f(data.big_joiner_output_count > 0,
> +				      "No bigjoiner output found\n");
> +			igt_require_f(data.n_pipes > 1,
> +				      "Minimum 2 pipes required\n");
> +			igt_dynamic_f("single-joiner")
> +				test_single_joiner(&data, data.big_joiner_output_count);
> +			if (data.big_joiner_output_count > 1)
> +				igt_dynamic_f("multi-joiner")
> +					test_multi_joiner(&data, data.big_joiner_output_count);
>   	}
>   
>   	igt_describe("Verify if the modeset on the adjoining pipe is rejected "
>   		     "when the pipe is active with a big joiner modeset");
>   	igt_subtest_with_dynamic("invalid-modeset") {
> -		data.pipe1 = pipe_seq[j - 1];
> -
> -		igt_display_reset(&data.display);
> -		for_each_connected_output(&data.display, output) {
> -			if (data.output[0].output_id != output->id)
> -				continue;
> -
> -			mode = data.output[0].mode;
> -			igt_output_set_pipe(output, data.pipe1);
> -			igt_output_override_mode(output, &mode);
> -
> -			igt_dynamic_f("pipe-%s-%s",
> -				      kmstest_pipe_name(data.pipe1),
> -				      igt_output_name(output))
> -				test_invalid_modeset(&data);
> -		}
> -
> -		if(valid_output > 1) {
> -			for (i = 0; i < data.n_pipes - 1; i++) {
> -				igt_output_t *first_output = NULL, *second_output = NULL;
> -
> -				data.pipe1 = pipe_seq[i];
> -				data.pipe2 = pipe_seq[i + 1];
> -
> -				igt_display_reset(&data.display);
> -				for_each_connected_output(&data.display, output) {
> -					if (data.output[0].output_id == output->id) {
> -						first_output = output;
> -						mode = data.output[0].mode;
> -
> -						igt_output_set_pipe(output, data.pipe1);
> -						igt_output_override_mode(output, &mode);
> -					} else if (second_output == NULL) {
> -						second_output = output;
> -						igt_output_set_pipe(output, data.pipe2);
> -
> -						break;
> -					}
> -				}
> -
> -				igt_dynamic_f("pipe-%s-%s-pipe-%s-%s",
> -					      kmstest_pipe_name(data.pipe1),
> -					      igt_output_name(first_output),
> -					      kmstest_pipe_name(data.pipe2),
> -					      igt_output_name(second_output))
> -					test_invalid_modeset(&data);
> -			}
> -		}
> -	}
> -
> -	igt_describe("Verify simultaneous modeset on 2 big joiner outputs");
> -	igt_subtest_with_dynamic("2x-modeset") {
> -		igt_require_f(count > 1, "2 outputs with big joiner modes are required\n");
> -		igt_require_f(data.n_pipes > 3, "Minumum of 4 pipes are required\n");
> -		for (i = 0; (i + 2) < data.n_pipes - 1; i++) {
> -			data.pipe1 = pipe_seq[i];
> -			data.pipe2 = pipe_seq[i + 2];
> -			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe_seq[i]), kmstest_pipe_name(pipe_seq[i + 2]))
> -				test_dual_display(&data);
> -		}
> +		igt_require_f(data.big_joiner_output_count > 0, "Non big joiner output not found\n");
> +		igt_require_f(data.n_pipes > 1, "Minimum of 2 pipes are required\n");
> +		if (data.big_joiner_output_count >= 1)
> +			igt_dynamic_f("big_joiner_on_last_pipe")
> +				test_big_joiner_on_last_pipe(&data);
> +		if (data.big_joiner_output_count > 1)
> +			igt_dynamic_f("invalid_combinations")
> +				test_invalid_modeset_two_joiner(&data, false);
> +		if (data.mixed_output_count)
> +			igt_dynamic_f("mixed_output")
> +				test_invalid_modeset_two_joiner(&data, true);
>   	}
>   
>   	igt_fixture {
> -		igt_remove_fb(data.drm_fd, &data.fb);
>   		igt_display_fini(&data.display);
>   		drm_close_driver(data.drm_fd);
>   	}

^ permalink raw reply	[flat|nested] 14+ messages in thread

* ✓ CI.xeBAT: success for revamp big joiner test (rev10)
  2024-03-28  8:39 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
                   ` (3 preceding siblings ...)
  2024-03-28  8:39 ` [PATCH i-g-t 4/4] tests/intel/kms_big_joiner: add tests for " Kunal Joshi
@ 2024-03-28  9:51 ` Patchwork
  4 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2024-03-28  9:51 UTC (permalink / raw)
  To: Kunal Joshi; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 3947 bytes --]

== Series Details ==

Series: revamp big joiner test (rev10)
URL   : https://patchwork.freedesktop.org/series/130572/
State : success

== Summary ==

CI Bug Log - changes from XEIGT_7786_BAT -> XEIGTPW_10940_BAT
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Participating hosts (5 -> 4)
------------------------------

  Missing    (1): bat-lnl-1 

Known issues
------------

  Here are the changes found in XEIGTPW_10940_BAT that come from known issues:

### IGT changes ###

#### Possible fixes ####

  * igt@xe_evict@evict-beng-small-external:
    - bat-dg2-oem2:       [SKIP][1] ([Intel XE#1130]) -> [PASS][2] +13 other tests pass
   [1]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7786/bat-dg2-oem2/igt@xe_evict@evict-beng-small-external.html
   [2]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10940/bat-dg2-oem2/igt@xe_evict@evict-beng-small-external.html

  * igt@xe_module_load@load:
    - bat-dg2-oem2:       [FAIL][3] ([Intel XE#1132]) -> [PASS][4]
   [3]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7786/bat-dg2-oem2/igt@xe_module_load@load.html
   [4]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10940/bat-dg2-oem2/igt@xe_module_load@load.html

  
#### Warnings ####

  * igt@xe_evict@evict-beng-mixed-threads-small-multi-vm:
    - bat-dg2-oem2:       [SKIP][5] ([Intel XE#1130]) -> [TIMEOUT][6] ([Intel XE#1027] / [Intel XE#1088])
   [5]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7786/bat-dg2-oem2/igt@xe_evict@evict-beng-mixed-threads-small-multi-vm.html
   [6]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10940/bat-dg2-oem2/igt@xe_evict@evict-beng-mixed-threads-small-multi-vm.html

  * igt@xe_evict@evict-beng-small:
    - bat-dg2-oem2:       [SKIP][7] ([Intel XE#1130]) -> [DMESG-WARN][8] ([Intel XE#1088] / [Intel XE#1373])
   [7]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7786/bat-dg2-oem2/igt@xe_evict@evict-beng-small.html
   [8]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10940/bat-dg2-oem2/igt@xe_evict@evict-beng-small.html

  * igt@xe_evict@evict-cm-threads-small:
    - bat-dg2-oem2:       [SKIP][9] ([Intel XE#1130]) -> [INCOMPLETE][10] ([Intel XE#1027] / [Intel XE#804])
   [9]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7786/bat-dg2-oem2/igt@xe_evict@evict-cm-threads-small.html
   [10]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10940/bat-dg2-oem2/igt@xe_evict@evict-cm-threads-small.html

  * igt@xe_evict@evict-mixed-threads-small:
    - bat-dg2-oem2:       [SKIP][11] ([Intel XE#1130]) -> [INCOMPLETE][12] ([Intel XE#804])
   [11]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7786/bat-dg2-oem2/igt@xe_evict@evict-mixed-threads-small.html
   [12]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10940/bat-dg2-oem2/igt@xe_evict@evict-mixed-threads-small.html

  
  [Intel XE#1027]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1027
  [Intel XE#1088]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1088
  [Intel XE#1130]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1130
  [Intel XE#1132]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1132
  [Intel XE#1373]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1373
  [Intel XE#804]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/804


Build changes
-------------

  * IGT: IGT_7786 -> IGTPW_10940
  * Linux: xe-998-f9c56f1a03b5c35488671e4ffe61e28b12ffe163 -> xe-1005-8d398ffc40ac37d1589214c28b69c651c1a20792

  IGTPW_10940: d6a638c30eb1f6715f7d56727f64fceab692f4a7 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  IGT_7786: 1e4a3cd0a4bb3419fb70ed3e01259485b056dcfd @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  xe-1005-8d398ffc40ac37d1589214c28b69c651c1a20792: 8d398ffc40ac37d1589214c28b69c651c1a20792
  xe-998-f9c56f1a03b5c35488671e4ffe61e28b12ffe163: f9c56f1a03b5c35488671e4ffe61e28b12ffe163

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10940/index.html

[-- Attachment #2: Type: text/html, Size: 5140 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner
  2024-03-25 16:51 ` [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner Kunal Joshi
@ 2024-03-28  7:11   ` Nautiyal, Ankit K
  0 siblings, 0 replies; 14+ messages in thread
From: Nautiyal, Ankit K @ 2024-03-28  7:11 UTC (permalink / raw)
  To: Kunal Joshi, igt-dev; +Cc: Stanislav Lisovskiy, Karthik B S, Bhanuprakash Modem


On 3/25/2024 10:21 PM, Kunal Joshi wrote:
> v2: Add documentation and rename (Ankit)
>      Combine enable/disable and status check (Ankit)
>      Don't assert in igt_has_force_joiner_debugfs (Ankit)


Version history should come after the commit message.

I think this got mix up between series rev 7-8.


Regards,

Ankit

>
> add helpers to check whether force joiner debugfs exists
> and to enable/disable force joiner for a specific connector.
>
> Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Karthik B S <karthik.b.s@intel.com>
> Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>   lib/igt_kms.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
>   lib/igt_kms.h |  2 ++
>   2 files changed, 53 insertions(+)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 548c9d1f3..c38021dd7 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -6171,6 +6171,57 @@ bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
>   	return found;
>   }
>   
> +/**
> + * Checks if the force big joiner debugfs is available
> + * for a specific connector.
> + *
> + * @drmfd: file descriptor of the DRM device.
> + * @output: output to check.
> + * Returns:
> + *  true if the debugfs is available, false otherwise.
> + */
> +bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output)
> +{
> +	char buf[512];
> +	int debugfs_fd, ret;
> +
> +	igt_assert_f(output->name, "Connector name cannot be NULL\n");
> +	debugfs_fd = igt_debugfs_connector_dir(drmfd, output->name, O_RDONLY);
> +	if (debugfs_fd < 0)
> +		return false;
> +	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
> +	close(debugfs_fd);
> +	return ret >= 0;
> +}
> +
> +/**
> + * Forces the enable/disable state of big joiner for a specific connector.
> + *
> + * @drmfd The file descriptor of the DRM device.
> + * @connector_name The name of the connector.
> + * @enable The desired state of big joiner (true for enable, false for disable).
> + * Returns:
> + *  true if writing the debugfs was successful
> + *  and the state was set as requested, false otherwise.
> + */
> +bool igt_force_and_check_bigjoiner_status(int drmfd, char *connector_name, bool enable)
> +{
> +	int debugfs_fd, ret;
> +	char buf[512];
> +
> +	igt_assert_f(connector_name, "Connector name cannot be NULL\n");
> +	debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_DIRECTORY);
> +	igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", connector_name);
> +	ret = igt_sysfs_write(debugfs_fd, "i915_bigjoiner_force_enable", enable ? "1" : "0", 1);
> +	igt_assert_f(ret > 0, "Could not write i915_bigjoiner_force_enable for connector %s\n", connector_name);
> +	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
> +	close(debugfs_fd);
> +	igt_assert_f(ret > 0, "Could not read i915_bigjoiner_force_enable for connector %s\n", connector_name);
> +
> +	return enable ? strstr(buf, "Bigjoiner enable: 1") :
> +		    strstr(buf, "Bigjoiner enable: 0");
> +}
> +
>   /**
>    * igt_check_bigjoiner_support:
>    * @display: a pointer to an #igt_display_t structure
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 0fa7a2ea1..6d13e5851 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -1214,6 +1214,8 @@ int igt_get_max_dotclock(int fd);
>   bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
>   bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
>   			  int max_dotclock, drmModeModeInfo *mode);
> +bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output);
> +bool igt_force_and_check_bigjoiner_status(int drmfd, char *connector_name, bool enable);
>   bool igt_check_bigjoiner_support(igt_display_t *display);
>   bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
>   bool intel_pipe_output_combo_valid(igt_display_t *display);

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner
  2024-03-25 16:51 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
@ 2024-03-25 16:51 ` Kunal Joshi
  2024-03-28  7:11   ` Nautiyal, Ankit K
  0 siblings, 1 reply; 14+ messages in thread
From: Kunal Joshi @ 2024-03-25 16:51 UTC (permalink / raw)
  To: igt-dev
  Cc: Kunal Joshi, Stanislav Lisovskiy, Ankit Nautiyal, Karthik B S,
	Bhanuprakash Modem

v2: Add documentation and rename (Ankit)
    Combine enable/disable and status check (Ankit)
    Don't assert in igt_has_force_joiner_debugfs (Ankit)

add helpers to check whether force joiner debugfs exists
and to enable/disable force joiner for a specific connector.

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 lib/igt_kms.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/igt_kms.h |  2 ++
 2 files changed, 53 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 548c9d1f3..c38021dd7 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6171,6 +6171,57 @@ bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
 	return found;
 }
 
+/**
+ * Checks if the force big joiner debugfs is available
+ * for a specific connector.
+ *
+ * @drmfd: file descriptor of the DRM device.
+ * @output: output to check.
+ * Returns:
+ *  true if the debugfs is available, false otherwise.
+ */
+bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output)
+{
+	char buf[512];
+	int debugfs_fd, ret;
+
+	igt_assert_f(output->name, "Connector name cannot be NULL\n");
+	debugfs_fd = igt_debugfs_connector_dir(drmfd, output->name, O_RDONLY);
+	if (debugfs_fd < 0)
+		return false;
+	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
+	close(debugfs_fd);
+	return ret >= 0;
+}
+
+/**
+ * Forces the enable/disable state of big joiner for a specific connector.
+ *
+ * @drmfd The file descriptor of the DRM device.
+ * @connector_name The name of the connector.
+ * @enable The desired state of big joiner (true for enable, false for disable).
+ * Returns:
+ *  true if writing the debugfs was successful
+ *  and the state was set as requested, false otherwise.
+ */
+bool igt_force_and_check_bigjoiner_status(int drmfd, char *connector_name, bool enable)
+{
+	int debugfs_fd, ret;
+	char buf[512];
+
+	igt_assert_f(connector_name, "Connector name cannot be NULL\n");
+	debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_DIRECTORY);
+	igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", connector_name);
+	ret = igt_sysfs_write(debugfs_fd, "i915_bigjoiner_force_enable", enable ? "1" : "0", 1);
+	igt_assert_f(ret > 0, "Could not write i915_bigjoiner_force_enable for connector %s\n", connector_name);
+	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
+	close(debugfs_fd);
+	igt_assert_f(ret > 0, "Could not read i915_bigjoiner_force_enable for connector %s\n", connector_name);
+
+	return enable ? strstr(buf, "Bigjoiner enable: 1") :
+		    strstr(buf, "Bigjoiner enable: 0");
+}
+
 /**
  * igt_check_bigjoiner_support:
  * @display: a pointer to an #igt_display_t structure
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 0fa7a2ea1..6d13e5851 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1214,6 +1214,8 @@ int igt_get_max_dotclock(int fd);
 bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
 bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
 			  int max_dotclock, drmModeModeInfo *mode);
+bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output);
+bool igt_force_and_check_bigjoiner_status(int drmfd, char *connector_name, bool enable);
 bool igt_check_bigjoiner_support(igt_display_t *display);
 bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
 bool intel_pipe_output_combo_valid(igt_display_t *display);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner
  2024-03-21 18:28 ` [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner Kunal Joshi
@ 2024-03-25 10:22   ` Nautiyal, Ankit K
  0 siblings, 0 replies; 14+ messages in thread
From: Nautiyal, Ankit K @ 2024-03-25 10:22 UTC (permalink / raw)
  To: Kunal Joshi, igt-dev; +Cc: Stanislav Lisovskiy, Karthik B S, Bhanuprakash Modem


On 3/21/2024 11:58 PM, Kunal Joshi wrote:
> v2: Add documentation and rename (Ankit)
>      Combine enable/disable and status check (Ankit)
>      Don't assert in igt_has_force_joiner_debugfs (Ankit)
>
> add helpers to check whether force joiner debugfs exists
> and to enable/disable force joiner for a specific connector.
>
> Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Karthik B S <karthik.b.s@intel.com>
> Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>


Missing Signed-off-by

With SOB added, this is:

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>


> ---
>   lib/igt_kms.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
>   lib/igt_kms.h |  2 ++
>   2 files changed, 53 insertions(+)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index ff08b0eda..3d9796529 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -6171,6 +6171,57 @@ bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
>   	return found;
>   }
>   
> +/**
> + * Checks if the force big joiner debugfs is available
> + * for a specific connector.
> + *
> + * @drmfd: file descriptor of the DRM device.
> + * @output: output to check.
> + * Returns:
> + *  true if the debugfs is available, false otherwise.
> + */
> +bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output)
> +{
> +	char buf[512];
> +	int debugfs_fd, ret;
> +
> +	igt_assert_f(output->name, "Connector name cannot be NULL\n");
> +	debugfs_fd = igt_debugfs_connector_dir(drmfd, output->name, O_RDONLY);
> +	if (debugfs_fd < 0)
> +		return false;
> +	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
> +	close(debugfs_fd);
> +	return ret >= 0;
> +}
> +
> +/**
> + * Forces the enable/disable state of big joiner for a specific connector.
> + *
> + * @drmfd The file descriptor of the DRM device.
> + * @connector_name The name of the connector.
> + * @enable The desired state of big joiner (true for enable, false for disable).
> + * Returns:
> + *  true if writing the debugfs was successful
> + *  and the state was set as requested, false otherwise.
> + */
> +bool igt_force_and_check_bigjoiner_status(int drmfd, char *connector_name, bool enable)
> +{
> +    int debugfs_fd, ret;
> +    char buf[512];
> +
> +    igt_assert_f(connector_name, "Connector name cannot be NULL\n");
> +    debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_DIRECTORY);
> +    igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", connector_name);
> +    ret = igt_sysfs_write(debugfs_fd, "i915_bigjoiner_force_enable", enable ? "1" : "0", 1);
> +    igt_assert_f(ret > 0, "Could not write i915_bigjoiner_force_enable for connector %s\n", connector_name);
> +    ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
> +    close(debugfs_fd);
> +    igt_assert_f(ret > 0, "Could not read i915_bigjoiner_force_enable for connector %s\n", connector_name);
> +
> +    return enable ? strstr(buf, "Bigjoiner enable: 1") :
> +                    strstr(buf, "Bigjoiner enable: 0");
> +}
> +
>   /**
>    * igt_check_bigjoiner_support:
>    * @display: a pointer to an #igt_display_t structure
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 0fa7a2ea1..6d13e5851 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -1214,6 +1214,8 @@ int igt_get_max_dotclock(int fd);
>   bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
>   bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
>   			  int max_dotclock, drmModeModeInfo *mode);
> +bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output);
> +bool igt_force_and_check_bigjoiner_status(int drmfd, char *connector_name, bool enable);
>   bool igt_check_bigjoiner_support(igt_display_t *display);
>   bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
>   bool intel_pipe_output_combo_valid(igt_display_t *display);

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner
  2024-03-21 18:28 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
@ 2024-03-21 18:28 ` Kunal Joshi
  2024-03-25 10:22   ` Nautiyal, Ankit K
  0 siblings, 1 reply; 14+ messages in thread
From: Kunal Joshi @ 2024-03-21 18:28 UTC (permalink / raw)
  To: igt-dev
  Cc: Kunal Joshi, Stanislav Lisovskiy, Ankit Nautiyal, Karthik B S,
	Bhanuprakash Modem

v2: Add documentation and rename (Ankit)
    Combine enable/disable and status check (Ankit)
    Don't assert in igt_has_force_joiner_debugfs (Ankit)

add helpers to check whether force joiner debugfs exists
and to enable/disable force joiner for a specific connector.

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 lib/igt_kms.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/igt_kms.h |  2 ++
 2 files changed, 53 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index ff08b0eda..3d9796529 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6171,6 +6171,57 @@ bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
 	return found;
 }
 
+/**
+ * Checks if the force big joiner debugfs is available
+ * for a specific connector.
+ *
+ * @drmfd: file descriptor of the DRM device.
+ * @output: output to check.
+ * Returns:
+ *  true if the debugfs is available, false otherwise.
+ */
+bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output)
+{
+	char buf[512];
+	int debugfs_fd, ret;
+
+	igt_assert_f(output->name, "Connector name cannot be NULL\n");
+	debugfs_fd = igt_debugfs_connector_dir(drmfd, output->name, O_RDONLY);
+	if (debugfs_fd < 0)
+		return false;
+	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
+	close(debugfs_fd);
+	return ret >= 0;
+}
+
+/**
+ * Forces the enable/disable state of big joiner for a specific connector.
+ *
+ * @drmfd The file descriptor of the DRM device.
+ * @connector_name The name of the connector.
+ * @enable The desired state of big joiner (true for enable, false for disable).
+ * Returns:
+ *  true if writing the debugfs was successful
+ *  and the state was set as requested, false otherwise.
+ */
+bool igt_force_and_check_bigjoiner_status(int drmfd, char *connector_name, bool enable)
+{
+    int debugfs_fd, ret;
+    char buf[512];
+
+    igt_assert_f(connector_name, "Connector name cannot be NULL\n");
+    debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_DIRECTORY);
+    igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", connector_name);
+    ret = igt_sysfs_write(debugfs_fd, "i915_bigjoiner_force_enable", enable ? "1" : "0", 1);
+    igt_assert_f(ret > 0, "Could not write i915_bigjoiner_force_enable for connector %s\n", connector_name);
+    ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
+    close(debugfs_fd);
+    igt_assert_f(ret > 0, "Could not read i915_bigjoiner_force_enable for connector %s\n", connector_name);
+
+    return enable ? strstr(buf, "Bigjoiner enable: 1") :
+                    strstr(buf, "Bigjoiner enable: 0");
+}
+
 /**
  * igt_check_bigjoiner_support:
  * @display: a pointer to an #igt_display_t structure
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 0fa7a2ea1..6d13e5851 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1214,6 +1214,8 @@ int igt_get_max_dotclock(int fd);
 bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
 bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
 			  int max_dotclock, drmModeModeInfo *mode);
+bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output);
+bool igt_force_and_check_bigjoiner_status(int drmfd, char *connector_name, bool enable);
 bool igt_check_bigjoiner_support(igt_display_t *display);
 bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
 bool intel_pipe_output_combo_valid(igt_display_t *display);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner
  2024-03-20 12:53   ` Nautiyal, Ankit K
@ 2024-03-20 13:21     ` Nautiyal, Ankit K
  0 siblings, 0 replies; 14+ messages in thread
From: Nautiyal, Ankit K @ 2024-03-20 13:21 UTC (permalink / raw)
  To: Kunal Joshi, igt-dev; +Cc: Stanislav Lisovskiy, Karthik B S, Bhanuprakash Modem


On 3/20/2024 6:23 PM, Nautiyal, Ankit K wrote:
>
> On 3/10/2024 7:57 PM, Kunal Joshi wrote:
>> add helpers to check whether force joiner debugfs exists
>> and to enable/disable force joiner for a specific connector.
>>
>> Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
>> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> Cc: Karthik B S <karthik.b.s@intel.com>
>> Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
>> Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
>> ---
>>   lib/igt_kms.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++
>>   lib/igt_kms.h |  2 ++
>>   2 files changed, 61 insertions(+)
>>
>> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
>> index 63c8045c7..9d0cbd329 100644
>> --- a/lib/igt_kms.c
>> +++ b/lib/igt_kms.c
>> @@ -6168,6 +6168,65 @@ bool bigjoiner_mode_found(int drm_fd, 
>> drmModeConnector *connector,
>>       return found;
>>   }
>>   +/**
>> + * Checks if the force big joiner is enabled for a specific connector.
>> + *
>> + * @drmfd The file descriptor of the DRM device.
>> + * @connector_name The name of the connector.
>
> I think we dont need documentation for this, as this is straight 
> forward and just static function which is called from one place.


Looking at it again, it seems we dont need this as separate function, 
just simply read and return the status in the caller.

Regards,

Ankit

>
>> + * Returns:
>> + *  true if status equals enable, false otherwise.
>> + */
>> +static bool igt_check_force_bigjoiner_status(int drmfd, char 
>> *connector_name, bool enable)
>> +{
>> +    char buf[512];
>> +    int debugfs_fd, ret;
>> +
>> +    igt_assert_f(connector_name, "Connector name cannot be NULL\n");
>> +    debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, 
>> O_RDONLY);
>> +    igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for 
>> connector %s\n", connector_name);
>> +    ret = igt_debugfs_simple_read(debugfs_fd, 
>> "i915_bigjoiner_force_enable", buf, sizeof(buf));
>> +    close(debugfs_fd);
>> +    igt_assert_f(ret > 0, "Could not read 
>> i915_bigjoiner_force_enable for connector %s\n", connector_name);
>> +    return enable ? strstr(buf, "Bigjoiner enable: 1") :
>> +                    strstr(buf, "Bigjoiner enable: 0");
>> +}
>> +
>> +bool has_force_joiner_debugfs(int drmfd, igt_output_t *output)
>
> Since this helper is expected to be used in other tests, it would be 
> good to have documentation for this.
>
> Also, imho, it would be better to use igt_* for helpers, though we 
> seem to be not following this strictly.
>
>
>> +{
>> +    char buf[512];
>> +    int debugfs_fd, ret;
>> +
>> +    igt_assert_f(output->name, "Connector name cannot be NULL\n");
>> +    debugfs_fd = igt_debugfs_connector_dir(drmfd, output->name, 
>> O_RDONLY);
>> +    igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for 
>> connector %s\n", output->name);
>
> I think we should not assert here, this will fail for platforms that 
> do not support bigjoiner. Perhaps returning false will be sufficient.
>
>
> Regards,
>
> Ankit
>
>> +    ret = igt_debugfs_simple_read(debugfs_fd, 
>> "i915_bigjoiner_force_enable", buf, sizeof(buf));
>> +    close(debugfs_fd);
>> +    return ret >= 0;
>> +}
>> +
>> +/**
>> + * Forces the enable/disable state of big joiner for a specific 
>> connector.
>> + *
>> + * @drmfd The file descriptor of the DRM device.
>> + * @connector_name The name of the connector.
>> + * @enable The desired state of big joiner (true for enable, false 
>> for disable).
>> + * Returns:
>> + *  true on success, false otherwise.
>> + */
>> +bool igt_force_bigjoiner_enable(int drmfd, char *connector_name, 
>> bool enable)
>> +{
>> +    int debugfs_fd, ret;
>> +
>> +    igt_assert_f(connector_name, "Connector name cannot be NULL\n");
>> +    debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, 
>> O_DIRECTORY);
>> +    igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for 
>> connector %s\n", connector_name);
>> +    ret = igt_sysfs_write(debugfs_fd, "i915_bigjoiner_force_enable", 
>> enable ? "1" : "0", 1);
>> +    close(debugfs_fd);
>> +    igt_assert_f(ret > 0, "Could not write 
>> i915_bigjoiner_force_enable for connector %s\n", connector_name);
>> +
>> +    return igt_check_force_bigjoiner_status(drmfd, connector_name, 
>> enable);
>> +}
>> +
>>   /**
>>    * igt_check_bigjoiner_support:
>>    * @display: a pointer to an #igt_display_t structure
>> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
>> index bab8487d3..f13b7fd53 100644
>> --- a/lib/igt_kms.h
>> +++ b/lib/igt_kms.h
>> @@ -1214,6 +1214,8 @@ int igt_get_max_dotclock(int fd);
>>   bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
>>   bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
>>                 int max_dotclock);
>> +bool has_force_joiner_debugfs(int drmfd, igt_output_t *output);
>> +bool igt_force_bigjoiner_enable(int drmfd, char *connector_name, 
>> bool enable);
>>   bool igt_check_bigjoiner_support(igt_display_t *display);
>>   bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo 
>> *mode);
>>   bool intel_pipe_output_combo_valid(igt_display_t *display);

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner
  2024-03-10 14:27 ` [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner Kunal Joshi
@ 2024-03-20 12:53   ` Nautiyal, Ankit K
  2024-03-20 13:21     ` Nautiyal, Ankit K
  0 siblings, 1 reply; 14+ messages in thread
From: Nautiyal, Ankit K @ 2024-03-20 12:53 UTC (permalink / raw)
  To: Kunal Joshi, igt-dev; +Cc: Stanislav Lisovskiy, Karthik B S, Bhanuprakash Modem


On 3/10/2024 7:57 PM, Kunal Joshi wrote:
> add helpers to check whether force joiner debugfs exists
> and to enable/disable force joiner for a specific connector.
>
> Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Karthik B S <karthik.b.s@intel.com>
> Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
> ---
>   lib/igt_kms.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++
>   lib/igt_kms.h |  2 ++
>   2 files changed, 61 insertions(+)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 63c8045c7..9d0cbd329 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -6168,6 +6168,65 @@ bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
>   	return found;
>   }
>   
> +/**
> + * Checks if the force big joiner is enabled for a specific connector.
> + *
> + * @drmfd The file descriptor of the DRM device.
> + * @connector_name The name of the connector.

I think we dont need documentation for this, as this is straight forward 
and just static function which is called from one place.

> + * Returns:
> + *  true if status equals enable, false otherwise.
> + */
> +static bool igt_check_force_bigjoiner_status(int drmfd, char *connector_name, bool enable)
> +{
> +	char buf[512];
> +	int debugfs_fd, ret;
> +
> +	igt_assert_f(connector_name, "Connector name cannot be NULL\n");
> +	debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_RDONLY);
> +	igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", connector_name);
> +	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
> +	close(debugfs_fd);
> +	igt_assert_f(ret > 0, "Could not read i915_bigjoiner_force_enable for connector %s\n", connector_name);
> +	return enable ? strstr(buf, "Bigjoiner enable: 1") :
> +					strstr(buf, "Bigjoiner enable: 0");
> +}
> +
> +bool has_force_joiner_debugfs(int drmfd, igt_output_t *output)

Since this helper is expected to be used in other tests, it would be 
good to have documentation for this.

Also, imho, it would be better to use igt_* for helpers, though we seem 
to be not following this strictly.


> +{
> +	char buf[512];
> +	int debugfs_fd, ret;
> +
> +	igt_assert_f(output->name, "Connector name cannot be NULL\n");
> +	debugfs_fd = igt_debugfs_connector_dir(drmfd, output->name, O_RDONLY);
> +	igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", output->name);

I think we should not assert here, this will fail for platforms that do 
not support bigjoiner. Perhaps returning false will be sufficient.


Regards,

Ankit

> +	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
> +	close(debugfs_fd);
> +	return ret >= 0;
> +}
> +
> +/**
> + * Forces the enable/disable state of big joiner for a specific connector.
> + *
> + * @drmfd The file descriptor of the DRM device.
> + * @connector_name The name of the connector.
> + * @enable The desired state of big joiner (true for enable, false for disable).
> + * Returns:
> + *  true on success, false otherwise.
> + */
> +bool igt_force_bigjoiner_enable(int drmfd, char *connector_name, bool enable)
> +{
> +	int debugfs_fd, ret;
> +
> +	igt_assert_f(connector_name, "Connector name cannot be NULL\n");
> +	debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_DIRECTORY);
> +	igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", connector_name);
> +	ret = igt_sysfs_write(debugfs_fd, "i915_bigjoiner_force_enable", enable ? "1" : "0", 1);
> +	close(debugfs_fd);
> +	igt_assert_f(ret > 0, "Could not write i915_bigjoiner_force_enable for connector %s\n", connector_name);
> +
> +	return igt_check_force_bigjoiner_status(drmfd, connector_name, enable);
> +}
> +
>   /**
>    * igt_check_bigjoiner_support:
>    * @display: a pointer to an #igt_display_t structure
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index bab8487d3..f13b7fd53 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -1214,6 +1214,8 @@ int igt_get_max_dotclock(int fd);
>   bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
>   bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
>   			  int max_dotclock);
> +bool has_force_joiner_debugfs(int drmfd, igt_output_t *output);
> +bool igt_force_bigjoiner_enable(int drmfd, char *connector_name, bool enable);
>   bool igt_check_bigjoiner_support(igt_display_t *display);
>   bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
>   bool intel_pipe_output_combo_valid(igt_display_t *display);

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner
  2024-03-10 14:27 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
@ 2024-03-10 14:27 ` Kunal Joshi
  2024-03-20 12:53   ` Nautiyal, Ankit K
  0 siblings, 1 reply; 14+ messages in thread
From: Kunal Joshi @ 2024-03-10 14:27 UTC (permalink / raw)
  To: igt-dev
  Cc: Kunal Joshi, Stanislav Lisovskiy, Ankit Nautiyal, Karthik B S,
	Bhanuprakash Modem

add helpers to check whether force joiner debugfs exists
and to enable/disable force joiner for a specific connector.

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
 lib/igt_kms.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/igt_kms.h |  2 ++
 2 files changed, 61 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 63c8045c7..9d0cbd329 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6168,6 +6168,65 @@ bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
 	return found;
 }
 
+/**
+ * Checks if the force big joiner is enabled for a specific connector.
+ *
+ * @drmfd The file descriptor of the DRM device.
+ * @connector_name The name of the connector.
+ * Returns:
+ *  true if status equals enable, false otherwise.
+ */
+static bool igt_check_force_bigjoiner_status(int drmfd, char *connector_name, bool enable)
+{
+	char buf[512];
+	int debugfs_fd, ret;
+
+	igt_assert_f(connector_name, "Connector name cannot be NULL\n");
+	debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_RDONLY);
+	igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", connector_name);
+	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
+	close(debugfs_fd);
+	igt_assert_f(ret > 0, "Could not read i915_bigjoiner_force_enable for connector %s\n", connector_name);
+	return enable ? strstr(buf, "Bigjoiner enable: 1") :
+					strstr(buf, "Bigjoiner enable: 0");
+}
+
+bool has_force_joiner_debugfs(int drmfd, igt_output_t *output)
+{
+	char buf[512];
+	int debugfs_fd, ret;
+
+	igt_assert_f(output->name, "Connector name cannot be NULL\n");
+	debugfs_fd = igt_debugfs_connector_dir(drmfd, output->name, O_RDONLY);
+	igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", output->name);
+	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
+	close(debugfs_fd);
+	return ret >= 0;
+}
+
+/**
+ * Forces the enable/disable state of big joiner for a specific connector.
+ *
+ * @drmfd The file descriptor of the DRM device.
+ * @connector_name The name of the connector.
+ * @enable The desired state of big joiner (true for enable, false for disable).
+ * Returns:
+ *  true on success, false otherwise.
+ */
+bool igt_force_bigjoiner_enable(int drmfd, char *connector_name, bool enable)
+{
+	int debugfs_fd, ret;
+
+	igt_assert_f(connector_name, "Connector name cannot be NULL\n");
+	debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_DIRECTORY);
+	igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", connector_name);
+	ret = igt_sysfs_write(debugfs_fd, "i915_bigjoiner_force_enable", enable ? "1" : "0", 1);
+	close(debugfs_fd);
+	igt_assert_f(ret > 0, "Could not write i915_bigjoiner_force_enable for connector %s\n", connector_name);
+
+	return igt_check_force_bigjoiner_status(drmfd, connector_name, enable);
+}
+
 /**
  * igt_check_bigjoiner_support:
  * @display: a pointer to an #igt_display_t structure
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index bab8487d3..f13b7fd53 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1214,6 +1214,8 @@ int igt_get_max_dotclock(int fd);
 bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
 bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
 			  int max_dotclock);
+bool has_force_joiner_debugfs(int drmfd, igt_output_t *output);
+bool igt_force_bigjoiner_enable(int drmfd, char *connector_name, bool enable);
 bool igt_check_bigjoiner_support(igt_display_t *display);
 bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
 bool intel_pipe_output_combo_valid(igt_display_t *display);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-03-28  9:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28  8:39 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
2024-03-28  8:39 ` [PATCH i-g-t 1/4] lib/igt_kms: move bigjoiner_mode_found to lib Kunal Joshi
2024-03-28  8:39 ` [PATCH i-g-t 2/4] tests/intel/kms_big_joiner: revamp bigjoiner Kunal Joshi
2024-03-28  9:18   ` Nautiyal, Ankit K
2024-03-28  8:39 ` [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner Kunal Joshi
2024-03-28  8:39 ` [PATCH i-g-t 4/4] tests/intel/kms_big_joiner: add tests for " Kunal Joshi
2024-03-28  9:51 ` ✓ CI.xeBAT: success for revamp big joiner test (rev10) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-03-25 16:51 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
2024-03-25 16:51 ` [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner Kunal Joshi
2024-03-28  7:11   ` Nautiyal, Ankit K
2024-03-21 18:28 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
2024-03-21 18:28 ` [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner Kunal Joshi
2024-03-25 10:22   ` Nautiyal, Ankit K
2024-03-10 14:27 [PATCH i-g-t 0/4] revamp big joiner test Kunal Joshi
2024-03-10 14:27 ` [PATCH i-g-t 3/4] lib/igt_kms: add helper to enable/disable force joiner Kunal Joshi
2024-03-20 12:53   ` Nautiyal, Ankit K
2024-03-20 13:21     ` Nautiyal, Ankit K

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.