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

Commit 2ea80fb0 authored by Ken Zhang's avatar Ken Zhang
Browse files

msm: display: only release kickoff when no cleanup pipe



If there is some pipe to clean up, need wait for it be done to
make sure the pipe can be used for the second cycle and recover
mode can be executed.

Change-Id: Ifb3fdb152bc4bbf367b3d272aa0c88b1a0650c19
Signed-off-by: default avatarKen Zhang <kenz@codeaurora.org>
parent 9e3800f1
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -1297,6 +1297,7 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
	struct mdss_mdp_ctl *ctl = mfd_to_ctl(mfd);
	int ret = 0;
	int sd_in_pipe = 0;
	bool need_cleanup = false;

	if (ctl->shared_lock) {
		mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_BEGIN);
@@ -1342,6 +1343,7 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
		mdss_mdp_pipe_queue_data(pipe, NULL);
		mdss_mdp_mixer_pipe_unstage(pipe, pipe->mixer_left);
		mdss_mdp_mixer_pipe_unstage(pipe, pipe->mixer_right);
		need_cleanup = true;
	}

	ret = __overlay_queue_pipes(mfd);
@@ -1352,8 +1354,10 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
	else
		ret = mdss_mdp_display_commit(mdp5_data->ctl, NULL);

	if (!need_cleanup) {
		atomic_set(&mfd->kickoff_pending, 0);
		wake_up_all(&mfd->kickoff_wait_q);
	}

	if (IS_ERR_VALUE(ret))
		goto commit_fail;
@@ -1377,7 +1381,10 @@ commit_fail:
	mdss_mdp_overlay_cleanup(mfd);
	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);
	mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_FLUSHED);

	if (need_cleanup) {
		atomic_set(&mfd->kickoff_pending, 0);
		wake_up_all(&mfd->kickoff_wait_q);
	}
	mutex_unlock(&mdp5_data->ov_lock);
	if (ctl->shared_lock)
		mutex_unlock(ctl->shared_lock);