[igt-dev] [i-g-t V3 12/52] tests/kms_cursor_crc: Add support for Bigjoiner

Bhanuprakash Modem
2022-09-09T14:06:23Z

tests/kms_cursor_crc.c | 47 +++++++++++++++++++++++++++++++++++-------
1 file changed, 40 insertions(+), 7 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 53f18f4f..45088d15 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -687,6 +687,21 @@ static void test_rapid_movement(data_t *data)
igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
}

+static bool pipe_output_combo_valid(data_t *data, enum pipe pipe)
+{
+ bool ret = true;
+ igt_display_t *display = &data->display;
+
+ igt_display_reset(display);
+
+ igt_output_set_pipe(data->output, pipe);
+ if (!i915_pipe_output_combo_valid(display))
+ ret = false;
+ igt_output_set_pipe(data->output, PIPE_NONE);
+
+ return ret;
+}
+
static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
int w, int h)
{
@@ -708,15 +723,18 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
}

create_cursor_fb(data, w, h);
- if (require_cursor_size(data, w, h)) {
- igt_info("Cursor size %dx%d not supported by driver\n", w, h);
-
- igt_remove_fb(data->drm_fd, &data->fb);
- return;
- }
-
for_each_pipe(&data->display, pipe) {
data->pipe = pipe;
+
+ if (!pipe_output_combo_valid(data, pipe))
+ continue;
+
+ if (require_cursor_size(data, w, h)) {
+ igt_info("Cursor size %dx%d not supported by driver\n", w, h);
+
+ continue;
+ }
+
igt_dynamic_f("pipe-%s-%s",
kmstest_pipe_name(pipe), igt_output_name(data->output))
run_test(data, testfunc, w, h);
@@ -761,6 +779,9 @@ static void run_tests_on_pipe(data_t *data)
for_each_pipe(&data->display, pipe) {
data->pipe = pipe;

+ if (!pipe_output_combo_valid(data, pipe))
+ continue;
+
igt_dynamic_f("pipe-%s-%s",
kmstest_pipe_name(pipe),
data->output->name)
@@ -775,6 +796,9 @@ static void run_tests_on_pipe(data_t *data)
for_each_pipe(&data->display, pipe) {
data->pipe = pipe;

+ if (!pipe_output_combo_valid(data, pipe))
+ continue;
+
igt_dynamic_f("pipe-%s-%s",
kmstest_pipe_name(pipe),
data->output->name)
@@ -789,6 +813,9 @@ static void run_tests_on_pipe(data_t *data)
for_each_pipe(&data->display, pipe) {
data->pipe = pipe;

+ if (!pipe_output_combo_valid(data, pipe))
+ continue;
+
igt_dynamic_f("pipe-%s-%s",
kmstest_pipe_name(pipe),
data->output->name)
@@ -807,6 +834,9 @@ static void run_tests_on_pipe(data_t *data)
data->pipe = pipe;
data->flags = TEST_DPMS;

+ if (!pipe_output_combo_valid(data, pipe))
+ continue;
+
if (require_cursor_size(data, data->cursor_max_w, data->cursor_max_h)) {
igt_debug("Cursor size %dx%d not supported by driver\n",
data->cursor_max_w, data->cursor_max_h);
@@ -828,6 +858,9 @@ static void run_tests_on_pipe(data_t *data)
data->pipe = pipe;
data->flags = TEST_SUSPEND;

+ if (!pipe_output_combo_valid(data, pipe))
+ continue;
+
if (require_cursor_size(data, data->cursor_max_w, data->cursor_max_h)) {
igt_debug("Cursor size %dx%d not supported by driver\n",
data->cursor_max_w, data->cursor_max_h);
--
2.35.1