[PATCH i-g-t] tests/intel/kms_big_fb: Introducing this restriction to optimize the test execution time on simulation

Pranay Samala pranay.samala at intel.com
Thu May 16 04:16:10 UTC 2024


This test executes on all the availble planes and set of 6 coordinates.
Due to this, test takes long duration to executes on simulation and
gets timeout.

Signed-off-by: Pranay Samala <pranay.samala at intel.com>
---
 tests/intel/kms_big_fb.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/tests/intel/kms_big_fb.c b/tests/intel/kms_big_fb.c
index 1e45d8e42..a26465b67 100644
--- a/tests/intel/kms_big_fb.c
+++ b/tests/intel/kms_big_fb.c
@@ -443,18 +443,26 @@ static bool test_plane(data_t *data)
 	struct igt_fb *big_fb = &data->big_fb;
 	int w = data->big_fb_width - small_fb->width;
 	int h = data->big_fb_height - small_fb->height;
+	int m;
 	struct {
 		int x, y;
 	} coords[] = {
 		/* bunch of coordinates pulled out of thin air */
+		{ w, h, },
 		{ 0, 0, },
 		{ w * 4 / 7, h / 5, },
 		{ w * 3 / 7, h / 3, },
 		{ w / 2, h / 2, },
 		{ w / 3, h * 3 / 4, },
-		{ w, h, },
 	};
 
+	if (igt_run_in_simulation()) {
+		m = 1;
+		plane = igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY);
+		igt_plane_set_fb(plane, NULL);
+	} else
+		m = ARRAY_SIZE(coords);
+
 	if (!igt_plane_has_format_mod(plane, data->format, data->modifier))
 		return false;
 
@@ -465,7 +473,7 @@ static bool test_plane(data_t *data)
 		igt_plane_set_rotation(plane, data->rotation);
 	igt_plane_set_position(plane, 0, 0);
 
-	for (int i = 0; i < ARRAY_SIZE(coords); i++) {
+	for (int i = 0; i < m; i++) {
 		igt_crc_t small_crc, big_crc;
 		int x = coords[i].x;
 		int y = coords[i].y;
@@ -595,10 +603,14 @@ static bool test_pipe(data_t *data)
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
 					  IGT_PIPE_CRC_SOURCE_AUTO);
 
-	for_each_plane_on_pipe(&data->display, data->pipe, data->plane) {
+	if (igt_run_in_simulation())
 		ret = test_plane(data);
-		if (ret)
-			break;
+	else {
+		for_each_plane_on_pipe(&data->display, data->pipe, data->plane) {
+			ret = test_plane(data);
+			if (ret)
+				break;
+		}
 	}
 
 	if (data->format == DRM_FORMAT_C8)
-- 
2.34.1



More information about the igt-dev mailing list