[PATCH i-g-t 2/3] tests/kms_plane_scaling: Update Multi-plane scaling functions

Naladala Ramanaidu ramanaidu.naladala at intel.com
Mon Aug 26 04:53:49 UTC 2024


This update enhances the multi-plane scaling subtest function by
improving error handling. The return type of
test_planes_scaling_combo has been changed from void to int. The
test logic has been updated to handle the return value appropriately
and skip unsupported scaling operations.

Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
---
 tests/kms_plane_scaling.c | 49 ++++++++++++++++++++++-----------------
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 588a9c5f0..d4d3664e8 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -930,7 +930,7 @@ static void setup_fb(int fd, int width, int height, struct igt_fb *fb)
 		      fb);
 }
 
-static void
+static int
 test_planes_scaling_combo(data_t *d, double sf_plane1,
 			  double sf_plane2,
 			  enum pipe pipe,
@@ -994,13 +994,14 @@ test_planes_scaling_combo(data_t *d, double sf_plane1,
 							  pipe, output, p1, p2,
 							  &d->fb[1], &d->fb[2],
 							  test_type);
-			if (ret != 0)
-				break;
+			if (ret != 0) {
+				cleanup_fbs(d);
+				return ret;
+			}
 		}
 		cleanup_fbs(d);
 	}
-	igt_skip_on_f(ret == -EINVAL || ret == -ERANGE, "Unsupported scaling operation in driver with return value %s\n",
-		      (ret == -EINVAL) ? "-EINVAL" : "-ERANGE");
+	return ret;
 }
 
 static void
@@ -1523,25 +1524,31 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 		for (int index = 0; index < ARRAY_SIZE(scaler_with_2_planes_tests); index++) {
 			igt_describe(scaler_with_2_planes_tests[index].describe);
 			igt_subtest_with_dynamic(scaler_with_2_planes_tests[index].name) {
-			for_each_pipe(&data.display, pipe) {
-				for_each_valid_output_on_pipe(&data.display, pipe, output) {
-					if (!pipe_output_combo_valid(&data.display, pipe, output))
-						continue;
-					if (get_num_scalers(&data.display, pipe) < 2)
-						continue;
-
-					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
-
-						test_planes_scaling_combo(&data,
-								scaler_with_2_planes_tests[index].sf_plane1,
-								scaler_with_2_planes_tests[index].sf_plane2,
-								pipe, output,
-								scaler_with_2_planes_tests[index].test_type);
+				for_each_pipe(&data.display, pipe) {
+					igt_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
+						for_each_valid_output_on_pipe(&data.display, pipe, output) {
+							igt_info(" Trying on %s\n", igt_output_name(output));
+							if (!pipe_output_combo_valid(&data.display, pipe, output))
+								continue;
+							if (get_num_scalers(&data.display, pipe) < 2)
+								continue;
+							ret = test_planes_scaling_combo(&data,
+									scaler_with_2_planes_tests[index].sf_plane1,
+									scaler_with_2_planes_tests[index].sf_plane2,
+									pipe, output,
+									scaler_with_2_planes_tests[index].test_type);
+							if (ret == 0)
+								break;
+							igt_info("Required Scaling operation not supported on %s trying on next valid output\n",
+								  igt_output_name(output));
+						}
+						igt_skip_on_f(ret == -ERANGE || ret == -EINVAL,
+							      "Unsupported scaling operation in driver with return value %s\n",
+							      (ret == -EINVAL) ? "-EINVAL" : "-ERANGE");
+						igt_assert_eq(ret, 0);
 					}
-					break;
 				}
 			}
-			}
 		}
 
 		for (int index = 0; index < ARRAY_SIZE(intel_paramtests); index++) {
-- 
2.43.0



More information about the igt-dev mailing list