[PATCH i-g-t v3 5/5] tests/kms_atomic: Add subtest for solid fill cursor planes

Jessica Zhang quic_jesszhan at quicinc.com
Fri Mar 1 20:47:34 UTC 2024


Add a subtest for testing solid fill cursor planes.

This test will commit a solid fill cursor plane on top of a normal
framebuffer primary plane and compare the resulting CRC with the CRC
value of a framebuffer cursor and primary plane of the same contents.

Signed-off-by: Jessica Zhang <quic_jesszhan at quicinc.com>
---
 tests/kms_atomic.c | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
index 0598c5d71a85..38ca9837166c 100755
--- a/tests/kms_atomic.c
+++ b/tests/kms_atomic.c
@@ -109,6 +109,7 @@
  * arg[1]:
  *
  * @primary:        Primary plane
+ * @cursor:         Cursor plane
  */
 
 #ifndef DRM_CAP_CURSOR_WIDTH
@@ -1387,10 +1388,18 @@ static void test_solid_fill_plane(data_t *data, igt_output_t *output, igt_plane_
 	igt_require(igt_plane_has_prop(plane, IGT_PLANE_SOLID_FILL));
 	igt_require(igt_plane_has_prop(plane, IGT_PLANE_PIXEL_SOURCE));
 
-	rect.x1 = 0;
-	rect.x2 = mode->hdisplay;
-	rect.y1 = 0;
-	rect.y2 = mode->vdisplay;
+	if (plane->type == DRM_PLANE_TYPE_PRIMARY)
+	{
+		rect.x1 = 0;
+		rect.x2 = mode->hdisplay;
+		rect.y1 = 0;
+		rect.y2 = mode->vdisplay;
+	} else {
+		rect.x1 = mode->hdisplay / 2 - 50;
+		rect.x2 = mode->hdisplay / 2 + 50;
+		rect.y1 = mode->vdisplay / 2 - 50;
+		rect.y2 = mode->vdisplay / 2 + 50;
+	}
 
 	width = rect_width(&rect);
 	height = rect_height(&rect);
@@ -1807,6 +1816,24 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
 		}
 	}
 
+	igt_describe("Test case for solid fill cursor planes");
+	igt_subtest_with_dynamic("plane-cursor-solid-fill") {
+		for_each_pipe_with_single_output(&data.display, pipe, output) {
+			igt_plane_t *cursor =
+				igt_pipe_get_plane_type(&data.display.pipes[pipe], DRM_PLANE_TYPE_CURSOR);
+			if (!pipe_output_combo_valid(&data.display, pipe, output))
+				continue;
+			if (!cursor)
+				continue;
+
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
+				atomic_setup(&data, pipe, output);
+				test_solid_fill_plane(&data, output, cursor);
+				atomic_clear(&data, pipe, output);
+			}
+		}
+	}
+
 	igt_fixture {
 		igt_display_fini(&data.display);
 		drm_close_driver(data.drm_fd);

-- 
2.43.2



More information about the igt-dev mailing list