diff options
| author | Ujwal Patel <ujwalp@codeaurora.org> | 2013-10-29 20:21:37 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:22:52 -0700 |
| commit | 5053cb23f27c6a08365540d81dfdba44b31309f9 (patch) | |
| tree | 1fd978fd4ddac2dd64215cf77b182cc3a2c8f7d6 | |
| parent | 05c60b98b32f2d4961411f63c222ff0b147aae90 (diff) | |
msm: mdss: Fix CSC programming for VIG3 pipe
CSC programming assumes that pipe numbers are symmetric for same
type. This assumption is not valid with APQ8084 and leads to skipping
of CSC programming for VIG3 pipe. Fix this by using helper APIs to
find out if pipe is VIG or not rather than directly manipulating data
structures.
Change-Id: I130ee3994d1f5c5a96e644f8095c75d2189fbdda
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp.h | 15 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_pp.c | 13 |
2 files changed, 25 insertions, 3 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp.h b/drivers/video/fbdev/msm/mdss_mdp.h index 7ce4ee8bb0ef..c45a76ae9942 100644 --- a/drivers/video/fbdev/msm/mdss_mdp.h +++ b/drivers/video/fbdev/msm/mdss_mdp.h @@ -428,6 +428,21 @@ enum mdss_screen_state { MDSS_SCREEN_FORCE_BLANK, }; +static inline bool mdss_mdp_pipe_is_yuv(struct mdss_mdp_pipe *pipe) +{ + return pipe && (pipe->type == MDSS_MDP_PIPE_TYPE_VIG); +} + +static inline bool mdss_mdp_pipe_is_rgb(struct mdss_mdp_pipe *pipe) +{ + return pipe && (pipe->type == MDSS_MDP_PIPE_TYPE_RGB); +} + +static inline bool mdss_mdp_pipe_is_dma(struct mdss_mdp_pipe *pipe) +{ + return pipe && (pipe->type == MDSS_MDP_PIPE_TYPE_DMA); +} + static inline void mdss_mdp_ctl_write(struct mdss_mdp_ctl *ctl, u32 reg, u32 val) { diff --git a/drivers/video/fbdev/msm/mdss_mdp_pp.c b/drivers/video/fbdev/msm/mdss_mdp_pp.c index b78556645464..262a114e2a1f 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pp.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pp.c @@ -394,14 +394,21 @@ int mdss_mdp_csc_setup_data(u32 block, u32 blk_idx, u32 tbl_idx, mdata = mdss_mdp_get_mdata(); switch (block) { case MDSS_MDP_BLOCK_SSPP: - if (blk_idx < mdata->nvig_pipes) { - pipe = mdata->vig_pipes + blk_idx; + pipe = mdss_mdp_pipe_search(mdata, BIT(blk_idx)); + if (!pipe) { + pr_err("invalid blk index=%d\n", blk_idx); + ret = -EINVAL; + break; + } + if (mdss_mdp_pipe_is_yuv(pipe)) { base = pipe->base; if (tbl_idx == 1) base += MDSS_MDP_REG_VIG_CSC_1_BASE; else base += MDSS_MDP_REG_VIG_CSC_0_BASE; } else { + pr_err("non ViG pipe %d for CSC is not allowed\n", + blk_idx); ret = -EINVAL; } break; @@ -418,7 +425,7 @@ int mdss_mdp_csc_setup_data(u32 block, u32 blk_idx, u32 tbl_idx, break; } if (ret != 0) { - pr_err("unsupported block id for csc\n"); + pr_err("unsupported block id %d for csc\n", blk_idx); return ret; } |
