summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
authorJoonas Lahtinen2015-10-01 09:00:58 +0200
committerDaniel Vetter2015-10-05 15:32:51 +0200
commit14152c8d30bbe5155d0438feb0a1931aee0e5bce (patch)
tree95413eb6b55273473746f8d65a8c93720c75eaad /drivers/gpu/drm/drm_crtc.c
parentdrm: Add DRM_ROTATE_MASK and DRM_REFLECT_MASK (diff)
downloadkernel-qcow2-linux-14152c8d30bbe5155d0438feb0a1931aee0e5bce.tar.gz
kernel-qcow2-linux-14152c8d30bbe5155d0438feb0a1931aee0e5bce.tar.xz
kernel-qcow2-linux-14152c8d30bbe5155d0438feb0a1931aee0e5bce.zip
drm: Use DRM_ROTATE_MASK and DRM_REFLECT_MASK
Avoid magic numbers and use the introduced defines. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index e600a5fb2b60..e7c842289568 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -5629,7 +5629,8 @@ unsigned int drm_rotation_simplify(unsigned int rotation,
{
if (rotation & ~supported_rotations) {
rotation ^= BIT(DRM_REFLECT_X) | BIT(DRM_REFLECT_Y);
- rotation = (rotation & ~0xf) | BIT((ffs(rotation & 0xf) + 1) % 4);
+ rotation = (rotation & DRM_REFLECT_MASK) |
+ BIT((ffs(rotation & DRM_ROTATE_MASK) + 1) % 4);
}
return rotation;