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

Commit 949b86ce authored by Gopikrishnaiah Anandan's avatar Gopikrishnaiah Anandan
Browse files

mdss: mdp: update dspp histogram states atomically



State of dspp histogram blocks attached to logical display
should be changed atomically to idle when histogram collect is ioctl
is called by userspace clients. This will ensure that histogram
interrupt handler will see consistent states for all dspp's attached to
logical display and prevent incorrect sysfs notification to userspace
modules.

Change-Id: I7f32ce21cd65026e1ea01e3b6fe8b571c7b08db3
Signed-off-by: default avatarGopikrishnaiah Anandan <agopik@codeaurora.org>
parent c22fe3da
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -4352,11 +4352,25 @@ int mdss_mdp_hist_collect(struct mdp_histogram_data *hist)
				pr_err("hist error: dspp[%d] collect %d\n",
					dspp_num, ret);
		}
		/* state of dspp histogram blocks attached to logical display
		 * should be changed atomically to idle. This will ensure that
		 * histogram interrupt will see consistent states for all dspp's
		 * attached to logical display.
		 * */
		for (i = 0; i < hist_cnt; i++) {
			/* Change the state of histogram back to idle */
			if (!i)
				spin_lock_irqsave(&hists[i]->hist_lock, flag);
			else
				spin_lock(&hists[i]->hist_lock);
		}
		for (i = 0; i < hist_cnt; i++)
			hists[i]->col_state = HIST_IDLE;
			spin_unlock_irqrestore(&hists[i]->hist_lock, flag);
		for (i = hist_cnt - 1; i >= 0; i--) {
			if (!i)
				spin_unlock_irqrestore(&hists[i]->hist_lock,
						       flag);
			else
				spin_unlock(&hists[i]->hist_lock);
		}
		if (ret || temp_ret) {
			ret = ret ? ret : temp_ret;