[igt-dev] [PATCH i-g-t 6/9] tests/kms_rotation_crc: Move bad_format parameter to test_plane_rotation

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Thu Feb 1 15:39:11 UTC 2018


Instead of 2 functions doing the same thing, consolidate to a single function.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 tests/kms_rotation_crc.c | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index c402da068ae0..70eb6d24b466 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -368,7 +368,7 @@ static void wait_for_pageflip(int fd)
 	igt_assert(drmHandleEvent(fd, &evctx) == 0);
 }
 
-static void __test_plane_rotation(data_t *data, int plane_type, bool test_bad_format)
+static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_format)
 {
 	igt_display_t *display = &data->display;
 	igt_output_t *output;
@@ -468,16 +468,6 @@ static void __test_plane_rotation(data_t *data, int plane_type, bool test_bad_fo
 	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
 }
 
-static inline void test_bad_plane_rotation(data_t *data, int plane_type)
-{
-	__test_plane_rotation(data, plane_type, true);
-}
-
-static inline void test_plane_rotation(data_t *data, int plane_type)
-{
-	__test_plane_rotation(data, plane_type, false);
-}
-
 static void test_plane_rotation_ytiled_obj(data_t *data,
 					   igt_output_t *output,
 					   int plane_type)
@@ -784,7 +774,7 @@ igt_main
 				    gen >= 9);
 			data.rotation = subtest->rot;
 			data.flips = subtest->flips;
-			test_plane_rotation(&data, subtest->plane);
+			test_plane_rotation(&data, subtest->plane, false);
 		}
 	}
 	data.flips = 0;
@@ -794,7 +784,7 @@ igt_main
 		data.rotation = IGT_ROTATION_90;
 		data.pos_x = 100,
 		data.pos_y = 0;
-		test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
+		test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY, false);
 	}
 	data.pos_x = 0,
 	data.pos_y = 0;
@@ -803,7 +793,7 @@ igt_main
 		igt_require(gen >= 9);
 		data.rotation = IGT_ROTATION_90;
 		data.override_fmt = DRM_FORMAT_RGB565;
-		test_bad_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
+		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY, true);
 	}
 	data.override_fmt = 0;
 
@@ -811,7 +801,7 @@ igt_main
 		igt_require(gen >= 9);
 		data.rotation = IGT_ROTATION_90;
 		data.override_tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
-		test_bad_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
+		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY, true);
 	}
 	data.override_tiling = 0;
 
@@ -846,7 +836,7 @@ igt_main
 			data.rotation = (IGT_REFLECT_X | reflect_x->rot);
 			data.override_tiling = reflect_x->tiling;
 			data.flips = reflect_x->flips;
-			test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
+			test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY, false);
 		}
 	}
 
-- 
2.15.1



More information about the igt-dev mailing list