public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_plane_multiple: Before going testing check how many planes are allowed
@ 2019-04-02 14:42 Juha-Pekka Heikkila
  2019-04-02 17:12 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Juha-Pekka Heikkila @ 2019-04-02 14:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Lisovskiy, Stanislav

Before start testing try out how many planes kernel will allow
simultaneously to be used.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_plane_multiple.c | 32 ++++++++++++++++++++++++++------
 1 file changed, 26 insertions(+), 6 deletions(-)

diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index bfaeede..5107d9d 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -260,7 +260,9 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
 {
 	color_t blue  = { 0.0f, 0.0f, 1.0f };
 	igt_crc_t crc;
+	igt_plane_t *plane;
 	int i;
+	int err, c = 0;
 	int iterations = opt.iterations < 1 ? 1 : opt.iterations;
 	bool loop_forever;
 	char info[256];
@@ -274,17 +276,35 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
 			iterations, iterations > 1 ? "iterations" : "iteration");
 	}
 
-	igt_info("Testing connector %s using pipe %s with %d planes %s with seed %d\n",
-		 igt_output_name(output), kmstest_pipe_name(pipe), n_planes,
-		 info, opt.seed);
-
 	test_init(data, pipe, n_planes);
 
 	test_grab_crc(data, output, pipe, &blue, tiling);
 
+	/*
+	 * Find out how many planes are allowed simultaneously
+	 */
+	do {
+		c++;
+		prepare_planes(data, pipe, &blue, tiling, c, output);
+		err = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
+	} while (!err && c < n_planes);
+
+	if(err)
+		c--;
+
+	/*
+	 * clean up failed state.
+	 */
+	for_each_plane_on_pipe(&data->display, pipe, plane)
+		igt_plane_set_fb(plane, NULL);
+
+	igt_info("Testing connector %s using pipe %s with %d planes %s with seed %d\n",
+		 igt_output_name(output), kmstest_pipe_name(pipe), c,
+		 info, opt.seed);
+
 	i = 0;
-	while (i < iterations || loop_forever) {
-		prepare_planes(data, pipe, &blue, tiling, n_planes, output);
+	while ((i < iterations || loop_forever) && c > 0) {
+		prepare_planes(data, pipe, &blue, tiling, c, output);
 
 		igt_display_commit2(&data->display, COMMIT_ATOMIC);
 
-- 
2.7.4

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-04-03 12:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-02 14:42 [igt-dev] [PATCH i-g-t] tests/kms_plane_multiple: Before going testing check how many planes are allowed Juha-Pekka Heikkila
2019-04-02 17:12 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-02 18:22 ` [igt-dev] [PATCH i-g-t] " Souza, Jose
2019-04-03 11:26   ` Juha-Pekka Heikkila
2019-04-03  4:25 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
2019-04-03  8:38 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2019-04-03 12:23   ` Juha-Pekka Heikkila

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