Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Subject: [PATCH i-g-t 4/5] tests/intel/kms: Use lib helper to check the pipe/output combo validity
Date: Mon,  8 Apr 2024 11:42:20 +0530	[thread overview]
Message-ID: <20240408061221.291523-5-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20240408061221.291523-1-bhanuprakash.modem@intel.com>

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>
---
 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


  parent reply	other threads:[~2024-04-08  6:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08  6:12 [PATCH i-g-t 0/5] Check the validity of selected pipe/output combo Bhanuprakash Modem
2024-04-08  6:12 ` [PATCH i-g-t 1/5] lib/igt_kms: Check validity of the selcted " Bhanuprakash Modem
2024-06-12 11:19   ` B, Jeevan
2024-04-08  6:12 ` [PATCH i-g-t 2/5] tests/kms: Drop redundant check for pipe/output combo validity Bhanuprakash Modem
2024-06-12 12:11   ` B, Jeevan
2024-04-08  6:12 ` [PATCH i-g-t 3/5] tests/chamelium: Use lib helper to check the " Bhanuprakash Modem
2024-06-12 12:13   ` B, Jeevan
2024-04-08  6:12 ` Bhanuprakash Modem [this message]
2024-06-12 12:15   ` [PATCH i-g-t 4/5] tests/intel/kms: " B, Jeevan
2024-04-08  6:12 ` [PATCH i-g-t 5/5] tests/kms: " Bhanuprakash Modem
2024-06-14  5:45   ` B, Jeevan
2024-04-09  1:34 ` ✓ CI.xeBAT: success for Check the validity of selected pipe/output combo Patchwork
2024-04-09  1:53 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-04-09  2:55 ` ✓ Fi.CI.BAT: success for Check the validity of selected pipe/output combo (rev2) Patchwork
2024-04-09  2:55 ` ✓ CI.xeBAT: " Patchwork
2024-04-10 14:25 ` ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240408061221.291523-5-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox