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

Commit 1042bdd5 authored by Kuogee Hsieh's avatar Kuogee Hsieh
Browse files

msm: mdss: serialize overlay_vsync_ctrl with ov_lock



There is a race condition between mdss_mdp_idle_pc_restore
and mdss_mdp_display_commit. Use ov_lock to serialize
execution of these two threads to fix race condition.

Change-Id: I6454e3d0edf2f3655e442d591fb3cac48f88a712
Signed-off-by: default avatarKuogee Hsieh <khsieh@codeaurora.org>
parent f1d461b6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2513,6 +2513,7 @@ static void mdss_mdp_overlay_handle_vsync(struct mdss_mdp_ctl *ctl,

int mdss_mdp_overlay_vsync_ctrl(struct msm_fb_data_type *mfd, int en)
{
	struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd);
	struct mdss_mdp_ctl *ctl = mfd_to_ctl(mfd);
	int rc;

@@ -2529,12 +2530,14 @@ int mdss_mdp_overlay_vsync_ctrl(struct msm_fb_data_type *mfd, int en)

	pr_debug("fb%d vsync en=%d\n", mfd->index, en);

	mutex_lock(&mdp5_data->ov_lock);
	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);
	if (en)
		rc = ctl->ops.add_vsync_handler(ctl, &ctl->vsync_handler);
	else
		rc = ctl->ops.remove_vsync_handler(ctl, &ctl->vsync_handler);
	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
	mutex_unlock(&mdp5_data->ov_lock);

	return rc;
}