Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a267fae authored by Ujwal Patel's avatar Ujwal Patel
Browse files

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: default avatarUjwal Patel <ujwalp@codeaurora.org>
parent 04a87eb5
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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)
{
+10 −3
Original line number Diff line number Diff line
@@ -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;
	}