Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [i-g-t V6 0/6] Check the validity of selected pipe/output combo
@ 2024-06-18  6:23 Bhanuprakash Modem
  2024-06-18  6:24 ` [i-g-t V6 1/6] lib/igt_kms: Check validity of the selcted " Bhanuprakash Modem
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Bhanuprakash Modem @ 2024-06-18  6:23 UTC (permalink / raw)
  To: igt-dev; +Cc: Bhanuprakash Modem

Use IGT lib helper to make sure the selected pipe/output/mode combo is valid.

Bhanuprakash Modem (6):
  lib/igt_kms: Check validity of the selcted pipe/output combo
  tests/kms: Drop redundant check for pipe/output combo validity
  tests/chamelium: Use lib helper to check the pipe/output combo
    validity
  tests/intel/kms: Use lib helper to check the pipe/output combo
    validity
  tests/kms_dither: Use lib helper to check the pipe/output combo
    validity
  tests/kms_hdr: Use lib helper to check the pipe/output combo validity

 lib/igt_kms.c                          |  9 ++-
 tests/chamelium/kms_chamelium_helper.c | 12 +++-
 tests/chamelium/kms_chamelium_hpd.c    |  5 +-
 tests/intel/kms_pm_backlight.c         |  7 +-
 tests/intel/kms_psr.c                  | 17 +++--
 tests/kms_content_protection.c         |  3 -
 tests/kms_dither.c                     | 24 ++++---
 tests/kms_hdr.c                        | 90 +++++++++++++++-----------
 tests/kms_properties.c                 |  3 -
 tests/kms_vrr.c                        | 22 +++----
 10 files changed, 108 insertions(+), 84 deletions(-)

-- 
2.43.2


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

* [i-g-t V6 1/6] lib/igt_kms: Check validity of the selcted pipe/output combo
  2024-06-18  6:23 [i-g-t V6 0/6] Check the validity of selected pipe/output combo Bhanuprakash Modem
@ 2024-06-18  6:24 ` Bhanuprakash Modem
  2024-06-18  6:24 ` [i-g-t V6 2/6] tests/kms: Drop redundant check for pipe/output combo validity Bhanuprakash Modem
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Bhanuprakash Modem @ 2024-06-18  6:24 UTC (permalink / raw)
  To: igt-dev; +Cc: Bhanuprakash Modem, Jeevan B

Add a check to identify the selcted pipe/output combination is
valid or not.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Reviewed-by: Jeevan B <jeevan.b@intel.com>
---
 lib/igt_kms.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index af63d13b1..2e6f44e3c 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6480,18 +6480,21 @@ bool intel_pipe_output_combo_valid(igt_display_t *display)
 	int combo = 0;
 	igt_output_t *output;
 
-	if (!is_intel_device(display->drm_fd))
-		return true;
-
 	for_each_connected_output(display, output) {
 		if (output->pending_pipe == PIPE_NONE)
 			continue;
 
+		if (!igt_pipe_connector_valid(output->pending_pipe, output))
+			return false;
+
 		combo++;
 	}
 
 	igt_assert_f(combo, "At least one pipe/output combo needed.\n");
 
+	if (!is_intel_device(display->drm_fd))
+		return true;
+
 	/*
 	 * Check the given pipe/output combo is valid for Bigjoiner.
 	 *
-- 
2.43.2


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

* [i-g-t V6 2/6] tests/kms: Drop redundant check for pipe/output combo validity
  2024-06-18  6:23 [i-g-t V6 0/6] Check the validity of selected pipe/output combo Bhanuprakash Modem
  2024-06-18  6:24 ` [i-g-t V6 1/6] lib/igt_kms: Check validity of the selcted " Bhanuprakash Modem
@ 2024-06-18  6:24 ` Bhanuprakash Modem
  2024-06-18  6:24 ` [i-g-t V6 3/6] tests/chamelium: Use lib helper to check the " Bhanuprakash Modem
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Bhanuprakash Modem @ 2024-06-18  6:24 UTC (permalink / raw)
  To: igt-dev; +Cc: Bhanuprakash Modem, Jeevan B

As intel_pipe_output_combo_valid() is taking care of pipe/output
combo validity, drop other redundant checks.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Reviewed-by: Jeevan B <jeevan.b@intel.com>
---
 tests/kms_content_protection.c |  3 ---
 tests/kms_properties.c         |  3 ---
 tests/kms_vrr.c                | 22 ++++++++++------------
 3 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 6858b22e2..e9a468eb0 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -564,9 +564,6 @@ test_content_protection(enum igt_commit_style s, int content_type)
 
 	for_each_connected_output(display, output) {
 		for_each_pipe(display, pipe) {
-			if (!igt_pipe_connector_valid(pipe, output))
-				continue;
-
 			igt_display_reset(display);
 
 			igt_output_set_pipe(output, pipe);
diff --git a/tests/kms_properties.c b/tests/kms_properties.c
index bd414f534..6f92b218e 100644
--- a/tests/kms_properties.c
+++ b/tests/kms_properties.c
@@ -337,9 +337,6 @@ static void connector_properties(igt_display_t *display, bool atomic)
 		bool found = false;
 
 		for_each_pipe(display, pipe) {
-			if (!igt_pipe_connector_valid(pipe, output))
-				continue;
-
 			igt_display_reset(display);
 
 			igt_output_set_pipe(output, pipe);
diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c
index 7f64d6806..5af220b5b 100644
--- a/tests/kms_vrr.c
+++ b/tests/kms_vrr.c
@@ -794,22 +794,20 @@ run_vrr_test(data_t *data, test_t test, uint32_t flags)
 			continue;
 
 		for_each_pipe(&data->display, pipe) {
-			if (igt_pipe_connector_valid(pipe, output)) {
-				igt_output_set_pipe(output, pipe);
+			igt_output_set_pipe(output, pipe);
 
-				if (!intel_pipe_output_combo_valid(&data->display)) {
-					igt_output_set_pipe(output, PIPE_NONE);
-					continue;
-				}
+			if (!intel_pipe_output_combo_valid(&data->display)) {
+				igt_output_set_pipe(output, PIPE_NONE);
+				continue;
+			}
 
-				igt_dynamic_f("pipe-%s-%s",
-					      kmstest_pipe_name(pipe), output->name)
-					test(data, pipe, output, flags);
+			igt_dynamic_f("pipe-%s-%s",
+				      kmstest_pipe_name(pipe), output->name)
+				test(data, pipe, output, flags);
 
-				test_cleanup(data, pipe, output);
+			test_cleanup(data, pipe, output);
 
-				break;
-			}
+			break;
 		}
 	}
 }
-- 
2.43.2


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

* [i-g-t V6 3/6] tests/chamelium: Use lib helper to check the pipe/output combo validity
  2024-06-18  6:23 [i-g-t V6 0/6] Check the validity of selected pipe/output combo Bhanuprakash Modem
  2024-06-18  6:24 ` [i-g-t V6 1/6] lib/igt_kms: Check validity of the selcted " Bhanuprakash Modem
  2024-06-18  6:24 ` [i-g-t V6 2/6] tests/kms: Drop redundant check for pipe/output combo validity Bhanuprakash Modem
@ 2024-06-18  6:24 ` Bhanuprakash Modem
  2024-06-18  6:24 ` [i-g-t V6 4/6] tests/intel/kms: " Bhanuprakash Modem
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Bhanuprakash Modem @ 2024-06-18  6:24 UTC (permalink / raw)
  To: igt-dev; +Cc: Bhanuprakash Modem, Jeevan B

Use IGT lib helper intel_pipe_output_combo_valid() to make sure the
selected pipe/output/mode combo is valid.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Reviewed-by: Jeevan B <jeevan.b@intel.com>
---
 tests/chamelium/kms_chamelium_helper.c | 12 +++++++++---
 tests/chamelium/kms_chamelium_hpd.c    |  5 ++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/chamelium/kms_chamelium_helper.c b/tests/chamelium/kms_chamelium_helper.c
index 197d29be9..26c5f87f1 100644
--- a/tests/chamelium/kms_chamelium_helper.c
+++ b/tests/chamelium/kms_chamelium_helper.c
@@ -207,9 +207,15 @@ enum pipe chamelium_get_pipe_for_output(igt_display_t *display,
 	enum pipe pipe;
 
 	for_each_pipe(display, pipe) {
-		if (igt_pipe_connector_valid(pipe, output)) {
-			return pipe;
+		igt_output_set_pipe(output, pipe);
+
+		if (!intel_pipe_output_combo_valid(display)) {
+			igt_output_set_pipe(output, PIPE_NONE);
+			continue;
 		}
+
+		igt_output_set_pipe(output, PIPE_NONE);
+		return pipe;
 	}
 
 	igt_assert_f(false, "No pipe found for output %s\n",
@@ -344,4 +350,4 @@ bool chamelium_check_analog_bridge(chamelium_data_t *data,
 		return true;
 
 	return false;
-}
\ No newline at end of file
+}
diff --git a/tests/chamelium/kms_chamelium_hpd.c b/tests/chamelium/kms_chamelium_hpd.c
index 858c595cb..52e758087 100644
--- a/tests/chamelium/kms_chamelium_hpd.c
+++ b/tests/chamelium/kms_chamelium_hpd.c
@@ -345,10 +345,9 @@ static void test_hotplug_for_each_pipe(chamelium_data_t *data,
 		output = chamelium_get_output_for_port(data, port);
 
 		/* If pipe is valid for output then set it */
-		if (igt_pipe_connector_valid(pipe, output)) {
-			igt_output_set_pipe(output, pipe);
+		igt_output_set_pipe(output, pipe);
+		if (intel_pipe_output_combo_valid(&data->display))
 			igt_display_commit2(&data->display, COMMIT_ATOMIC);
-		}
 
 		chamelium_unplug(data->chamelium, port);
 		chamelium_wait_for_connector_after_hotplug(
-- 
2.43.2


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

* [i-g-t V6 4/6] tests/intel/kms: Use lib helper to check the pipe/output combo validity
  2024-06-18  6:23 [i-g-t V6 0/6] Check the validity of selected pipe/output combo Bhanuprakash Modem
                   ` (2 preceding siblings ...)
  2024-06-18  6:24 ` [i-g-t V6 3/6] tests/chamelium: Use lib helper to check the " Bhanuprakash Modem
@ 2024-06-18  6:24 ` Bhanuprakash Modem
  2024-06-18  6:24 ` [i-g-t V6 5/6] tests/kms_dither: " Bhanuprakash Modem
  2024-06-18  6:24 ` [i-g-t V6 6/6] tests/kms_hdr: " Bhanuprakash Modem
  5 siblings, 0 replies; 9+ messages in thread
From: Bhanuprakash Modem @ 2024-06-18  6:24 UTC (permalink / raw)
  To: igt-dev; +Cc: Bhanuprakash Modem, Jeevan B

Use IGT lib helper intel_pipe_output_combo_valid() to make sure the
selected pipe/output/mode combo is valid.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Reviewed-by: Jeevan B <jeevan.b@intel.com>
---
 tests/intel/kms_pm_backlight.c |  7 ++++---
 tests/intel/kms_psr.c          | 17 ++++++++++++-----
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/tests/intel/kms_pm_backlight.c b/tests/intel/kms_pm_backlight.c
index 2e691dab0..8672afa7a 100644
--- a/tests/intel/kms_pm_backlight.c
+++ b/tests/intel/kms_pm_backlight.c
@@ -234,10 +234,11 @@ static void test_setup(igt_display_t display, igt_output_t *output)
 	igt_display_reset(&display);
 
 	for_each_pipe(&display, pipe) {
-		if (!igt_pipe_connector_valid(pipe, output))
-			continue;
-
 		igt_output_set_pipe(output, pipe);
+		if (!intel_pipe_output_combo_valid(&display)) {
+			igt_output_set_pipe(output, PIPE_NONE);
+			continue;
+		}
 		mode = igt_output_get_mode(output);
 
 		igt_create_pattern_fb(display.drm_fd,
diff --git a/tests/intel/kms_psr.c b/tests/intel/kms_psr.c
index c90612426..f3caa9ecc 100644
--- a/tests/intel/kms_psr.c
+++ b/tests/intel/kms_psr.c
@@ -728,9 +728,14 @@ static enum pipe get_pipe_for_output(igt_display_t *display,
 	enum pipe pipe;
 
 	for_each_pipe(display, pipe) {
-		if (igt_pipe_connector_valid(pipe, output)) {
-			return pipe;
+		igt_output_set_pipe(output, pipe);
+
+		if (!intel_pipe_output_combo_valid(display)) {
+			igt_output_set_pipe(output, PIPE_NONE);
+			continue;
 		}
+
+		return pipe;
 	}
 
 	igt_assert_f(false, "No pipe found for output %s\n",
@@ -750,9 +755,6 @@ static void test_setup(data_t *data)
 			      "Can't test FBC with PSR\n");
 
 	pipe = get_pipe_for_output(&data->display, data->output);
-	igt_output_set_pipe(data->output, pipe);
-	igt_require_f(intel_pipe_output_combo_valid(&data->display),
-		      "output pipe combo not valid\n");
 	data->crtc_id = data->output->config.crtc->crtc_id;
 	connector = data->output->config.connector;
 
@@ -763,6 +765,11 @@ static void test_setup(data_t *data)
 
 		igt_output_override_mode(data->output, data->mode);
 
+		if (!intel_pipe_output_combo_valid(&data->display)) {
+			igt_info("Skipping mode, not compatible with selected pipe/output\n");
+			continue;
+		}
+
 		psr_enable_if_enabled(data);
 		setup_test_plane(data, data->test_plane_id);
 		if (psr_wait_entry_if_enabled(data)) {
-- 
2.43.2


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

* [i-g-t V6 5/6] tests/kms_dither: Use lib helper to check the pipe/output combo validity
  2024-06-18  6:23 [i-g-t V6 0/6] Check the validity of selected pipe/output combo Bhanuprakash Modem
                   ` (3 preceding siblings ...)
  2024-06-18  6:24 ` [i-g-t V6 4/6] tests/intel/kms: " Bhanuprakash Modem
@ 2024-06-18  6:24 ` Bhanuprakash Modem
  2024-06-18  8:45   ` B, Jeevan
  2024-06-18  6:24 ` [i-g-t V6 6/6] tests/kms_hdr: " Bhanuprakash Modem
  5 siblings, 1 reply; 9+ messages in thread
From: Bhanuprakash Modem @ 2024-06-18  6:24 UTC (permalink / raw)
  To: igt-dev; +Cc: Bhanuprakash Modem, Jeevan B

Use IGT lib helper intel_pipe_output_combo_valid() to make sure the
selected pipe/output/mode combo is valid.

V2: - Split the patch into multiple.

Cc: Jeevan B <jeevan.b@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/kms_dither.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/tests/kms_dither.c b/tests/kms_dither.c
index af7b7f05c..21b1210b4 100644
--- a/tests/kms_dither.c
+++ b/tests/kms_dither.c
@@ -76,13 +76,10 @@ typedef struct {
 /* Prepare test data. */
 static void prepare_test(data_t *data, igt_output_t *output, enum pipe p)
 {
-	igt_display_t *display = &data->display;
 	igt_pipe_t *pipe = &data->display.pipes[p];
 
 	igt_assert(pipe);
 
-	igt_display_reset(display);
-
 	data->primary =
 		igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
 
@@ -205,6 +202,8 @@ run_dither_test(data_t *data, int fb_bpc, int fb_format, int output_bpc)
 	igt_output_t *output;
 	igt_display_t *display = &data->display;
 
+	igt_display_reset(display);
+
 	for_each_connected_output(display, output) {
 		enum pipe pipe;
 
@@ -215,15 +214,20 @@ run_dither_test(data_t *data, int fb_bpc, int fb_format, int output_bpc)
 			continue;
 
 		for_each_pipe(display, pipe) {
-			if (igt_pipe_connector_valid(pipe, output)) {
-				igt_dynamic_f("pipe-%s-%s",
-					      kmstest_pipe_name(pipe), output->name)
-					test_dithering(data, pipe, output, fb_bpc,
-							fb_format, output_bpc);
+			igt_output_set_pipe(output, pipe);
 
-				/* One pipe is enough */
-				break;
+			if (!intel_pipe_output_combo_valid(display)) {
+				igt_output_set_pipe(output, PIPE_NONE);
+				continue;
 			}
+
+			igt_dynamic_f("pipe-%s-%s",
+					      kmstest_pipe_name(pipe), output->name)
+				test_dithering(data, pipe, output, fb_bpc,
+							   fb_format, output_bpc);
+
+			/* One pipe is enough */
+			break;
 		}
 	}
 }
-- 
2.43.2


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

* [i-g-t V6 6/6] tests/kms_hdr: Use lib helper to check the pipe/output combo validity
  2024-06-18  6:23 [i-g-t V6 0/6] Check the validity of selected pipe/output combo Bhanuprakash Modem
                   ` (4 preceding siblings ...)
  2024-06-18  6:24 ` [i-g-t V6 5/6] tests/kms_dither: " Bhanuprakash Modem
@ 2024-06-18  6:24 ` Bhanuprakash Modem
  2024-06-18  8:46   ` B, Jeevan
  5 siblings, 1 reply; 9+ messages in thread
From: Bhanuprakash Modem @ 2024-06-18  6:24 UTC (permalink / raw)
  To: igt-dev; +Cc: Bhanuprakash Modem, Jeevan B

Use IGT lib helper intel_pipe_output_combo_valid() to make sure the
selected pipe/output/mode combo is valid.

Cc: Jeevan B <jeevan.b@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/kms_hdr.c | 90 ++++++++++++++++++++++++++++---------------------
 1 file changed, 51 insertions(+), 39 deletions(-)

diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
index 99b78f7ef..475463c21 100644
--- a/tests/kms_hdr.c
+++ b/tests/kms_hdr.c
@@ -261,6 +261,8 @@ static void test_bpc_switch(data_t *data, uint32_t flags)
 	igt_display_t *display = &data->display;
 	igt_output_t *output;
 
+	igt_display_reset(display);
+
 	for_each_connected_output(display, output) {
 		enum pipe pipe;
 
@@ -271,26 +273,30 @@ static void test_bpc_switch(data_t *data, uint32_t flags)
 			continue;
 
 		for_each_pipe(display, pipe) {
-			if (igt_pipe_connector_valid(pipe, output)) {
-				prepare_test(data, output, pipe);
-
-				if (is_intel_device(data->fd) &&
-				    !igt_max_bpc_constraint(display, pipe, output, 10)) {
-					test_fini(data);
-					break;
-				}
-
-				data->mode = igt_output_get_mode(output);
-				data->w = data->mode->hdisplay;
-				data->h = data->mode->vdisplay;
+			igt_output_set_pipe(output, pipe);
+			if (intel_pipe_output_combo_valid(display)) {
+				igt_output_set_pipe(output, PIPE_NONE);
+				continue;
+			}
 
-				igt_dynamic_f("pipe-%s-%s",
-					      kmstest_pipe_name(pipe), output->name)
-					test_bpc_switch_on_output(data, pipe, output, flags);
+			prepare_test(data, output, pipe);
 
-				/* One pipe is enough */
+			if (is_intel_device(data->fd) &&
+			    !igt_max_bpc_constraint(display, pipe, output, 10)) {
+				test_fini(data);
 				break;
 			}
+
+			data->mode = igt_output_get_mode(output);
+			data->w = data->mode->hdisplay;
+			data->h = data->mode->vdisplay;
+
+			igt_dynamic_f("pipe-%s-%s",
+				      kmstest_pipe_name(pipe), output->name)
+				test_bpc_switch_on_output(data, pipe, output, flags);
+
+			/* One pipe is enough */
+			break;
 		}
 	}
 }
@@ -614,6 +620,8 @@ static void test_hdr(data_t *data, uint32_t flags)
 	igt_display_t *display = &data->display;
 	igt_output_t *output;
 
+	igt_display_reset(display);
+
 	for_each_connected_output(display, output) {
 		enum pipe pipe;
 
@@ -635,32 +643,36 @@ static void test_hdr(data_t *data, uint32_t flags)
 			continue;
 
 		for_each_pipe(display, pipe) {
-			if (igt_pipe_connector_valid(pipe, output)) {
-				prepare_test(data, output, pipe);
+			igt_output_set_pipe(output, pipe);
+			if (!intel_pipe_output_combo_valid(display)) {
+				igt_output_set_pipe(output, PIPE_NONE);
+				continue;
+			}
 
-				if (is_intel_device(data->fd) &&
-				    !igt_max_bpc_constraint(display, pipe, output, 10)) {
-					test_fini(data);
-					break;
-				}
-
-				data->mode = igt_output_get_mode(output);
-				data->w = data->mode->hdisplay;
-				data->h = data->mode->vdisplay;
-
-				igt_dynamic_f("pipe-%s-%s",
-					      kmstest_pipe_name(pipe), output->name) {
-					if (flags & (TEST_NONE | TEST_DPMS | TEST_SUSPEND | TEST_INVALID_HDR))
-						test_static_toggle(data, pipe, output, flags);
-					if (flags & TEST_SWAP)
-						test_static_swap(data, pipe, output);
-					if (flags & TEST_INVALID_METADATA_SIZES)
-						test_invalid_metadata_sizes(data, output);
-				}
-
-				/* One pipe is enough */
+			prepare_test(data, output, pipe);
+
+			if (is_intel_device(data->fd) &&
+			    !igt_max_bpc_constraint(display, pipe, output, 10)) {
+				test_fini(data);
 				break;
 			}
+
+			data->mode = igt_output_get_mode(output);
+			data->w = data->mode->hdisplay;
+			data->h = data->mode->vdisplay;
+
+			igt_dynamic_f("pipe-%s-%s",
+				      kmstest_pipe_name(pipe), output->name) {
+				if (flags & (TEST_NONE | TEST_DPMS | TEST_SUSPEND | TEST_INVALID_HDR))
+					test_static_toggle(data, pipe, output, flags);
+				if (flags & TEST_SWAP)
+					test_static_swap(data, pipe, output);
+				if (flags & TEST_INVALID_METADATA_SIZES)
+					test_invalid_metadata_sizes(data, output);
+			}
+
+			/* One pipe is enough */
+			break;
 		}
 	}
 }
-- 
2.43.2


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

* RE: [i-g-t V6 5/6] tests/kms_dither: Use lib helper to check the pipe/output combo validity
  2024-06-18  6:24 ` [i-g-t V6 5/6] tests/kms_dither: " Bhanuprakash Modem
@ 2024-06-18  8:45   ` B, Jeevan
  0 siblings, 0 replies; 9+ messages in thread
From: B, Jeevan @ 2024-06-18  8:45 UTC (permalink / raw)
  To: Modem, Bhanuprakash, igt-dev@lists.freedesktop.org

LGTM. 

Reviewed-by: Jeevan B <jeevan.b@intel.com>

> -----Original Message-----
> From: Modem, Bhanuprakash <bhanuprakash.modem@intel.com>
> Sent: Tuesday, June 18, 2024 11:54 AM
> To: igt-dev@lists.freedesktop.org
> Cc: Modem, Bhanuprakash <bhanuprakash.modem@intel.com>; B, Jeevan
> <jeevan.b@intel.com>
> Subject: [i-g-t V6 5/6] tests/kms_dither: Use lib helper to check the
> pipe/output combo validity
> 
> Use IGT lib helper intel_pipe_output_combo_valid() to make sure the selected
> pipe/output/mode combo is valid.
> 
> V2: - Split the patch into multiple.
> 
> Cc: Jeevan B <jeevan.b@intel.com>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> ---
>  tests/kms_dither.c | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/kms_dither.c b/tests/kms_dither.c index
> af7b7f05c..21b1210b4 100644
> --- a/tests/kms_dither.c
> +++ b/tests/kms_dither.c
> @@ -76,13 +76,10 @@ typedef struct {
>  /* Prepare test data. */
>  static void prepare_test(data_t *data, igt_output_t *output, enum pipe p)  {
> -	igt_display_t *display = &data->display;
>  	igt_pipe_t *pipe = &data->display.pipes[p];
> 
>  	igt_assert(pipe);
> 
> -	igt_display_reset(display);
> -
>  	data->primary =
>  		igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
> 
> @@ -205,6 +202,8 @@ run_dither_test(data_t *data, int fb_bpc, int
> fb_format, int output_bpc)
>  	igt_output_t *output;
>  	igt_display_t *display = &data->display;
> 
> +	igt_display_reset(display);
> +
>  	for_each_connected_output(display, output) {
>  		enum pipe pipe;
> 
> @@ -215,15 +214,20 @@ run_dither_test(data_t *data, int fb_bpc, int
> fb_format, int output_bpc)
>  			continue;
> 
>  		for_each_pipe(display, pipe) {
> -			if (igt_pipe_connector_valid(pipe, output)) {
> -				igt_dynamic_f("pipe-%s-%s",
> -					      kmstest_pipe_name(pipe), output-
> >name)
> -					test_dithering(data, pipe, output,
> fb_bpc,
> -							fb_format,
> output_bpc);
> +			igt_output_set_pipe(output, pipe);
> 
> -				/* One pipe is enough */
> -				break;
> +			if (!intel_pipe_output_combo_valid(display)) {
> +				igt_output_set_pipe(output, PIPE_NONE);
> +				continue;
>  			}
> +
> +			igt_dynamic_f("pipe-%s-%s",
> +					      kmstest_pipe_name(pipe), output-
> >name)
> +				test_dithering(data, pipe, output, fb_bpc,
> +							   fb_format,
> output_bpc);
> +
> +			/* One pipe is enough */
> +			break;
>  		}
>  	}
>  }
> --
> 2.43.2


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

* RE: [i-g-t V6 6/6] tests/kms_hdr: Use lib helper to check the pipe/output combo validity
  2024-06-18  6:24 ` [i-g-t V6 6/6] tests/kms_hdr: " Bhanuprakash Modem
@ 2024-06-18  8:46   ` B, Jeevan
  0 siblings, 0 replies; 9+ messages in thread
From: B, Jeevan @ 2024-06-18  8:46 UTC (permalink / raw)
  To: Modem, Bhanuprakash, igt-dev@lists.freedesktop.org

LGTM. 

Reviewed-by: Jeevan B <jeevan.b@intel.com>

> -----Original Message-----
> From: Modem, Bhanuprakash <bhanuprakash.modem@intel.com>
> Sent: Tuesday, June 18, 2024 11:54 AM
> To: igt-dev@lists.freedesktop.org
> Cc: Modem, Bhanuprakash <bhanuprakash.modem@intel.com>; B, Jeevan
> <jeevan.b@intel.com>
> Subject: [i-g-t V6 6/6] tests/kms_hdr: Use lib helper to check the pipe/output
> combo validity
> 
> Use IGT lib helper intel_pipe_output_combo_valid() to make sure the selected
> pipe/output/mode combo is valid.
> 
> Cc: Jeevan B <jeevan.b@intel.com>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> ---
>  tests/kms_hdr.c | 90 ++++++++++++++++++++++++++++---------------------
>  1 file changed, 51 insertions(+), 39 deletions(-)
> 
> diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c index 99b78f7ef..475463c21
> 100644
> --- a/tests/kms_hdr.c
> +++ b/tests/kms_hdr.c
> @@ -261,6 +261,8 @@ static void test_bpc_switch(data_t *data, uint32_t
> flags)
>  	igt_display_t *display = &data->display;
>  	igt_output_t *output;
> 
> +	igt_display_reset(display);
> +
>  	for_each_connected_output(display, output) {
>  		enum pipe pipe;
> 
> @@ -271,26 +273,30 @@ static void test_bpc_switch(data_t *data, uint32_t
> flags)
>  			continue;
> 
>  		for_each_pipe(display, pipe) {
> -			if (igt_pipe_connector_valid(pipe, output)) {
> -				prepare_test(data, output, pipe);
> -
> -				if (is_intel_device(data->fd) &&
> -				    !igt_max_bpc_constraint(display, pipe,
> output, 10)) {
> -					test_fini(data);
> -					break;
> -				}
> -
> -				data->mode = igt_output_get_mode(output);
> -				data->w = data->mode->hdisplay;
> -				data->h = data->mode->vdisplay;
> +			igt_output_set_pipe(output, pipe);
> +			if (intel_pipe_output_combo_valid(display)) {
> +				igt_output_set_pipe(output, PIPE_NONE);
> +				continue;
> +			}
> 
> -				igt_dynamic_f("pipe-%s-%s",
> -					      kmstest_pipe_name(pipe), output-
> >name)
> -					test_bpc_switch_on_output(data,
> pipe, output, flags);
> +			prepare_test(data, output, pipe);
> 
> -				/* One pipe is enough */
> +			if (is_intel_device(data->fd) &&
> +			    !igt_max_bpc_constraint(display, pipe, output, 10))
> {
> +				test_fini(data);
>  				break;
>  			}
> +
> +			data->mode = igt_output_get_mode(output);
> +			data->w = data->mode->hdisplay;
> +			data->h = data->mode->vdisplay;
> +
> +			igt_dynamic_f("pipe-%s-%s",
> +				      kmstest_pipe_name(pipe), output->name)
> +				test_bpc_switch_on_output(data, pipe,
> output, flags);
> +
> +			/* One pipe is enough */
> +			break;
>  		}
>  	}
>  }
> @@ -614,6 +620,8 @@ static void test_hdr(data_t *data, uint32_t flags)
>  	igt_display_t *display = &data->display;
>  	igt_output_t *output;
> 
> +	igt_display_reset(display);
> +
>  	for_each_connected_output(display, output) {
>  		enum pipe pipe;
> 
> @@ -635,32 +643,36 @@ static void test_hdr(data_t *data, uint32_t flags)
>  			continue;
> 
>  		for_each_pipe(display, pipe) {
> -			if (igt_pipe_connector_valid(pipe, output)) {
> -				prepare_test(data, output, pipe);
> +			igt_output_set_pipe(output, pipe);
> +			if (!intel_pipe_output_combo_valid(display)) {
> +				igt_output_set_pipe(output, PIPE_NONE);
> +				continue;
> +			}
> 
> -				if (is_intel_device(data->fd) &&
> -				    !igt_max_bpc_constraint(display, pipe,
> output, 10)) {
> -					test_fini(data);
> -					break;
> -				}
> -
> -				data->mode = igt_output_get_mode(output);
> -				data->w = data->mode->hdisplay;
> -				data->h = data->mode->vdisplay;
> -
> -				igt_dynamic_f("pipe-%s-%s",
> -					      kmstest_pipe_name(pipe), output-
> >name) {
> -					if (flags & (TEST_NONE | TEST_DPMS
> | TEST_SUSPEND | TEST_INVALID_HDR))
> -						test_static_toggle(data, pipe,
> output, flags);
> -					if (flags & TEST_SWAP)
> -						test_static_swap(data, pipe,
> output);
> -					if (flags &
> TEST_INVALID_METADATA_SIZES)
> -
> 	test_invalid_metadata_sizes(data, output);
> -				}
> -
> -				/* One pipe is enough */
> +			prepare_test(data, output, pipe);
> +
> +			if (is_intel_device(data->fd) &&
> +			    !igt_max_bpc_constraint(display, pipe, output, 10))
> {
> +				test_fini(data);
>  				break;
>  			}
> +
> +			data->mode = igt_output_get_mode(output);
> +			data->w = data->mode->hdisplay;
> +			data->h = data->mode->vdisplay;
> +
> +			igt_dynamic_f("pipe-%s-%s",
> +				      kmstest_pipe_name(pipe), output->name)
> {
> +				if (flags & (TEST_NONE | TEST_DPMS |
> TEST_SUSPEND | TEST_INVALID_HDR))
> +					test_static_toggle(data, pipe, output,
> flags);
> +				if (flags & TEST_SWAP)
> +					test_static_swap(data, pipe, output);
> +				if (flags & TEST_INVALID_METADATA_SIZES)
> +					test_invalid_metadata_sizes(data,
> output);
> +			}
> +
> +			/* One pipe is enough */
> +			break;
>  		}
>  	}
>  }
> --
> 2.43.2


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

end of thread, other threads:[~2024-06-18  8:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-18  6:23 [i-g-t V6 0/6] Check the validity of selected pipe/output combo Bhanuprakash Modem
2024-06-18  6:24 ` [i-g-t V6 1/6] lib/igt_kms: Check validity of the selcted " Bhanuprakash Modem
2024-06-18  6:24 ` [i-g-t V6 2/6] tests/kms: Drop redundant check for pipe/output combo validity Bhanuprakash Modem
2024-06-18  6:24 ` [i-g-t V6 3/6] tests/chamelium: Use lib helper to check the " Bhanuprakash Modem
2024-06-18  6:24 ` [i-g-t V6 4/6] tests/intel/kms: " Bhanuprakash Modem
2024-06-18  6:24 ` [i-g-t V6 5/6] tests/kms_dither: " Bhanuprakash Modem
2024-06-18  8:45   ` B, Jeevan
2024-06-18  6:24 ` [i-g-t V6 6/6] tests/kms_hdr: " Bhanuprakash Modem
2024-06-18  8:46   ` B, Jeevan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox