浏览代码

drm/i915/skl: Swapping 90 and 270 to be compliant with Xrandr

Since DRM_ROTATE is counter clockwise (which is compliant with Xrandr),
and HW rotation is clockwise, swapping 90/270 to work as expected from
userspace.

v2: Rebased

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Sonika Jindal 10 年之前
父节点
当前提交
1e8df16778
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      drivers/gpu/drm/i915/intel_display.c

+ 6 - 2
drivers/gpu/drm/i915/intel_display.c

@@ -3010,12 +3010,16 @@ u32 skl_plane_ctl_rotation(unsigned int rotation)
 	switch (rotation) {
 	switch (rotation) {
 	case BIT(DRM_ROTATE_0):
 	case BIT(DRM_ROTATE_0):
 		break;
 		break;
+	/*
+	 * DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr
+	 * while i915 HW rotation is clockwise, thats why this swapping.
+	 */
 	case BIT(DRM_ROTATE_90):
 	case BIT(DRM_ROTATE_90):
-		return PLANE_CTL_ROTATE_90;
+		return PLANE_CTL_ROTATE_270;
 	case BIT(DRM_ROTATE_180):
 	case BIT(DRM_ROTATE_180):
 		return PLANE_CTL_ROTATE_180;
 		return PLANE_CTL_ROTATE_180;
 	case BIT(DRM_ROTATE_270):
 	case BIT(DRM_ROTATE_270):
-		return PLANE_CTL_ROTATE_270;
+		return PLANE_CTL_ROTATE_90;
 	default:
 	default:
 		MISSING_CASE(rotation);
 		MISSING_CASE(rotation);
 	}
 	}