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>,
	Jeevan B <jeevan.b@intel.com>
Subject: [i-g-t V6 3/6] tests/chamelium: Use lib helper to check the pipe/output combo validity
Date: Tue, 18 Jun 2024 11:54:02 +0530	[thread overview]
Message-ID: <20240618062405.4004955-4-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20240618062405.4004955-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>
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


  parent reply	other threads:[~2024-06-18  6:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-06-18  6:24 ` [i-g-t V6 4/6] tests/intel/kms: Use lib helper to check the " 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
  -- strict thread matches above, loose matches on Subject: below --
2024-06-18  6:21 [i-g-t V6 0/6] Force joiner support in bigjoiner checks Bhanuprakash Modem
2024-06-18  6:21 ` [i-g-t V6 3/6] tests/chamelium: Use lib helper to check the pipe/output combo validity Bhanuprakash Modem

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=20240618062405.4004955-4-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jeevan.b@intel.com \
    /path/to/YOUR_REPLY

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

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