[i-g-t V6 3/6] tests/chamelium: Use lib helper to check the pipe/output combo validity
Bhanuprakash Modem
bhanuprakash.modem at intel.com
Tue Jun 18 06:21:47 UTC 2024
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 at intel.com>
Reviewed-by: Jeevan B <jeevan.b at 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
More information about the igt-dev
mailing list