Skip to content

Commit 1e8df16

Browse files
Sonika Jindaldanvet
authored andcommitted
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ä <[email protected]> Cc: Ville Syrjälä <[email protected]> Signed-off-by: Sonika Jindal <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
1 parent 7546a38 commit 1e8df16

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3010,12 +3010,16 @@ u32 skl_plane_ctl_rotation(unsigned int rotation)
30103010
switch (rotation) {
30113011
case BIT(DRM_ROTATE_0):
30123012
break;
3013+
/*
3014+
* DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr
3015+
* while i915 HW rotation is clockwise, thats why this swapping.
3016+
*/
30133017
case BIT(DRM_ROTATE_90):
3014-
return PLANE_CTL_ROTATE_90;
3018+
return PLANE_CTL_ROTATE_270;
30153019
case BIT(DRM_ROTATE_180):
30163020
return PLANE_CTL_ROTATE_180;
30173021
case BIT(DRM_ROTATE_270):
3018-
return PLANE_CTL_ROTATE_270;
3022+
return PLANE_CTL_ROTATE_90;
30193023
default:
30203024
MISSING_CASE(rotation);
30213025
}

0 commit comments

Comments
 (0)