Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_flip: Skip test only for invalid combination
@ 2022-06-20 19:58 Jeevan B
  2022-06-20 22:24 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  0 siblings, 1 reply; 2+ messages in thread
From: Jeevan B @ 2022-06-20 19:58 UTC (permalink / raw)
  To: igt-dev

currently the entire test is skipping. adding this fix to skip test
only for invalid cases and run on other valid display combination.

Signed-off-by: Jeevan B <jeevan.b@intel.com>
---
 tests/kms_flip.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index c5b5741a..b443a7be 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -949,8 +949,8 @@ static void get_compatible_modes(drmModeModeInfo *a, drmModeModeInfo *b,
 					return;
 			}
 		}
-
-		igt_skip("Compatible mode not found.\n");
+		*a = c1->modes[0];
+		*b = c2->modes[0];
 	}
 
 	return;
@@ -1318,6 +1318,25 @@ static int sort_drm_modes(const void *a, const void *b)
 	return (mode2->clock < mode1->clock) - (mode1->clock < mode2->clock);
 }
 
+static void compatible_mode_check(struct test_output *o)
+{
+	drmModeModeInfo mode[2];
+	int i;
+
+	for (i = 0; i < RUN_PAIR; i++) {
+		qsort(o->kconnector[i]->modes,
+		      o->kconnector[i]->count_modes,
+		      sizeof(drmModeModeInfo),
+		      sort_drm_modes);
+	}
+
+	get_compatible_modes(&mode[0], &mode[1],
+			     o->kconnector[0], o->kconnector[1]);
+
+	if (mode[0].hdisplay != mode[1].hdisplay && mode[0].vdisplay != mode[1].vdisplay)
+		igt_skip("Compatible mode not found.\n");
+}
+
 static void get_suitable_modes(struct test_output *o)
 {
 	drmModeModeInfo mode[2];
@@ -1351,6 +1370,7 @@ static void __run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
 	uint64_t modifier;
 	int i, ret;
 
+	compatible_mode_check(o);
 restart:
 	last_connector = o->kconnector[0];
 
-- 
2.36.0

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

end of thread, other threads:[~2022-06-20 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-20 19:58 [igt-dev] [PATCH i-g-t] tests/kms_flip: Skip test only for invalid combination Jeevan B
2022-06-20 22:24 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork

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