drm_plane_create_rotation_property(plane,
                                           DRM_ROTATE_0,
                                           DRM_ROTATE_0 |
+                                          DRM_ROTATE_180 |
                                           DRM_REFLECT_X |
                                           DRM_REFLECT_Y);
 }
                        plane_enabled(old_state), plane_enabled(state));
 
        if (plane_enabled(state)) {
+               unsigned int rotation;
+
                format = to_mdp_format(msm_framebuffer_format(state->fb));
                if (MDP_FORMAT_IS_YUV(format) &&
                        !pipe_supports_yuv(mdp5_plane->caps)) {
                        return -EINVAL;
                }
 
-               hflip = !!(state->rotation & DRM_REFLECT_X);
-               vflip = !!(state->rotation & DRM_REFLECT_Y);
+               rotation = drm_rotation_simplify(state->rotation,
+                                                DRM_ROTATE_0 |
+                                                DRM_REFLECT_X |
+                                                DRM_REFLECT_Y);
+               hflip = !!(rotation & DRM_REFLECT_X);
+               vflip = !!(rotation & DRM_REFLECT_Y);
+
                if ((vflip && !(mdp5_plane->caps & MDP_PIPE_CAP_VFLIP)) ||
                        (hflip && !(mdp5_plane->caps & MDP_PIPE_CAP_HFLIP))) {
                        dev_err(plane->dev->dev,
        int pe_top[COMP_MAX], pe_bottom[COMP_MAX];
        uint32_t hdecm = 0, vdecm = 0;
        uint32_t pix_format;
+       unsigned int rotation;
        bool vflip, hflip;
        unsigned long flags;
        int ret;
        config |= get_scale_config(format, src_h, crtc_h, false);
        DBG("scale config = %x", config);
 
-       hflip = !!(pstate->rotation & DRM_REFLECT_X);
-       vflip = !!(pstate->rotation & DRM_REFLECT_Y);
+       rotation = drm_rotation_simplify(pstate->rotation,
+                                        DRM_ROTATE_0 |
+                                        DRM_REFLECT_X |
+                                        DRM_REFLECT_Y);
+       hflip = !!(rotation & DRM_REFLECT_X);
+       vflip = !!(rotation & DRM_REFLECT_Y);
 
        spin_lock_irqsave(&mdp5_plane->pipe_lock, flags);