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

Commit 26ac4767 authored by Ken Zhang's avatar Ken Zhang
Browse files

msm: display: kickoff lock release centralization



Centralize kickoff lock releasing, use notify event to trigger
in display commit thread.

Change-Id: I06fbe0660917a0c570b1337953f7334f3706ce8e
Signed-off-by: default avatarKen Zhang <kenz@codeaurora.org>
parent 38fb8d37
Loading
Loading
Loading
Loading
+15 −5
Original line number Original line Diff line number Diff line
@@ -2113,6 +2113,14 @@ static void mdss_fb_release_fences(struct msm_fb_data_type *mfd)
	mutex_unlock(&sync_pt_data->sync_mutex);
	mutex_unlock(&sync_pt_data->sync_mutex);
}
}


static void mdss_fb_release_kickoff(struct msm_fb_data_type *mfd)
{
	if (mfd->wait_for_kickoff) {
		atomic_set(&mfd->kickoff_pending, 0);
		wake_up_all(&mfd->kickoff_wait_q);
	}
}

/**
/**
 * __mdss_fb_sync_buf_done_callback() - process async display events
 * __mdss_fb_sync_buf_done_callback() - process async display events
 * @p:		Notifier block registered for async events.
 * @p:		Notifier block registered for async events.
@@ -2153,6 +2161,9 @@ static int __mdss_fb_sync_buf_done_callback(struct notifier_block *p,
		pr_debug("%s: frame done\n", sync_pt_data->fence_name);
		pr_debug("%s: frame done\n", sync_pt_data->fence_name);
		mdss_fb_signal_timeline(sync_pt_data);
		mdss_fb_signal_timeline(sync_pt_data);
		break;
		break;
	case MDP_NOTIFY_FRAME_START:
		mdss_fb_release_kickoff(mfd);
		break;
	}
	}


	return NOTIFY_OK;
	return NOTIFY_OK;
@@ -2337,15 +2348,14 @@ static int __mdss_fb_perform_commit(struct msm_fb_data_type *mfd)
		if (ret)
		if (ret)
			pr_err("pan display failed %x on fb%d\n", ret,
			pr_err("pan display failed %x on fb%d\n", ret,
					mfd->index);
					mfd->index);
		atomic_set(&mfd->kickoff_pending, 0);
		wake_up_all(&mfd->kickoff_wait_q);
	}
	}
	if (!ret)
	if (!ret)
		mdss_fb_update_backlight(mfd);
		mdss_fb_update_backlight(mfd);


	if (IS_ERR_VALUE(ret) || !sync_pt_data->flushed)
	if (IS_ERR_VALUE(ret) || !sync_pt_data->flushed) {
		mdss_fb_release_kickoff(mfd);
		mdss_fb_signal_timeline(sync_pt_data);
		mdss_fb_signal_timeline(sync_pt_data);

	}
	return ret;
	return ret;
}
}


@@ -2379,8 +2389,8 @@ static int __mdss_fb_display_thread(void *data)
		wake_up_all(&mfd->idle_wait_q);
		wake_up_all(&mfd->idle_wait_q);
	}
	}


	mdss_fb_release_kickoff(mfd);
	atomic_set(&mfd->commits_pending, 0);
	atomic_set(&mfd->commits_pending, 0);
	atomic_set(&mfd->kickoff_pending, 0);
	wake_up_all(&mfd->idle_wait_q);
	wake_up_all(&mfd->idle_wait_q);


	return ret;
	return ret;
+1 −0
Original line number Original line Diff line number Diff line
@@ -69,6 +69,7 @@ enum mdp_notify_event {
	MDP_NOTIFY_FRAME_FLUSHED,
	MDP_NOTIFY_FRAME_FLUSHED,
	MDP_NOTIFY_FRAME_DONE,
	MDP_NOTIFY_FRAME_DONE,
	MDP_NOTIFY_FRAME_TIMEOUT,
	MDP_NOTIFY_FRAME_TIMEOUT,
	MDP_NOTIFY_FRAME_START,
};
};


/**
/**
+5 −8
Original line number Original line Diff line number Diff line
@@ -1386,10 +1386,8 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
		ATRACE_END("display_commit");
		ATRACE_END("display_commit");
	}
	}


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


	if (IS_ERR_VALUE(ret))
	if (IS_ERR_VALUE(ret))
		goto commit_fail;
		goto commit_fail;
@@ -1417,10 +1415,9 @@ commit_fail:
	ATRACE_END("overlay_cleanup");
	ATRACE_END("overlay_cleanup");
	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);
	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);
	mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_FLUSHED);
	mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_FLUSHED);
	if (need_cleanup) {
	if (need_cleanup)
		atomic_set(&mfd->kickoff_pending, 0);
		mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_START);
		wake_up_all(&mfd->kickoff_wait_q);

	}
	mutex_unlock(&mdp5_data->ov_lock);
	mutex_unlock(&mdp5_data->ov_lock);
	if (ctl->shared_lock)
	if (ctl->shared_lock)
		mutex_unlock(ctl->shared_lock);
		mutex_unlock(ctl->shared_lock);