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

Commit 6e266570 authored by Dhaval Patel's avatar Dhaval Patel
Browse files

msm: mdss: provide an exclusive access to SSPP op_mode



IGC/SPA/QSEED effects are supported by PP module and
calibration service. User is not able observe the effect
when both modules try to enable/disable the effect
at the same time. This change provides calibration
service an exclusive access to SSPP_SRC_OP_MODE on
all source pipes and VIG_OP_MODE on all VIG pipes
during tuning state.

Change-Id: Ice50f579fcb900f673c52a6b17f40aeb3a0e0a66
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 5f4d31f2
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -795,9 +795,19 @@ static int pp_vig_pipe_setup(struct mdss_mdp_pipe *pipe, u32 *op)
	unsigned long flags = 0;
	char __iomem *offset;
	struct mdss_data_type *mdata;
	struct msm_fb_data_type *mfd = NULL;
	u32 current_opmode;
	u32 csc_reset;

	pr_debug("pnum=%x\n", pipe->num);

	if (!pipe->mixer || !pipe->mixer->ctl || !pipe->mixer->ctl->mfd) {
		pr_err("Invalid input params for vig pipe setup\n");
		return -EINVAL;
	}

	mfd = pipe->mixer->ctl->mfd;

	mdata = mdss_mdp_get_mdata();
	if ((pipe->flags & MDP_OVERLAY_PP_CFG_EN) &&
		(pipe->pp_cfg.config_ops & MDP_OVERLAY_PP_CSC_CFG)) {
@@ -829,6 +839,16 @@ static int pp_vig_pipe_setup(struct mdss_mdp_pipe *pipe, u32 *op)
		}
	}

	/* Update CSC state only if tuning mode is enable */
	if (mfd->dcm_state == DTM_ENTER) {
		/* Reset bit 16 to 19 for CSC_STATE in VIG_OP_MODE */
		csc_reset = 0xFFF0FFFF;
		current_opmode = readl_relaxed(pipe->base +
						MDSS_MDP_REG_VIG_OP_MODE);
		*op |= ((current_opmode & csc_reset) | opmode);
		return 0;
	}

	pp_hist_setup(&opmode, MDSS_PP_SSPP_CFG | pipe->num, pipe->mixer);

	if (pipe->flags & MDP_OVERLAY_PP_CFG_EN) {
@@ -1158,10 +1178,27 @@ int mdss_mdp_pipe_sspp_setup(struct mdss_mdp_pipe *pipe, u32 *op)
	char __iomem *pipe_base;
	u32 pipe_num;
	struct mdss_data_type *mdata = mdss_mdp_get_mdata();
	struct msm_fb_data_type *mfd = NULL;
	u32 current_opmode;

	if (pipe == NULL)
		return -EINVAL;

	if (!pipe->mixer || !pipe->mixer->ctl || !pipe->mixer->ctl->mfd) {
		pr_err("Invalid input params for sspp pipe setup\n");
		return -EINVAL;
	}

	mfd = pipe->mixer->ctl->mfd;

	/* Read IGC state and update the same if tuning mode is enable */
	if (mfd->dcm_state == DTM_ENTER) {
		current_opmode = readl_relaxed(pipe->base +
						MDSS_MDP_REG_SSPP_SRC_OP_MODE);
		*op |= (current_opmode & BIT(16));
		return ret;
	}

	/*
	 * TODO: should this function be responsible for masking multiple
	 * pipes to be written in dual pipe case?