From a1eb2beb6e04a842df924255136b03cec99abe37 Mon Sep 17 00:00:00 2001 From: Adrian Salido-Moreno Date: Fri, 15 Jun 2012 11:28:12 -0700 Subject: [PATCH] mdss: display: fix incorrect rotator programming Source format should indicate that source is to be rotated 90 degrees instead of indicating source has been rotated 90 degrees. This is needed for hardware to fetch source in correct order and generate correct 90 degree output image. Change-Id: If8d1e12ef3e7a291e67ec9763f5ca92ec6fa983c Signed-off-by: Adrian Salido-Moreno --- drivers/video/msm/mdss/mdss_mdp_pipe.c | 13 +++++++------ drivers/video/msm/mdss/mdss_mdp_rotator.c | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/video/msm/mdss/mdss_mdp_pipe.c b/drivers/video/msm/mdss/mdss_mdp_pipe.c index 52f4324d72d1..d9a148e0b218 100644 --- a/drivers/video/msm/mdss/mdss_mdp_pipe.c +++ b/drivers/video/msm/mdss/mdss_mdp_pipe.c @@ -354,11 +354,12 @@ static int mdss_mdp_scale_setup(struct mdss_mdp_pipe *pipe) u32 chroma_sample; if (pipe->type == MDSS_MDP_PIPE_TYPE_DMA) { - if (!(pipe->flags & MDP_ROT_90) && (pipe->dst.h != pipe->src.h - || pipe->dst.w != pipe->src.w)) - return -EINVAL; /* no scaling supported on dma pipes */ - else + if (pipe->dst.h != pipe->src.h || pipe->dst.w != pipe->src.w) { + pr_err("no scaling supported on dma pipe\n"); + return -EINVAL; + } else { return 0; + } } chroma_sample = pipe->src_fmt->chroma_sample; @@ -535,10 +536,10 @@ static int mdss_mdp_format_setup(struct mdss_mdp_pipe *pipe) pr_debug("pnum=%d format=%d opmode=%x\n", pipe->num, fmt->format, opmode); - rot90 = !!(pipe->flags & MDP_SOURCE_ROTATED_90); + rot90 = !!(pipe->flags & MDP_ROT_90); chroma_samp = fmt->chroma_sample; - if (rot90) { + if (pipe->flags & MDP_SOURCE_ROTATED_90) { if (chroma_samp == MDSS_MDP_CHROMA_H2V1) chroma_samp = MDSS_MDP_CHROMA_H1V2; else if (chroma_samp == MDSS_MDP_CHROMA_H1V2) diff --git a/drivers/video/msm/mdss/mdss_mdp_rotator.c b/drivers/video/msm/mdss/mdss_mdp_rotator.c index fc3a8438f9ee..dc1cb0d2b7aa 100644 --- a/drivers/video/msm/mdss/mdss_mdp_rotator.c +++ b/drivers/video/msm/mdss/mdss_mdp_rotator.c @@ -212,6 +212,7 @@ int mdss_mdp_rotator_queue(struct mdss_mdp_rotator_session *rot, rot_pipe->img_width = rot->img_width; rot_pipe->img_height = rot->img_height; rot_pipe->src = rot->src_rect; + rot_pipe->dst = rot->src_rect; rot_pipe->bwc_mode = rot->bwc_mode; rot_pipe->params_changed++; }