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

Commit 7691028f authored by Benet Clark's avatar Benet Clark
Browse files

msm: mdss: Fix locking error in histogram setup



Previously, during histogram setup during dspp setup, there
was a check on histogram collection enable that was not protected
by the histogram mutex and spinlock. It has been added.

Change-Id: I28770486d31da6b9b8b7420e98f0e6a5a23ed0c2
Signed-off-by: default avatarBenet Clark <benetc@codeaurora.org>
parent 2b979b24
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -1394,7 +1394,7 @@ static int pp_hist_setup(u32 *op, u32 block, struct mdss_mdp_mixer *mix)
{
	int ret = -EINVAL;
	char __iomem *base;
	u32 op_flags, kick_base, col_state;
	u32 op_flags, kick_base;
	struct mdss_mdp_pipe *pipe;
	struct pp_hist_col_info *hist_info;
	unsigned long flag;
@@ -1430,20 +1430,19 @@ static int pp_hist_setup(u32 *op, u32 block, struct mdss_mdp_mixer *mix)
		goto error;
	}

	if (hist_info->col_en) {
		*op |= op_flags;
	mutex_lock(&hist_info->hist_mutex);
	spin_lock_irqsave(&hist_info->hist_lock, flag);
		col_state = hist_info->col_state;
		if (col_state == HIST_IDLE) {
	if (hist_info->col_en) {
		*op |= op_flags;
		if (hist_info->col_state == HIST_IDLE) {
			/* Kick off collection */
			if (is_hist_v1)
				writel_relaxed(1, base + kick_base);
			hist_info->col_state = HIST_START;
		}
	}
	spin_unlock_irqrestore(&hist_info->hist_lock, flag);
	mutex_unlock(&hist_info->hist_mutex);
	}
	ret = 0;
error:
	return ret;