From a9335480c6b65df2ad6a195bc456d86c85900c98 Mon Sep 17 00:00:00 2001 From: Jeevan Shriram Date: Fri, 28 Aug 2015 22:57:53 -0700 Subject: [PATCH] msm: mdss: Correct phase step calculations for YUV format In the current implementation, phase step calculation for chroma plane is not considering chroma subsample and is reduced to half. This is incorrect and needs to be reduced to half only when chroma sub sampling is present. This change corrects the phase step calculations for the chroma planes. Change-Id: Ia909f909f699882b863efb17b5dded77e6fdb1b1 Signed-off-by: Jeevan Shriram --- drivers/video/fbdev/msm/mdss_mdp_pipe.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_mdp_pipe.c b/drivers/video/fbdev/msm/mdss_mdp_pipe.c index 79eb7961ea5c..d91da7f6dfd2 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pipe.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pipe.c @@ -2359,19 +2359,14 @@ void mdss_mdp_pipe_calc_pixel_extn(struct mdss_mdp_pipe *pipe) * phase step x,y for 0 plane should be calculated before * this */ - if (pipe->src_fmt->is_yuv) { - if (i == 1 || i == 2) { - pipe->scale.phase_step_x[i] = - pipe->scale.phase_step_x[0] / 2; - pipe->scale.phase_step_y[i] = - pipe->scale.phase_step_y[0] / 2; - } else { - pipe->scale.phase_step_x[i] = - pipe->scale.phase_step_x[0]; - pipe->scale.phase_step_y[i] = - pipe->scale.phase_step_y[0]; - } - } else { + if (pipe->src_fmt->is_yuv && (i == 1 || i == 2)) { + pipe->scale.phase_step_x[i] = + pipe->scale.phase_step_x[0] + >> pipe->chroma_sample_h; + pipe->scale.phase_step_y[i] = + pipe->scale.phase_step_y[0] + >> pipe->chroma_sample_v; + } else if (i > 0) { pipe->scale.phase_step_x[i] = pipe->scale.phase_step_x[0]; pipe->scale.phase_step_y[i] =