Skip to contentSkip to conversation

Convert PSR2 sf & su test to dynamic

PATCH Superseded Jeevan B 3 participants 5 messages Sep 27, 2022 – Sep 28, 2022

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Jeevan B

author
#0 lore raw

v5 cover Convert PSR2 sf & su test to dynamic

Convert psr2_sf & psr2_su patch to dynamic subtests.
We check psr2 support for each pipe and if the pipe supports then its added as part of dynamic subtest instead to running through all pipe.

Jeevan B (2):
tests/i915/kms_psr2_sf: Convert tests to dynamic tests/i915/kms_psr2_su: Convert tests to dynamic

 tests/i915/kms_psr2_sf.c | 293 ++++++++++++++++++++++++++-------------
 tests/i915/kms_psr2_su.c |  93 ++++++++-----
 2 files changed, 258 insertions(+), 128 deletions(-)
Signature · 1 line
2.36.0
author
#1 lore raw

PATCH v5 1/2 tests/i915/kms_psr2_sf: Convert tests to dynamic

Converting the existing subtests to dynamic subtests. Adding support for each_pipe, currently PSR2 is supported on few pipes so breaking the loop for other pipes currently.

v2: Check for pipe supporting PSR2 or not and then add to dynamic subtest.
v3: Check PSR2 support once in fixture then iterate pipes.
v4: Add output part into dynamic name.
v5: Add the missing code and increase pipes and outputs array size.

---
 tests/i915/kms_psr2_sf.c | 293 ++++++++++++++++++++++++++-------------
 1 file changed, 196 insertions(+), 97 deletions(-)
tests/i915/kms_psr2_sf.c +196 -97
index 6612587c..9f98d3fb 100644
@@ -237,7 +237,7 @@ static void plane_move_setup_square(data_t *data, igt_fb_t *fb, uint32_t h,
 	set_clip(&data->plane_move_clip, x, y, SQUARE_SIZE, SQUARE_SIZE);
 }
 
-static void prepare(data_t *data)
+static void prepare(data_t *data, igt_output_t *output)
 {
 	igt_plane_t *primary, *sprite = NULL, *cursor = NULL;
 	int fb_w, fb_h, x, y, view_w, view_h;
@@ -262,12 +262,12 @@ static void prepare(data_t *data)
 			    0.0, 1.0, 0.0,
 			    &data->fb_primary);
 
-	primary = igt_output_get_plane_type(data->output,
+	primary = igt_output_get_plane_type(output,
 			DRM_PLANE_TYPE_PRIMARY);
 
 	switch (data->test_plane_id) {
 	case DRM_PLANE_TYPE_OVERLAY:
-		sprite = igt_output_get_plane_type(data->output,
+		sprite = igt_output_get_plane_type(output,
 						   DRM_PLANE_TYPE_OVERLAY);
 		/*All blue plane*/
 		igt_create_color_fb(data->drm_fd,
@@ -318,7 +318,7 @@ static void prepare(data_t *data)
 		data->test_plane = primary;
 
 		if (data->op == OVERLAY_PRIM_UPDATE) {
-			sprite = igt_output_get_plane_type(data->output,
+			sprite = igt_output_get_plane_type(output,
 						   DRM_PLANE_TYPE_OVERLAY);
 
 			igt_create_color_fb(data->drm_fd, fb_w, fb_h,
@@ -338,7 +338,7 @@ static void prepare(data_t *data)
 		break;
 
 	case DRM_PLANE_TYPE_CURSOR:
-		cursor = igt_output_get_plane_type(data->output,
+		cursor = igt_output_get_plane_type(output,
 						   DRM_PLANE_TYPE_CURSOR);
 		igt_plane_set_position(cursor, 0, 0);
 
@@ -808,12 +808,12 @@ static void run(data_t *data)
 	}
 }
 
-static void cleanup(data_t *data)
+static void cleanup(data_t *data, igt_output_t *output)
 {
 	igt_plane_t *primary;
 	igt_plane_t *sprite;
 
-	primary = igt_output_get_plane_type(data->output,
+	primary = igt_output_get_plane_type(output,
 					    DRM_PLANE_TYPE_PRIMARY);
 
 	igt_plane_set_fb(primary, NULL);
@@ -824,7 +824,7 @@ static void cleanup(data_t *data)
 	}
 
 	if (data->op == OVERLAY_PRIM_UPDATE) {
-		sprite = igt_output_get_plane_type(data->output,
+		sprite = igt_output_get_plane_type(output,
 				DRM_PLANE_TYPE_OVERLAY);
 		igt_plane_set_position(sprite, 0, 0);
 		igt_plane_set_fb(sprite, NULL);
@@ -838,14 +838,35 @@ static void cleanup(data_t *data)
 	igt_remove_fb(data->drm_fd, &data->fb_test);
 }
 
+static int check_psr2_support(data_t *data, enum pipe pipe)
+{
+	int status;
+
+	igt_output_t *output;
+	igt_display_t *display = &data->display;
+
+	igt_display_reset(display);
+	output = data->output;
+	igt_output_set_pipe(output, pipe);
+
+	prepare(data, output);
+	status = psr_wait_entry(data->debugfs_fd, PSR_MODE_2);
+	cleanup(data, output);
+
+	return status;
+}
+
 igt_main
 {
 	data_t data = {};
-	int i;
+	igt_output_t *outputs[IGT_MAX_PIPES * IGT_MAX_PIPES];
+	int i, j;
+	enum pipe pipe;
+	int pipes[IGT_MAX_PIPES * IGT_MAX_PIPES];
+	int n_pipes = 0;
 
 	igt_fixture {
 		drmModeResPtr res;
-		int r;
 
 		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
@@ -873,146 +894,218 @@ igt_main
 		data.big_fb_height = res->max_height;
 		igt_info("Big framebuffer size %dx%d\n",
 			 data.big_fb_width, data.big_fb_height);
-		prepare(&data);
-		r = psr_wait_entry(data.debugfs_fd, PSR_MODE_2);
-		if (!r)
-			psr_print_debugfs(data.debugfs_fd);
 
 		igt_require_f(psr2_selective_fetch_check(data.debugfs_fd),
 			      "PSR2 selective fetch not enabled\n");
-		cleanup(&data);
-		if (!r)
-			psr_print_debugfs(data.debugfs_fd);
-		igt_require_f(r, "PSR2 can not be enabled\n");
+
+		for_each_pipe_with_valid_output(&data.display, pipe, data.output) {
+			if (check_psr2_support(&data, pipe)) {
+				pipes[n_pipes] = pipe;
+				outputs[n_pipes] = data.output;
+				n_pipes++;
+			}
+		}
 	}
 
 	/* Verify primary plane selective fetch */
 	igt_describe("Test that selective fetch works on primary plane");
-	igt_subtest_f("primary-%s-sf-dmg-area", op_str(data.op)) {
-		for (i = 1; i <= MAX_DAMAGE_AREAS; i++) {
-			data.damage_area_count = i;
-			data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
-			prepare(&data);
-			run(&data);
-			cleanup(&data);
+	igt_subtest_with_dynamic_f("primary-%s-sf-dmg-area", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				for (j = 1; j <= MAX_DAMAGE_AREAS; j++) {
+					data.damage_area_count = j;
+					data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
+					prepare(&data, outputs[i]);
+					run(&data);
+					cleanup(&data, outputs[i]);
+				}
+			}
 		}
 	}
 
 	/* Verify primary plane selective fetch with big fb */
 	data.big_fb_test = 1;
 	igt_describe("Test that selective fetch works on primary plane with big fb");
-	igt_subtest_f("primary-%s-sf-dmg-area-big-fb", op_str(data.op)) {
-		for (i = 1; i <= MAX_DAMAGE_AREAS; i++) {
-			data.damage_area_count = i;
-			data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
-			prepare(&data);
-			run(&data);
-			cleanup(&data);
+	igt_subtest_with_dynamic_f("primary-%s-sf-dmg-area-big-fb", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				for (j = 1; j <= MAX_DAMAGE_AREAS; j++) {
+					data.damage_area_count = j;
+					data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
+					prepare(&data, outputs[i]);
+					run(&data);
+					cleanup(&data, outputs[i]);
+				}
+			}
 		}
 	}
-	data.big_fb_test = 0;
 
+	data.big_fb_test = 0;
 	/* Verify overlay plane selective fetch */
 	igt_describe("Test that selective fetch works on overlay plane");
-	igt_subtest_f("overlay-%s-sf-dmg-area", op_str(data.op)) {
-		for (i = 1; i <= MAX_DAMAGE_AREAS; i++) {
-			data.damage_area_count = i;
-			data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
-			prepare(&data);
-			run(&data);
-			cleanup(&data);
+	igt_subtest_with_dynamic_f("overlay-%s-sf-dmg-area", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				for (j = 1; j <= MAX_DAMAGE_AREAS; j++) {
+					data.damage_area_count = j;
+					data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
+					prepare(&data, outputs[i]);
+					run(&data);
+					cleanup(&data, outputs[i]);
+				}
+			}
 		}
 	}
 
-	/* Verify overlay plane selective fetch */
+	data.damage_area_count = 1;
+	/* Verify cursor plane selective fetch */
 	igt_describe("Test that selective fetch works on cursor plane");
-	igt_subtest_f("cursor-%s-sf", op_str(data.op)) {
-		data.damage_area_count = 1;
-		data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
-		prepare(&data);
-		run(&data);
-		cleanup(&data);
+	igt_subtest_with_dynamic_f("cursor-%s-sf", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
+				prepare(&data, outputs[i]);
+				run(&data);
+				cleanup(&data, outputs[i]);
+			}
+		}
 	}
 
 	data.op = PLANE_MOVE_CONTINUOUS;
 	igt_describe("Test that selective fetch works on moving cursor plane (no update)");
-	igt_subtest_f("cursor-%s-sf", op_str(data.op)) {
-		data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
-		prepare(&data);
-		run(&data);
-		cleanup(&data);
+	igt_subtest_with_dynamic_f("cursor-%s-sf", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
+				prepare(&data, outputs[i]);
+				run(&data);
+				cleanup(&data, outputs[i]);
+			}
+		}
 	}
 
 	data.op = PLANE_MOVE_CONTINUOUS_EXCEED;
 	igt_describe("Test that selective fetch works on moving cursor plane exceeding partially visible area (no update)");
-	igt_subtest_f("cursor-%s-sf", op_str(data.op)) {
-		data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
-		prepare(&data);
-		run(&data);
-		cleanup(&data);
+	igt_subtest_with_dynamic_f("cursor-%s-sf", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
+				prepare(&data, outputs[i]);
+				run(&data);
+				cleanup(&data, outputs[i]);
+			}
+		}
 	}
 
 	data.op = PLANE_MOVE_CONTINUOUS_EXCEED_FULLY;
 	igt_describe("Test that selective fetch works on moving cursor plane exceeding fully visible area (no update)");
-	igt_subtest_f("cursor-%s-sf", op_str(data.op)) {
-		data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
-		prepare(&data);
-		run(&data);
-		cleanup(&data);
+	igt_subtest_with_dynamic_f("cursor-%s-sf", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
+				prepare(&data, outputs[i]);
+				run(&data);
+				cleanup(&data, outputs[i]);
+			}
+		}
 	}
 
 	/* Only for overlay plane */
 	data.op = PLANE_MOVE;
 	/* Verify overlay plane move selective fetch */
 	igt_describe("Test that selective fetch works on moving overlay plane");
-	igt_subtest_f("%s-sf-dmg-area", op_str(data.op)) {
-		for (i = POS_TOP_LEFT; i <= POS_BOTTOM_RIGHT ; i++) {
-			data.pos = i;
-			data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
-			prepare(&data);
-			run(&data);
-			cleanup(&data);
+	igt_subtest_with_dynamic_f("%s-sf-dmg-area", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				for (j = POS_TOP_LEFT; j <= POS_BOTTOM_RIGHT ; j++) {
+					data.pos = j;
+					data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
+					prepare(&data, outputs[i]);
+					run(&data);
+					cleanup(&data, outputs[i]);
+				}
+			}
 		}
 	}
 
 	data.op = PLANE_MOVE_CONTINUOUS;
 	igt_describe("Test that selective fetch works on moving overlay plane (no update)");
-	igt_subtest_f("overlay-%s-sf", op_str(data.op)) {
-		data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
-		prepare(&data);
-		run(&data);
-		cleanup(&data);
+	igt_subtest_with_dynamic_f("overlay-%s-sf", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
+				prepare(&data, outputs[i]);
+				run(&data);
+				cleanup(&data, outputs[i]);
+			}
+		}
 	}
 
 	data.op = PLANE_MOVE_CONTINUOUS_EXCEED;
 	igt_describe("Test that selective fetch works on moving overlay plane partially exceeding visible area (no update)");
-	igt_subtest_f("overlay-%s-sf", op_str(data.op)) {
-		data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
-		prepare(&data);
-		run(&data);
-		cleanup(&data);
+	igt_subtest_with_dynamic_f("overlay-%s-sf", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
+				prepare(&data, outputs[i]);
+				run(&data);
+				cleanup(&data, outputs[i]);
+			}
+		}
 	}
 
 	data.op = PLANE_MOVE_CONTINUOUS_EXCEED_FULLY;
 	igt_describe("Test that selective fetch works on moving overlay plane fully exceeding visible area (no update)");
-	igt_subtest_f("overlay-%s-sf", op_str(data.op)) {
-		data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
-		prepare(&data);
-		run(&data);
-		cleanup(&data);
+	igt_subtest_with_dynamic_f("overlay-%s-sf", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
+				prepare(&data, outputs[i]);
+				run(&data);
+				cleanup(&data, outputs[i]);
+			}
+		}
 	}
 
 	/* Verify primary plane selective fetch with overplay plane blended */
 	data.op = OVERLAY_PRIM_UPDATE;
 	igt_describe("Test that selective fetch works on primary plane "
 		     "with blended overlay plane");
-	igt_subtest_f("%s-sf-dmg-area", op_str(data.op)) {
-		for (i = 1; i <= MAX_DAMAGE_AREAS; i++) {
-			data.damage_area_count = i;
-			data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
-			prepare(&data);
-			run(&data);
-			cleanup(&data);
+	igt_subtest_with_dynamic_f("%s-sf-dmg-area", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				for (j = 1; j <= MAX_DAMAGE_AREAS; j++) {
+					data.damage_area_count = j;
+					data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
+					prepare(&data, outputs[i]);
+					run(&data);
+					cleanup(&data, outputs[i]);
+				}
+			}
 		}
 	}
 
@@ -1023,12 +1116,18 @@ igt_main
 	data.op = PLANE_UPDATE_CONTINUOUS;
 	data.primary_format = DRM_FORMAT_NV12;
 	igt_describe("Test that selective fetch works on overlay plane");
-	igt_subtest_f("overlay-%s-sf", op_str(data.op)) {
-			data.damage_area_count = 1;
-			data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
-			prepare(&data);
-			run(&data);
-			cleanup(&data);
+	igt_subtest_with_dynamic_f("overlay-%s-sf", op_str(data.op)) {
+		for (i = 0; i < n_pipes; i++) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+					igt_output_name(outputs[i])) {
+				igt_output_set_pipe(outputs[i], pipes[i]);
+				data.damage_area_count = 1;
+				data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
+				prepare(&data, outputs[i]);
+				run(&data);
+				cleanup(&data, outputs[i]);
+			}
+		}
 	}
 
 	igt_fixture {
Signature · 1 line
2.36.0
author
#2 lore raw

PATCH v5 2/2 tests/i915/kms_psr2_su: Convert tests to dynamic

In reply to Jeevan B

Converting the existing subtests to dynamic subtests. Adding support for each_pipe, currently PSR2 is supported on few pipes so breaking the loop for other pipes currently.

v2: Add commit message and change break to continue.
v3: Check for pipe supporting PSR2 or not and then add to dynamic subtest.
v4: Check PSR2 support once in fixture then iterate pipes.
v5: Increase array size for pipes and outputs.

---
 tests/i915/kms_psr2_su.c | 93 ++++++++++++++++++++++++++--------------
 1 file changed, 62 insertions(+), 31 deletions(-)
tests/i915/kms_psr2_su.c +62 -31
index caccf713..6d442ead 100644
@@ -123,7 +123,7 @@ static void display_fini(data_t *data)
 	igt_display_fini(&data->display);
 }
 
-static void prepare(data_t *data)
+static void prepare(data_t *data, igt_output_t *output)
 {
 	igt_plane_t *primary;
 
@@ -154,14 +154,14 @@ static void prepare(data_t *data)
 		data->cr = igt_get_cairo_ctx(data->drm_fd, &data->fb[0]);
 	}
 
-	primary = igt_output_get_plane_type(data->output,
+	primary = igt_output_get_plane_type(output,
 					    DRM_PLANE_TYPE_PRIMARY);
 
 	igt_plane_set_fb(primary, &data->fb[0]);
 	igt_display_commit2(&data->display, COMMIT_ATOMIC);
 }
 
-static bool update_screen_and_test(data_t *data)
+static bool update_screen_and_test(data_t *data, igt_output_t *output)
 {
 	uint16_t su_blocks;
 	bool ret = false;
@@ -170,7 +170,7 @@ static bool update_screen_and_test(data_t *data)
 	case PAGE_FLIP: {
 		igt_plane_t *primary;
 
-		primary = igt_output_get_plane_type(data->output,
+		primary = igt_output_get_plane_type(output,
 						    DRM_PLANE_TYPE_PRIMARY);
 
 		if (igt_plane_has_prop(primary, IGT_PLANE_FB_DAMAGE_CLIPS)) {
@@ -222,7 +222,7 @@ static bool update_screen_and_test(data_t *data)
 	return ret;
 }
 
-static void run(data_t *data)
+static void run(data_t *data, igt_output_t *output)
 {
 	bool result = false;
 
@@ -236,18 +236,18 @@ static void run(data_t *data)
 
 		r = read(data->change_screen_timerfd, &exp, sizeof(exp));
 		if (r == sizeof(uint64_t) && exp)
-			result = update_screen_and_test(data);
+			result = update_screen_and_test(data, output);
 	}
 
 	igt_assert_f(result,
 		     "No matching selective update blocks read from debugfs\n");
 }
 
-static void cleanup(data_t *data)
+static void cleanup(data_t *data, igt_output_t *output)
 {
 	igt_plane_t *primary;
 
-	primary = igt_output_get_plane_type(data->output,
+	primary = igt_output_get_plane_type(output,
 					    DRM_PLANE_TYPE_PRIMARY);
 	igt_plane_set_fb(primary, NULL);
 	igt_display_commit2(&data->display, COMMIT_ATOMIC);
@@ -260,13 +260,35 @@ static void cleanup(data_t *data)
 	igt_remove_fb(data->drm_fd, &data->fb[0]);
 }
 
+static int check_psr2_support(data_t *data, enum pipe pipe)
+{
+	int status;
+
+	igt_output_t *output;
+	igt_display_t *display = &data->display;
+
+	igt_display_reset(display);
+	output = data->output;
+	igt_output_set_pipe(output, pipe);
+
+	prepare(data, output);
+	status = psr_wait_entry(data->debugfs_fd, PSR_MODE_2);
+	cleanup(data, output);
+
+	return status;
+}
+
 igt_main
 {
 	data_t data = {};
+	enum pipe pipe;
+	int r, i;
+	igt_output_t *outputs[IGT_MAX_PIPES * IGT_MAX_PIPES];
+	int pipes[IGT_MAX_PIPES * IGT_MAX_PIPES];
+	int n_pipes = 0;
 
 	igt_fixture {
 		struct itimerspec interval;
-		int r;
 
 		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
@@ -287,12 +309,6 @@ igt_main
 			      "Error enabling PSR2\n");
 		data.op = FRONTBUFFER;
 		data.format = DRM_FORMAT_XRGB8888;
-		prepare(&data);
-		r = psr_wait_entry(data.debugfs_fd, PSR_MODE_2);
-		cleanup(&data);
-		if (!r)
-			psr_print_debugfs(data.debugfs_fd);
-		igt_require_f(r, "PSR2 can not be enabled\n");
 
 		/* blocking timerfd */
 		data.change_screen_timerfd = timerfd_create(CLOCK_MONOTONIC, 0);
@@ -304,6 +320,14 @@ igt_main
 		interval.it_interval.tv_sec = interval.it_value.tv_sec;
 		r = timerfd_settime(data.change_screen_timerfd, 0, &interval, NULL);
 		igt_require_f(r != -1, "Error setting timerfd\n");
+
+		for_each_pipe_with_valid_output(&data.display, pipe, data.output) {
+			if (check_psr2_support(&data, pipe)) {
+				pipes[n_pipes] = pipe;
+				outputs[n_pipes] = data.output;
+				n_pipes++;
+			}
+		}
 	}
 
 	for (data.op = PAGE_FLIP; data.op < LAST; data.op++) {
@@ -312,26 +336,33 @@ igt_main
 		while (*format != DRM_FORMAT_INVALID) {
 			data.format = *format++;
 			igt_describe("Test that selective update works when screen changes");
-			igt_subtest_f("%s-%s", op_str(data.op), igt_format_str(data.format)) {
-				if (data.op == FRONTBUFFER &&
-				    intel_display_ver(intel_get_drm_devid(data.drm_fd)) >= 12) {
-					/*
-					 * FIXME: Display 12+ platforms now have PSR2
-					 * selective fetch enabled by default but we
-					 * still can't properly handle frontbuffer
-					 * rendering, so right it does full frame
-					 * fetches at every frontbuffer rendering.
-					 * So it is expected that this test will fail
-					 * in display 12+ platform for now.
-					 */
-					igt_skip("PSR2 selective fetch is doing full frame fetches for frontbuffer rendering\n");
+			igt_subtest_with_dynamic_f("%s-%s", op_str(data.op), igt_format_str(data.format)) {
+				for (i = 0; i < n_pipes; i++) {
+					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipes[i]),
+							igt_output_name(outputs[i])) {
+						igt_output_set_pipe(outputs[i], pipes[i]);
+						if (data.op == FRONTBUFFER &&
+						    intel_display_ver(intel_get_drm_devid(data.drm_fd)) >= 12) {
+							/*
+							 * FIXME: Display 12+ platforms now have PSR2
+							 * selective fetch enabled by default but we
+							 * still can't properly handle frontbuffer
+							 * rendering, so right it does full frame
+							 * fetches at every frontbuffer rendering.
+							 * So it is expected that this test will fail
+							 * in display 12+ platform for now.
+							 */
+							igt_skip("PSR2 selective fetch is doing full frame fetches for frontbuffer rendering\n");
+						}
+						prepare(&data, outputs[i]);
+						run(&data, outputs[i]);
+						cleanup(&data, outputs[i]);
+					}
 				}
-				prepare(&data);
-				run(&data);
-				cleanup(&data);
 			}
 		}
 	}
+
 	igt_fixture {
 		close(data.debugfs_fd);
 		display_fini(&data);
Signature · 1 line
2.36.0
#3 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for Convert PSR2 sf & su test to dynamic (rev5)

In reply to Jeevan B
== Series Details ==

== Series Details ==

Series: Convert PSR2 sf & su test to dynamic (rev5)
URL : https://patchwork.freedesktop.org/series/108299/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12188 -> IGTPW_7847
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_7847 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_7847, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7847/index.html

Participating hosts (46 -> 44)
------------------------------

Missing (2): fi-rkl-11600 fi-bdw-samus

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_7847:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@execlists:
- fi-bsw-nick: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-bsw-nick/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7847/fi-bsw-nick/igt@i915_selftest@[email protected]

Known issues
------------

Here are the changes found in IGTPW_7847 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@runner@aborted:
- fi-bsw-nick: NOTRUN -> [FAIL][3] ([fdo#109271] / [i915#4312])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7847/fi-bsw-nick/igt@[email protected]

#### Possible fixes ####

* igt@i915_pm_rpm@module-reload:
- fi-cfl-8109u: [DMESG-FAIL][4] ([i915#62]) -> [PASS][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-cfl-8109u/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7847/fi-cfl-8109u/igt@[email protected]

* igt@i915_selftest@live@late_gt_pm:
- fi-cfl-8109u: [DMESG-WARN][6] ([i915#5904]) -> [PASS][7] +29 similar issues
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7847/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html

* igt@i915_suspend@basic-s2idle-without-i915:
- fi-cfl-8109u: [DMESG-WARN][8] ([i915#5904] / [i915#62]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-cfl-8109u/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7847/fi-cfl-8109u/igt@[email protected]

* igt@kms_frontbuffer_tracking@basic:
- fi-cfl-8109u: [DMESG-WARN][10] ([i915#62]) -> [PASS][11] +12 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-cfl-8109u/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7847/fi-cfl-8109u/igt@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc@pipe-d-dp-2:
- {bat-dg2-11}: [FAIL][12] ([i915#6818]) -> [PASS][13] +1 similar issue
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/bat-dg2-11/igt@kms_pipe_crc_basic@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7847/bat-dg2-11/igt@kms_pipe_crc_basic@[email protected]

#### Warnings ####

* igt@i915_selftest@live@gt_heartbeat:
- fi-cfl-8109u: [DMESG-WARN][14] ([i915#5904]) -> [DMESG-FAIL][15] ([i915#5334])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-cfl-8109u/igt@i915_selftest@live@gt_heartbeat.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7847/fi-cfl-8109u/igt@i915_selftest@live@gt_heartbeat.html

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#5904]: https://gitlab.freedesktop.org/drm/intel/issues/5904
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#6818]: https://gitlab.freedesktop.org/drm/intel/issues/6818

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_6665 -> IGTPW_7847

CI-20190529: 20190529
CI_DRM_12188: d3a12118c4b988939d25628396f33f8d83593ec1 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_7847: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7847/index.html
IGT_6665: aecdb7ff269899b13b127bfa595d091af9781d94 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7847/index.html

Reviewed-by on the v5 series
#4 lore raw
In reply to Jeevan B
Quoted 4 lines · Jeevan B

Convert psr2_sf & psr2_su patch to dynamic subtests.
We check psr2 support for each pipe and if the pipe supports then its added as part of dynamic subtest instead to running through all pipe.

Both patches:

Quoted 10 lines

Jeevan B (2):
  tests/i915/kms_psr2_sf: Convert tests to dynamic tests/i915/kms_psr2_su: Convert tests to dynamic

 tests/i915/kms_psr2_sf.c | 293 ++++++++++++++++++++++++++----------- --
 tests/i915/kms_psr2_su.c |  93 ++++++++-----

 2 files changed, 258 insertions(+), 128 deletions(-)