From: Sonika Jindal Date: Wed, 20 May 2015 08:10:48 +0000 (+0530) Subject: drm/i915/skl: Swapping 90 and 270 to be compliant with Xrandr X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1e8df16778b0d8fd8102b3ee799b028f8f961089;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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ä Cc: Ville Syrjälä Signed-off-by: Sonika Jindal Reviewed-by: Ville Syrjälä Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 4a34709794f0..c97b4963e5c1 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3010,12 +3010,16 @@ u32 skl_plane_ctl_rotation(unsigned int rotation) switch (rotation) { case BIT(DRM_ROTATE_0): 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): - return PLANE_CTL_ROTATE_90; + return PLANE_CTL_ROTATE_270; case BIT(DRM_ROTATE_180): return PLANE_CTL_ROTATE_180; case BIT(DRM_ROTATE_270): - return PLANE_CTL_ROTATE_270; + return PLANE_CTL_ROTATE_90; default: MISSING_CASE(rotation); }