[Intel-gfx] [PATCH i-g-t] tests/kms_rotation_crc: Add bad-rotation subtest

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Wed Jul 20 13:18:13 UTC 2016


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Add "bad-rotation" subtest to make sure the kernel rejects some
invalid rotation values (0 and specifying multiple angles at one).

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tests/kms_rotation_crc.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 6cc15337fff9..e10a0a770437 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -237,6 +237,31 @@ static void wait_for_pageflip(int fd)
 	igt_assert(drmHandleEvent(fd, &evctx) == 0);
 }
 
+static void test_bad_prop_value(data_t *data)
+{
+	igt_display_t *display = &data->display;
+	int valid_tests = 0;
+	enum pipe pipe;
+	igt_plane_t *plane;
+	int ret;
+
+	for_each_pipe(display, pipe)  {
+		for_each_plane_on_pipe(display, pipe, plane) {
+			igt_require(igt_plane_supports_rotation(plane));
+
+			ret = drmModeObjectSetProperty(display->drm_fd,
+						       plane->drm_plane->plane_id,
+						       DRM_MODE_OBJECT_PLANE,
+						       plane->rotation_property,
+						       data->rotation);
+
+			igt_assert_eq(ret, -EINVAL);
+			valid_tests++;
+		}
+	}
+	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
+}
+
 static void test_plane_rotation(data_t *data, enum igt_plane plane_type)
 {
 	igt_display_t *display = &data->display;
@@ -508,6 +533,14 @@ igt_main
 
 		igt_display_init(&data.display, data.gfx_fd);
 	}
+	igt_subtest_f("bad-rotation") {
+		data.rotation = 0;
+		test_bad_prop_value(&data);
+
+		data.rotation = IGT_ROTATION_0 | IGT_ROTATION_180;
+		test_bad_prop_value(&data);
+	}
+
 	igt_subtest_f("primary-rotation-180") {
 		data.rotation = IGT_ROTATION_180;
 		test_plane_rotation(&data, IGT_PLANE_PRIMARY);
-- 
2.7.4



More information about the Intel-gfx mailing list