kms_rotation_crc: Changing as per DRM rotation

Submitted by sonika.jindal@intel.com on April 15, 2015, 10:07 a.m.

Details

Message ID 1429092447-4841-1-git-send-email-sonika.jindal@intel.com
State New
Headers show

Not browsing as part of any series.

Commit Message

sonika.jindal@intel.com April 15, 2015, 10:07 a.m.
DRM rotation is counter clockwise. So changing the test accordingly.

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

Patch hide | download patch | download mbox

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;