[Intel-gfx] [PATCH] kms_rotation_crc: Changing as per DRM rotation

Sonika Jindal sonika.jindal at intel.com
Wed Apr 15 03:07:27 PDT 2015


DRM rotation is counter clockwise. So changing the test accordingly.

Signed-off-by: Sonika Jindal <sonika.jindal at intel.com>
---
 tests/kms_rotation_crc.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 48afaa1..1054a75 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -81,19 +81,20 @@ paint_squares(data_t *data, struct igt_fb *fb, drmModeModeInfo *mode,
 		 * "rotation" is used for creating ref rotated fb and
 		 * "data->rotation" is used to determine the required size
 		 * while creating unrotated fb.
+		 * Also, drm rotation is counter clockwise.
 		 */
-		if (rotation == IGT_ROTATION_90) {
+		if (rotation == IGT_ROTATION_270) {
 			/* Paint 4 squares with width == height in Blue, Red,
-			Green, White Clockwise order to look like 90 degree rotated*/
+			Green, White Clockwise order to look like 270 degree rotated*/
 			w = h = mode->vdisplay;
 			igt_paint_color(cr, 0, 0, w / 2, h / 2, 0.0, 0.0, 1.0);
 			igt_paint_color(cr, w / 2, 0, w / 2, h / 2, 1.0, 0.0, 0.0);
 			igt_paint_color(cr, 0, h / 2, w / 2, h / 2, 1.0, 1.0, 1.0);
 			igt_paint_color(cr, w / 2, h / 2, w / 2, h / 2, 0.0, 1.0, 0.0);
 
-		} else if (rotation == IGT_ROTATION_270) {
+		} else if (rotation == IGT_ROTATION_90) {
 			/* Paint 4 squares with width == height in Green, White,
-			Blue, Red Clockwise order to look like 270 degree rotated*/
+			Blue, Red Clockwise order to look like 90 degree rotated*/
 			w = h = mode->vdisplay;
 			igt_paint_color(cr, 0, 0, w / 2, h / 2, 0.0, 1.0, 0.0);
 			igt_paint_color(cr, w / 2, 0, w / 2, h / 2, 1.0, 1.0, 1.0);
@@ -389,6 +390,7 @@ igt_main
 		test_plane_rotation(&data, IGT_PLANE_CURSOR);
 	}
 
+	/* Rotation is counter clockwise */
 	igt_subtest_f("primary-rotation-90") {
 		igt_require(gen >= 9);
 		data.rotation = IGT_ROTATION_90;
-- 
1.7.10.4



More information about the Intel-gfx mailing list