[PATCH i-g-t v6 2/2] tests/kms_plane_scaling: Improve error handling in kms_plane_scaling tests

Naladala Ramanaidu ramanaidu.naladala at intel.com
Tue Oct 15 13:56:54 UTC 2024


Refactor error handling in test_planes_scaling_combo to use break
statements instead of immediate returns. This ensures cleanup_fbs
is always called before exiting the loop. Additionally, adjust log
message formatting in igt_main_args for consistency.

Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
Reviewed-by: Kunal Joshi <kunal1.joshi at intel.com>
---
 tests/kms_plane_scaling.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 96ceedee2..a55720ed9 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -998,12 +998,12 @@ 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) {
-				cleanup_fbs(d);
-				return ret;
-			}
+			if (ret != 0)
+				break;
 		}
 		cleanup_fbs(d);
+		if (ret == 0)
+			break;
 	}
 	return ret;
 }
@@ -1543,7 +1543,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 								scaler_with_2_planes_tests[index].test_type);
 							if (ret == 0)
 								break;
-							igt_info("Required Scaling operation not supported on %s trying on next output\n",
+							igt_info("Required scaling operation not supported on %s trying on next output\n",
 								 igt_output_name(output));
 						}
 						igt_skip_on_f(ret == -ERANGE || ret == -EINVAL,
-- 
2.43.0



More information about the igt-dev mailing list