All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] kms_plane_scaling: Add more scale factor tests to cover more drivers
@ 2022-01-26 11:58 Petri Latvala
  2022-01-26 12:31 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Petri Latvala @ 2022-01-26 11:58 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Not all drivers support all scale factors. Introduce more scale
factors rather than only testing scaling from a 20x20 fb.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Jessica Zhang <quic_jesszhan@quicinc.com>
---
 tests/kms_plane_scaling.c | 81 +++++++++++++++++++++++++++++++--------
 1 file changed, 65 insertions(+), 16 deletions(-)

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 85db11ee..47ef4a12 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -120,12 +120,14 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 
 static void check_scaling_pipe_plane_rot(data_t *d, igt_plane_t *plane,
 					 uint32_t pixel_format,
-					 uint64_t modifier, enum pipe pipe,
+					 uint64_t modifier,
+					 int width, int height,
+					 enum pipe pipe,
 					 igt_output_t *output,
 					 igt_rotation_t rot)
 {
 	igt_display_t *display = &d->display;
-	int width, height;
+	int commit_ret;
 	drmModeModeInfo *mode;
 
 	cleanup_crtc(d);
@@ -133,22 +135,24 @@ static void check_scaling_pipe_plane_rot(data_t *d, igt_plane_t *plane,
 	igt_output_set_pipe(output, pipe);
 	mode = igt_output_get_mode(output);
 
-	/* create buffer in the range of  min and max source side limit.*/
-	width = height = 20;
 	igt_create_color_fb(display->drm_fd, width, height,
 		       pixel_format, modifier, 0.0, 1.0, 0.0, &d->fb[0]);
 	igt_plane_set_fb(plane, &d->fb[0]);
 
-	/* Check min to full resolution upscaling */
 	igt_fb_set_position(&d->fb[0], plane, 0, 0);
 	igt_fb_set_size(&d->fb[0], plane, width, height);
 	igt_plane_set_position(plane, 0, 0);
 	igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
 	igt_plane_set_rotation(plane, rot);
-	igt_display_commit2(display, COMMIT_ATOMIC);
+	commit_ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
 
 	igt_plane_set_fb(plane, NULL);
 	igt_plane_set_position(plane, 0, 0);
+
+	igt_skip_on_f(commit_ret == -ERANGE,
+		      "Unsupported scaling factor with fb size %dx%d\n",
+		      width, height);
+	igt_assert_eq(commit_ret, 0);
 }
 
 static const igt_rotation_t rotations[] = {
@@ -243,6 +247,7 @@ static bool test_pipe_iteration(data_t *data, enum pipe pipe, int iteration)
 }
 
 static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,
+					   int width, int height,
 					   igt_output_t *output)
 {
 	igt_display_t *display = &d->display;
@@ -271,9 +276,11 @@ static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,
 				    igt_plane_has_rotation(plane, rot) &&
 				    can_rotate(d, format, modifier, rot) &&
 				    can_scale(d, format))
-					check_scaling_pipe_plane_rot(d, plane, format,
-								     modifier, pipe,
-								     output, rot);
+					check_scaling_pipe_plane_rot(d, plane,
+								     format, modifier,
+								     width, height,
+								     pipe, output,
+								     rot);
 			}
 
 			igt_vec_fini(&tested_formats);
@@ -288,7 +295,8 @@ static const uint64_t modifiers[] = {
 	I915_FORMAT_MOD_Yf_TILED
 };
 
-static void test_scaler_with_pixel_format_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
+static void test_scaler_with_pixel_format_pipe(data_t *d, int width, int height,
+					       enum pipe pipe, igt_output_t *output)
 {
 	igt_display_t *display = &d->display;
 	igt_plane_t *plane;
@@ -315,6 +323,7 @@ static void test_scaler_with_pixel_format_pipe(data_t *d, enum pipe pipe, igt_ou
 				    can_scale(d, format))
 					check_scaling_pipe_plane_rot(d, plane,
 								     format, modifier,
+								     width, height,
 								     pipe, output, IGT_ROTATION_0);
 			}
 
@@ -726,18 +735,58 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 					test_plane_scaling_on_pipe(&data, pipe, output);
 		}
 
-		igt_describe("Tests scaling with pixel formats.");
-		igt_subtest_with_dynamic("scaler-with-pixel-format") {
+		igt_describe("Tests scaling with pixel formats, from 20x20 fb.");
+		igt_subtest_with_dynamic("scaler-with-pixel-format-20x20") {
+			for_each_pipe_with_single_output(&data.display, pipe, output)
+				igt_dynamic_f("pipe-%s-scaler-with-pixel-format", kmstest_pipe_name(pipe))
+					test_scaler_with_pixel_format_pipe(&data, 20, 20, pipe, output);
+		}
+
+		igt_describe("Tests scaling with pixel formats, scaling factor 4.");
+		igt_subtest_with_dynamic("scaler-with-pixel-format-factor-4") {
+			drmModeModeInfo *mode;
+
+			mode = igt_output_get_mode(output);
+			for_each_pipe_with_single_output(&data.display, pipe, output)
+				igt_dynamic_f("pipe-%s-scaler-with-pixel-format", kmstest_pipe_name(pipe))
+					test_scaler_with_pixel_format_pipe(&data, mode->hdisplay / 4, mode->vdisplay / 4, pipe, output);
+		}
+
+		igt_describe("Tests scaling with pixel formats, unity scaling.");
+		igt_subtest_with_dynamic("scaler-with-pixel-format-unity-scaling") {
+			drmModeModeInfo *mode;
+
+			mode = igt_output_get_mode(output);
 			for_each_pipe_with_single_output(&data.display, pipe, output)
 				igt_dynamic_f("pipe-%s-scaler-with-pixel-format", kmstest_pipe_name(pipe))
-					test_scaler_with_pixel_format_pipe(&data, pipe, output);
+					test_scaler_with_pixel_format_pipe(&data, mode->hdisplay, mode->vdisplay, pipe, output);
+		}
+
+		igt_describe("Tests scaling with tiling rotation, from 20x20 fb.");
+		igt_subtest_with_dynamic("scaler-with-rotation-20x20") {
+			for_each_pipe_with_single_output(&data.display, pipe, output)
+				igt_dynamic_f("pipe-%s-scaler-with-rotation", kmstest_pipe_name(pipe))
+					test_scaler_with_rotation_pipe(&data, 20, 20, pipe, output);
 		}
 
-		igt_describe("Tests scaling with tiling rotation.");
-		igt_subtest_with_dynamic("scaler-with-rotation") {
+		igt_describe("Tests scaling with tiling rotation, scaling factor 4.");
+		igt_subtest_with_dynamic("scaler-with-rotation-factor-4") {
+			drmModeModeInfo *mode;
+
+			mode = igt_output_get_mode(output);
+			for_each_pipe_with_single_output(&data.display, pipe, output)
+				igt_dynamic_f("pipe-%s-scaler-with-rotation", kmstest_pipe_name(pipe))
+					test_scaler_with_rotation_pipe(&data, mode->hdisplay / 4, mode->vdisplay / 4, pipe, output);
+		}
+
+		igt_describe("Tests scaling with tiling rotation, unity scaling.");
+		igt_subtest_with_dynamic("scaler-with-rotation-unity-scaling") {
+			drmModeModeInfo *mode;
+
+			mode = igt_output_get_mode(output);
 			for_each_pipe_with_single_output(&data.display, pipe, output)
 				igt_dynamic_f("pipe-%s-scaler-with-rotation", kmstest_pipe_name(pipe))
-					test_scaler_with_rotation_pipe(&data, pipe, output);
+					test_scaler_with_rotation_pipe(&data, mode->hdisplay, mode->vdisplay, pipe, output);
 		}
 
 		igt_describe("Tests scaling with clipping and clamping.");
-- 
2.30.2

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

end of thread, other threads:[~2022-01-27 23:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 11:58 [igt-dev] [PATCH i-g-t] kms_plane_scaling: Add more scale factor tests to cover more drivers Petri Latvala
2022-01-26 12:31 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork
2022-01-26 16:33 ` [igt-dev] ✗ Fi.CI.BAT: failure for kms_plane_scaling: Add more scale factor tests to cover more drivers (rev2) Patchwork
2022-01-27 23:13 ` [igt-dev] [PATCH i-g-t] kms_plane_scaling: Add more scale factor tests to cover more drivers Jessica Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.