Commit 574a37b1 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter

drm/msm/mdp5: Advertize 180 degree rotation

Since the hardware can apparently do both X and Y reflection, we
can advertize also 180 degree rotation as thats just X+Y reflection.

v2: Drop the BIT()

Cc: Rob Clark <robdclark@gmail.com>
Cc: Jilai Wang <jilaiw@codeaurora.org>
Cc: Archit Taneja <architt@codeaurora.org>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1477077768-4274-3-git-send-email-ville.syrjala@linux.intel.com
parent 5b560c3a
...@@ -78,6 +78,7 @@ static void mdp5_plane_install_rotation_property(struct drm_device *dev, ...@@ -78,6 +78,7 @@ static void mdp5_plane_install_rotation_property(struct drm_device *dev,
drm_plane_create_rotation_property(plane, drm_plane_create_rotation_property(plane,
DRM_ROTATE_0, DRM_ROTATE_0,
DRM_ROTATE_0 | DRM_ROTATE_0 |
DRM_ROTATE_180 |
DRM_REFLECT_X | DRM_REFLECT_X |
DRM_REFLECT_Y); DRM_REFLECT_Y);
} }
...@@ -285,6 +286,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane, ...@@ -285,6 +286,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
plane_enabled(old_state), plane_enabled(state)); plane_enabled(old_state), plane_enabled(state));
if (plane_enabled(state)) { if (plane_enabled(state)) {
unsigned int rotation;
format = to_mdp_format(msm_framebuffer_format(state->fb)); format = to_mdp_format(msm_framebuffer_format(state->fb));
if (MDP_FORMAT_IS_YUV(format) && if (MDP_FORMAT_IS_YUV(format) &&
!pipe_supports_yuv(mdp5_plane->caps)) { !pipe_supports_yuv(mdp5_plane->caps)) {
...@@ -305,8 +308,13 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane, ...@@ -305,8 +308,13 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
return -EINVAL; return -EINVAL;
} }
hflip = !!(state->rotation & DRM_REFLECT_X); rotation = drm_rotation_simplify(state->rotation,
vflip = !!(state->rotation & DRM_REFLECT_Y); 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)) || if ((vflip && !(mdp5_plane->caps & MDP_PIPE_CAP_VFLIP)) ||
(hflip && !(mdp5_plane->caps & MDP_PIPE_CAP_HFLIP))) { (hflip && !(mdp5_plane->caps & MDP_PIPE_CAP_HFLIP))) {
dev_err(plane->dev->dev, dev_err(plane->dev->dev,
...@@ -677,6 +685,7 @@ static int mdp5_plane_mode_set(struct drm_plane *plane, ...@@ -677,6 +685,7 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
int pe_top[COMP_MAX], pe_bottom[COMP_MAX]; int pe_top[COMP_MAX], pe_bottom[COMP_MAX];
uint32_t hdecm = 0, vdecm = 0; uint32_t hdecm = 0, vdecm = 0;
uint32_t pix_format; uint32_t pix_format;
unsigned int rotation;
bool vflip, hflip; bool vflip, hflip;
unsigned long flags; unsigned long flags;
int ret; int ret;
...@@ -739,8 +748,12 @@ static int mdp5_plane_mode_set(struct drm_plane *plane, ...@@ -739,8 +748,12 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
config |= get_scale_config(format, src_h, crtc_h, false); config |= get_scale_config(format, src_h, crtc_h, false);
DBG("scale config = %x", config); DBG("scale config = %x", config);
hflip = !!(pstate->rotation & DRM_REFLECT_X); rotation = drm_rotation_simplify(pstate->rotation,
vflip = !!(pstate->rotation & DRM_REFLECT_Y); 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); spin_lock_irqsave(&mdp5_plane->pipe_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment