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

Commit c0549601 authored by Ray Zhang's avatar Ray Zhang
Browse files

msm: mdss: enable vsync event during continuous splash



Currently when continuous splash screen is enabled the vsync
event reports are delayed until first frame update. This blocks
boot animation. To fix this issue, after user space enables
vsync through vsync_ctrl, mdp driver will start sending vsync
events.

CRs-fixed: 567649
Change-Id: Ifb35e3479805e595d950ab7c38c26de201aa2d16
Signed-off-by: default avatarRay Zhang <rayzhang@codeaurora.org>
parent 9e79afb8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -535,7 +535,7 @@ int mdss_mdp_ctl_setup(struct mdss_mdp_ctl *ctl);
int mdss_mdp_ctl_split_display_setup(struct mdss_mdp_ctl *ctl,
		struct mdss_panel_data *pdata);
int mdss_mdp_ctl_destroy(struct mdss_mdp_ctl *ctl);
int mdss_mdp_ctl_start(struct mdss_mdp_ctl *ctl);
int mdss_mdp_ctl_start(struct mdss_mdp_ctl *ctl, bool handoff);
int mdss_mdp_ctl_stop(struct mdss_mdp_ctl *ctl);
int mdss_mdp_ctl_intf_event(struct mdss_mdp_ctl *ctl, int event, void *arg);
int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe,
+29 −16
Original line number Diff line number Diff line
@@ -1085,25 +1085,33 @@ int mdss_mdp_ctl_intf_event(struct mdss_mdp_ctl *ctl, int event, void *arg)
	return rc;
}

static int mdss_mdp_ctl_start_sub(struct mdss_mdp_ctl *ctl)
static int mdss_mdp_ctl_start_sub(struct mdss_mdp_ctl *ctl, bool handoff)
{
	struct mdss_mdp_mixer *mixer;
	u32 outsize, temp;
	int ret = 0;
	int i, nmixers;

	pr_debug("ctl_num=%d\n", ctl->num);

	/*
	 * Need start_fnc in 2 cases:
	 * (1) handoff
	 * (2) continuous splash finished.
	 */
	if (handoff || !ctl->panel_data->panel_info.cont_splash_enabled) {
		if (ctl->start_fnc)
			ret = ctl->start_fnc(ctl);
		else
		pr_warn("no start function for ctl=%d type=%d\n", ctl->num,
			pr_warn("no start function for ctl=%d type=%d\n",
					ctl->num,
					ctl->panel_data->panel_info.type);

		if (ret) {
			pr_err("unable to start intf\n");
			return ret;
		}

	pr_debug("ctl_num=%d\n", ctl->num);
	}

	if (!ctl->panel_data->panel_info.cont_splash_enabled) {
		nmixers = MDSS_MDP_INTF_MAX_LAYERMIXER +
@@ -1131,7 +1139,7 @@ static int mdss_mdp_ctl_start_sub(struct mdss_mdp_ctl *ctl)
	return ret;
}

int mdss_mdp_ctl_start(struct mdss_mdp_ctl *ctl)
int mdss_mdp_ctl_start(struct mdss_mdp_ctl *ctl, bool handoff)
{
	struct mdss_mdp_ctl *sctl;
	struct mdss_data_type *mdata = mdss_mdp_get_mdata();
@@ -1146,12 +1154,17 @@ int mdss_mdp_ctl_start(struct mdss_mdp_ctl *ctl)
	if (ret)
		return ret;


	sctl = mdss_mdp_get_split_ctl(ctl);

	mutex_lock(&ctl->lock);

	/*
	 * keep power_on false during handoff to avoid unexpected
	 * operations to overlay.
	 */
	if (!handoff)
		ctl->power_on = true;

	ctl->bus_ab_quota = 0;
	ctl->bus_ib_quota = 0;
	ctl->clk_rate = 0;
@@ -1164,10 +1177,10 @@ int mdss_mdp_ctl_start(struct mdss_mdp_ctl *ctl)
		goto error;
	}

	ret = mdss_mdp_ctl_start_sub(ctl);
	ret = mdss_mdp_ctl_start_sub(ctl, handoff);
	if (ret == 0) {
		if (sctl) { /* split display is available */
			ret = mdss_mdp_ctl_start_sub(sctl);
			ret = mdss_mdp_ctl_start_sub(sctl, handoff);
			if (!ret)
				mdss_mdp_ctl_split_display_enable(1, ctl, sctl);
		} else if (ctl->mixer_right) {
+14 −6
Original line number Diff line number Diff line
@@ -864,7 +864,7 @@ static int mdss_mdp_overlay_start(struct msm_fb_data_type *mfd)
		mdss_hw_init(mdss_res);
	}

	rc = mdss_mdp_ctl_start(ctl);
	rc = mdss_mdp_ctl_start(ctl, false);
	if (rc == 0) {
		atomic_inc(&ov_active_panels);

@@ -1576,8 +1576,8 @@ int mdss_mdp_overlay_vsync_ctrl(struct msm_fb_data_type *mfd, int en)
		return -ENODEV;
	if (!ctl->add_vsync_handler || !ctl->remove_vsync_handler)
		return -EOPNOTSUPP;

	if (!ctl->power_on) {
	if (!ctl->panel_data->panel_info.cont_splash_enabled
			&& !ctl->power_on) {
		pr_debug("fb%d vsync pending first update en=%d\n",
				mfd->index, en);
		return -EPERM;
@@ -1694,7 +1694,9 @@ static ssize_t mdss_mdp_vsync_show_event(struct device *dev,
	u64 vsync_ticks;
	int ret;

	if (!mdp5_data->ctl || !mdp5_data->ctl->power_on)
	if (!mdp5_data->ctl ||
		(!mdp5_data->ctl->panel_data->panel_info.cont_splash_enabled
			&& !mdp5_data->ctl->power_on))
		return -EAGAIN;

	vsync_ticks = ktime_to_ns(mdp5_data->vsync_time);
@@ -2540,9 +2542,15 @@ static int mdss_mdp_overlay_handoff(struct msm_fb_data_type *mfd)
		mdp5_data->ctl = ctl;
	}

	rc = mdss_mdp_ctl_setup(ctl);
	if (rc)
	/*
	 * vsync interrupt needs on during continuous splash, this is
	 * to initialize necessary ctl members here.
	 */
	rc = mdss_mdp_ctl_start(ctl, true);
	if (rc) {
		pr_err("Failed to initialize ctl\n");
		goto error;
	}

	ctl->clk_rate = mdss_mdp_get_clk_rate(MDSS_CLK_MDP_SRC);
	pr_debug("Set the ctl clock rate to %d Hz\n", ctl->clk_rate);