diff options
| author | Adrian Salido-Moreno <adrianm@codeaurora.org> | 2013-08-05 14:03:25 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:20:08 -0700 |
| commit | d71d856bf93be6c31a03f1d3f7fa954a5b52ddb4 (patch) | |
| tree | 46b5389c21c78eb51770dfab6b08bdaa33d882ac | |
| parent | 387f43dba14ba4baddec2e2f0bbf758741b244cf (diff) | |
msm: mdss: enable overfetch in dual pipe scenarios
Overfetch is disabled on the borders of videos to avoid picking up
padding which may result in greenish border on right and bottom. However
this has side effect for dual pipe cases where overfetch is required for
smooth scaling effect in the middle of image. Add a flag to catch these
cases and enable overfetching in the middle.
Change-Id: I2545dbdab2c0643986fefa85990e9e820e4c3611
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp.h | 5 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_overlay.c | 12 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_pipe.c | 34 | ||||
| -rw-r--r-- | include/uapi/linux/msm_mdp.h | 1 |
4 files changed, 45 insertions, 7 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp.h b/drivers/video/fbdev/msm/mdss_mdp.h index 3566429c7f87..d38adfa86997 100644 --- a/drivers/video/fbdev/msm/mdss_mdp.h +++ b/drivers/video/fbdev/msm/mdss_mdp.h @@ -49,6 +49,11 @@ /* wait for at most 2 vsync for lowest refresh rate (24hz) */ #define KOFF_TIMEOUT msecs_to_jiffies(84) +#define OVERFETCH_DISABLE_TOP BIT(0) +#define OVERFETCH_DISABLE_BOTTOM BIT(1) +#define OVERFETCH_DISABLE_LEFT BIT(2) +#define OVERFETCH_DISABLE_RIGHT BIT(3) + #ifdef MDSS_MDP_DEBUG_REG static inline void mdss_mdp_reg_write(u32 addr, u32 val) { diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c index 801852c30dfa..ca85fe060080 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c +++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c @@ -506,8 +506,16 @@ static int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd, pr_warn("Unintended blend_op %d on layer with no alpha plane\n", pipe->blend_op); - pipe->overfetch_disable = fmt->is_yuv && - !(pipe->flags & MDP_SOURCE_ROTATED_90); + if (fmt->is_yuv && !(pipe->flags & MDP_SOURCE_ROTATED_90)) { + pipe->overfetch_disable = OVERFETCH_DISABLE_BOTTOM; + + if (!(pipe->flags & MDSS_MDP_DUAL_PIPE) || + (pipe->flags & MDSS_MDP_RIGHT_MIXER)) + pipe->overfetch_disable |= OVERFETCH_DISABLE_RIGHT; + pr_debug("overfetch flags=%x\n", pipe->overfetch_disable); + } else { + pipe->overfetch_disable = 0; + } req->id = pipe->ndx; pipe->req_data = *req; diff --git a/drivers/video/fbdev/msm/mdss_mdp_pipe.c b/drivers/video/fbdev/msm/mdss_mdp_pipe.c index 4d5fcd7118f2..cf2ecfb29bcb 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pipe.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pipe.c @@ -499,7 +499,7 @@ static int mdss_mdp_image_setup(struct mdss_mdp_pipe *pipe) pr_debug("Image decimation h=%d v=%d\n", pipe->horz_deci, pipe->vert_deci); - img_size = (height << 16) | width; + src_size = (pipe->src.h << 16) | pipe->src.w; src_xy = (pipe->src.y << 16) | pipe->src.x; dst_size = (pipe->dst.h << 16) | pipe->dst.w; @@ -510,9 +510,25 @@ static int mdss_mdp_image_setup(struct mdss_mdp_pipe *pipe) (pipe->src_planes.ystride[3] << 16); if (pipe->overfetch_disable) { - img_size = src_size; - src_xy = 0; + if (pipe->overfetch_disable & OVERFETCH_DISABLE_BOTTOM) { + height = pipe->src.h; + if (!(pipe->overfetch_disable & OVERFETCH_DISABLE_TOP)) + height += pipe->src.y; + } + if (pipe->overfetch_disable & OVERFETCH_DISABLE_RIGHT) { + width = pipe->src.w; + if (!(pipe->overfetch_disable & OVERFETCH_DISABLE_LEFT)) + width += pipe->src.x; + } + if (pipe->overfetch_disable & OVERFETCH_DISABLE_LEFT) + src_xy &= ~0xFFFF; + if (pipe->overfetch_disable & OVERFETCH_DISABLE_TOP) + src_xy &= ~(0xFFFF << 16); + + pr_debug("overfetch w=%d/%d h=%d/%d src_xy=0x%08x\n", width, + pipe->img_width, height, pipe->img_height, src_xy); } + img_size = (height << 16) | width; mdss_mdp_pipe_write(pipe, MDSS_MDP_REG_SSPP_SRC_IMG_SIZE, img_size); mdss_mdp_pipe_write(pipe, MDSS_MDP_REG_SSPP_SRC_SIZE, src_size); @@ -632,9 +648,17 @@ static int mdss_mdp_src_addr_setup(struct mdss_mdp_pipe *pipe, if (ret) return ret; - if (pipe->overfetch_disable) - mdss_mdp_data_calc_offset(data, pipe->src.x, pipe->src.y, + if (pipe->overfetch_disable) { + u32 x = 0, y = 0; + + if (pipe->overfetch_disable & OVERFETCH_DISABLE_LEFT) + x = pipe->src.x; + if (pipe->overfetch_disable & OVERFETCH_DISABLE_TOP) + y = pipe->src.y; + + mdss_mdp_data_calc_offset(data, x, y, &pipe->src_planes, pipe->src_fmt); + } /* planar format expects YCbCr, swap chroma planes if YCrCb */ if (mdata->mdp_rev < MDSS_MDP_HW_REV_102 && diff --git a/include/uapi/linux/msm_mdp.h b/include/uapi/linux/msm_mdp.h index 870bb5f03b32..3a184e359254 100644 --- a/include/uapi/linux/msm_mdp.h +++ b/include/uapi/linux/msm_mdp.h @@ -145,6 +145,7 @@ enum { #define MDSS_MDP_ROT_ONLY 0x80 #define MDSS_MDP_RIGHT_MIXER 0x100 +#define MDSS_MDP_DUAL_PIPE 0x200 /* mdp_blit_req flag values */ #define MDP_ROT_NOP 0 |
