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

Commit 80bd3897 authored by Benet Clark's avatar Benet Clark
Browse files

msm: mdss: Fix locking error in histogram enable



There was a missing spinlock around a histogram variable that needs
locking when being read. It has been added.

Change-Id: I78ca9652ecf6e08168842b17000aabf6b6308d4c
Signed-off-by: default avatarBenet Clark <benetc@codeaurora.org>
parent 4c048f47
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -3052,18 +3052,14 @@ static int pp_hist_enable(struct pp_hist_col_info *hist_info,

	mutex_lock(&hist_info->hist_mutex);
	/* check if it is idle */
	spin_lock_irqsave(&hist_info->hist_lock, flag);
	if (hist_info->col_en) {
		spin_unlock_irqrestore(&hist_info->hist_lock, flag);
		pr_info("%s Hist collection has already been enabled %p",
			__func__, hist_info->base);
		ret = -EINVAL;
		goto exit;
	}
	hist_info->frame_cnt = req->frame_cnt;
	INIT_COMPLETION(hist_info->comp);
	hist_info->hist_cnt_read = 0;
	hist_info->hist_cnt_sent = 0;
	hist_info->hist_cnt_time = 0;
	spin_lock_irqsave(&hist_info->hist_lock, flag);
	hist_info->read_request = 0;
	if (is_hist_v2)
		hist_info->col_state = HIST_IDLE;
@@ -3071,6 +3067,11 @@ static int pp_hist_enable(struct pp_hist_col_info *hist_info,
		hist_info->col_state = HIST_RESET;
	hist_info->col_en = true;
	spin_unlock_irqrestore(&hist_info->hist_lock, flag);
	hist_info->frame_cnt = req->frame_cnt;
	INIT_COMPLETION(hist_info->comp);
	hist_info->hist_cnt_read = 0;
	hist_info->hist_cnt_sent = 0;
	hist_info->hist_cnt_time = 0;
	mdss_mdp_hist_intr_req(&mdata->hist_intr,
				intr_mask << hist_info->intr_shift, true);
	if (is_hist_v2) {