summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeera Sundaram Sankaran <veeras@codeaurora.org>2015-05-19 18:39:00 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:42:06 -0700
commit64cafae38fc7b2e9bb33e30801a0a444f3a01b76 (patch)
tree88979209374d8c6f4bb18b82e98974ff41eb4ae1
parenteb79a2a969ca891f5b7e62d45b0869bc5ee60078 (diff)
msm: mdss: fix pixel extension calculation for scaling cases
The upscale and unity scale parameter for X direction pixel extension is calculated and applied correctly only for plane 0. For other planes, these parameters are taken from previous plane's Y direction calculation, leading to corruption of images. Fix the calculation for these parameters by separating the variables used for X and Y direction. Change-Id: I066b014f2b55fc96afbf9424ebc679b409adb4c1 Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_pipe.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_pipe.c b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
index f1f4f9f2ce8f..211a97ddae55 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_pipe.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
@@ -2156,13 +2156,14 @@ void mdss_mdp_pipe_calc_pixel_extn(struct mdss_mdp_pipe *pipe)
{
int caf, i;
uint32_t src_h;
- uint32_t unity_scale = 0, upscale = 0;
+ bool unity_scale_x = false, upscale_x = false;
+ bool unity_scale_y, upscale_y;
if (!(pipe->src_fmt->is_yuv))
- unity_scale = (pipe->src.w == pipe->dst.w);
+ unity_scale_x = (pipe->src.w == pipe->dst.w);
- if (!unity_scale)
- upscale = (pipe->src.w <= pipe->dst.w);
+ if (!unity_scale_x)
+ upscale_x = (pipe->src.w <= pipe->dst.w);
pr_debug("pipe=%d, src(%d, %d, %d, %d), dest(%d, %d, %d, %d)\n",
pipe->num,
@@ -2210,10 +2211,10 @@ void mdss_mdp_pipe_calc_pixel_extn(struct mdss_mdp_pipe *pipe)
pr_debug("roi_w[%d]=%d, caf=%d\n", i, pipe->scale.roi_w[i],
caf);
- if (unity_scale) {
+ if (unity_scale_x) {
left = 0;
right = 0;
- } else if (!upscale) {
+ } else if (!upscale_x) {
left = 0;
right = (pipe->dst.w - 1) *
pipe->scale.phase_step_x[i];
@@ -2238,8 +2239,9 @@ void mdss_mdp_pipe_calc_pixel_extn(struct mdss_mdp_pipe *pipe)
pipe->scale.num_ext_pxls_right[i] = __pxl_extn_helper(right);
/* Pixel extension calculations for Y direction */
- unity_scale = 0;
- upscale = 0;
+ unity_scale_y = false;
+ upscale_y = false;
+
src_h = DECIMATED_DIMENSION(pipe->src.h, pipe->vert_deci);
/* Subsampling of chroma components is factored */
@@ -2247,15 +2249,15 @@ void mdss_mdp_pipe_calc_pixel_extn(struct mdss_mdp_pipe *pipe)
src_h >>= pipe->chroma_sample_v;
if (!(pipe->src_fmt->is_yuv))
- unity_scale = (src_h == pipe->dst.h);
+ unity_scale_y = (src_h == pipe->dst.h);
- if (!unity_scale)
- upscale = (src_h <= pipe->dst.h);
+ if (!unity_scale_y)
+ upscale_y = (src_h <= pipe->dst.h);
- if (unity_scale) {
+ if (unity_scale_y) {
top = 0;
bottom = 0;
- } else if (!upscale) {
+ } else if (!upscale_y) {
top = 0;
bottom = (pipe->dst.h - 1) *
pipe->scale.phase_step_y[i];