Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_plane: Add debug prints for pixel format tests if couldn't use custom plane size
@ 2023-06-02 10:50 Juha-Pekka Heikkila
  2023-06-02 11:40 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Juha-Pekka Heikkila @ 2023-06-02 10:50 UTC (permalink / raw)
  To: igt-dev

Moved check for setting 64x64 plane size for pixel format tests into its own
function and added debug prints if couldn't use smaller than full mode size
plane for testing.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_plane.c | 57 +++++++++++++++++++++++++++++------------------
 1 file changed, 35 insertions(+), 22 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 90b68a47..dfc6a8c5 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -896,6 +896,40 @@ struct format_mod {
 	uint32_t format;
 };
 
+/*
+ * See if test can go use 64x64 plane size for testing. If driver is not
+ * reporting to be atomic, will not try to use 64x64 plane size.
+*/
+static void check_allowed_plane_size_64x64(data_t *data, igt_plane_t *plane,
+					   uint64_t *width, uint64_t *height,
+					   uint32_t format)
+{
+	struct igt_fb test_fb;
+	int ret;
+
+	if (!data->display.is_atomic) {
+		igt_debug("Not using 64x64 plane size on non-atomic platform\n");
+		return;
+	}
+
+	igt_create_fb(data->drm_fd, 64, 64, format, DRM_FORMAT_MOD_LINEAR, &test_fb);
+	igt_plane_set_fb(plane, &test_fb);
+
+	ret = igt_display_try_commit_atomic(&data->display,
+					    DRM_MODE_ATOMIC_TEST_ONLY |
+					    DRM_MODE_ATOMIC_ALLOW_MODESET,
+					    NULL);
+	if (!ret) {
+		*width = test_fb.width;
+		*height = test_fb.height;
+	} else {
+		igt_debug("Not using 64x64 plane size, atomic commit did not "
+			  "accept 64x64 plane size\n");
+	}
+
+	igt_remove_fb(data->drm_fd, &test_fb);
+}
+
 static bool test_format_plane(data_t *data, enum pipe pipe,
 			      igt_output_t *output, igt_plane_t *plane, igt_fb_t *primary_fb)
 {
@@ -944,28 +978,7 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 		 IGT_FORMAT_ARGS(ref.format), IGT_MODIFIER_ARGS(ref.modifier),
 		 kmstest_pipe_name(pipe), plane->index);
 
-	if (data->display.is_atomic) {
-		struct igt_fb test_fb;
-		int ret;
-
-		igt_create_fb(data->drm_fd, 64, 64, ref.format,
-			      DRM_FORMAT_MOD_LINEAR, &test_fb);
-
-		igt_plane_set_fb(plane, &test_fb);
-
-		ret = igt_display_try_commit_atomic(&data->display,
-						    DRM_MODE_ATOMIC_TEST_ONLY |
-						    DRM_MODE_ATOMIC_ALLOW_MODESET,
-						    NULL);
-		if (!ret) {
-			width = test_fb.width;
-			height = test_fb.height;
-		}
-
-		igt_plane_set_fb(plane, clear_fb);
-
-		igt_remove_fb(data->drm_fd, &test_fb);
-	}
+	check_allowed_plane_size_64x64(data, plane, &width, &height, ref.format);
 
 	capture_format_crcs_single(data, pipe, plane, ref.format, ref.modifier,
 				   width, height, IGT_COLOR_YCBCR_BT709,
-- 
2.25.1

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

end of thread, other threads:[~2023-06-05 15:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-02 10:50 [igt-dev] [PATCH i-g-t] tests/kms_plane: Add debug prints for pixel format tests if couldn't use custom plane size Juha-Pekka Heikkila
2023-06-02 11:40 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-06-04 11:48 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-06-05 12:46 ` [igt-dev] [PATCH i-g-t] " Zbigniew Kempczyński
2023-06-05 15:25 ` Sharma, Swati2
2023-06-05 15:27 ` Sharma, Swati2

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