[igt-dev] [PATCH i-g-t v4] tests/kms_flip: Skip test only for invalid combination

Jeevan B jeevan.b at intel.com
Wed Jun 22 08:03:12 UTC 2022


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

v2: add RUN_PAIR check to avoid crash on single display.
v3: add flag to check for valid display combination.(Karthik)

Signed-off-by: Jeevan B <jeevan.b at intel.com>
---
 tests/kms_flip.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index c5b5741a..90b3e352 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -932,7 +932,7 @@ static bool mode_compatible(const drmModeModeInfo *a, const drmModeModeInfo *b)
 	return true;
 }
 
-static void get_compatible_modes(drmModeModeInfo *a, drmModeModeInfo *b,
+static bool get_compatible_modes(drmModeModeInfo *a, drmModeModeInfo *b,
 				 drmModeConnector *c1, drmModeConnector *c2)
 {
 	int n, m;
@@ -946,14 +946,13 @@ static void get_compatible_modes(drmModeModeInfo *a, drmModeModeInfo *b,
 			for (m = 0; m < c2->count_modes; m++) {
 				*b = c2->modes[m];
 				if (mode_compatible(a, b))
-					return;
+					return true;
 			}
 		}
-
-		igt_skip("Compatible mode not found.\n");
+		return false;
 	}
 
-	return;
+	return true;
 }
 
 static void connector_find_compatible_mode(int crtc_idx0, int crtc_idx1,
@@ -972,13 +971,12 @@ static void connector_find_compatible_mode(int crtc_idx0, int crtc_idx1,
 		return;
 	}
 
-	get_compatible_modes(&mode[0], &mode[1],
-			     config[0].connector, config[1].connector);
+	o->mode_valid = get_compatible_modes(&mode[0], &mode[1],
+					     config[0].connector, config[1].connector);
 
 	o->pipe = config[0].pipe;
 	o->fb_width = mode[0].hdisplay;
 	o->fb_height = mode[0].vdisplay;
-	o->mode_valid = 1;
 
 	o->kconnector[0] = config[0].connector;
 	o->kencoder[0] = config[0].encoder;
-- 
2.36.0



More information about the igt-dev mailing list