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

Commit 1313beec authored by Shalini Krishnamoorthi's avatar Shalini Krishnamoorthi Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: Handle fb_release_all before cont-splash handoff



By default android framework sends a NULL commit initially,
before sending any frames. When continuous splash is enabled,
driver skips handling this NULL commit to avoid blank frames
during bootup. However, it has to be processed if it is due
to fb_release_all, as pipes need to be unstaged before going
to suspend state.

Change-Id: Id40ddd85ea59125f177fb7054554bccf35546fbd
Signed-off-by: default avatarShalini Krishnamoorthi <shakri@codeaurora.org>
parent f62dfbb4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -821,6 +821,8 @@ struct mdss_overlay_private {
	u32 bl_events;
	u32 ad_events;
	u32 ad_bl_events;

	bool allow_kickoff;
};

struct mdss_mdp_set_ot_params {
+26 −18
Original line number Diff line number Diff line
@@ -1353,6 +1353,9 @@ int mdss_mdp_overlay_start(struct msm_fb_data_type *mfd)
		mdss_mdp_release_splash_pipe(mfd);
		return 0;
	} else if (mfd->panel_info->cont_splash_enabled) {
		if (mdp5_data->allow_kickoff) {
			mdp5_data->allow_kickoff = false;
		} else {
			mutex_lock(&mdp5_data->list_lock);
			rc = list_empty(&mdp5_data->pipes_used);
			mutex_unlock(&mdp5_data->list_lock);
@@ -1361,6 +1364,7 @@ int mdss_mdp_overlay_start(struct msm_fb_data_type *mfd)
					mfd->index);
				return -EPERM;
			}
		}
	} else if (mdata->handoff_pending) {
		pr_warn("fb%d: commit while splash handoff pending\n",
				mfd->index);
@@ -5051,6 +5055,7 @@ static int mdss_mdp_overlay_off(struct msm_fb_data_type *mfd)
{
	int rc;
	struct mdss_overlay_private *mdp5_data;
	struct mdss_data_type *mdata = mdss_mdp_get_mdata();
	struct mdss_mdp_mixer *mixer;
	int need_cleanup;
	int retire_cnt;
@@ -5069,18 +5074,6 @@ static int mdss_mdp_overlay_off(struct msm_fb_data_type *mfd)
		return -ENODEV;
	}

	if (!mdss_mdp_ctl_is_power_on(mdp5_data->ctl)) {
		if (mfd->panel_reconfig) {
			if (mfd->panel_info->cont_splash_enabled)
				mdss_mdp_handoff_cleanup_ctl(mfd);

			mdp5_data->borderfill_enable = false;
			mdss_mdp_ctl_destroy(mdp5_data->ctl);
			mdp5_data->ctl = NULL;
		}
		return 0;
	}

	/*
	 * Keep a reference to the runtime pm until the overlay is turned
	 * off, and then release this last reference at the end. This will
@@ -5125,7 +5118,20 @@ static int mdss_mdp_overlay_off(struct msm_fb_data_type *mfd)

	if (need_cleanup) {
		pr_debug("cleaning up pipes on fb%d\n", mfd->index);
		if (mdata->handoff_pending)
			mdp5_data->allow_kickoff = true;

		mdss_mdp_overlay_kickoff(mfd, NULL);
	} else if (!mdss_mdp_ctl_is_power_on(mdp5_data->ctl)) {
		if (mfd->panel_reconfig) {
			if (mfd->panel_info->cont_splash_enabled)
				mdss_mdp_handoff_cleanup_ctl(mfd);

			mdp5_data->borderfill_enable = false;
			mdss_mdp_ctl_destroy(mdp5_data->ctl);
			mdp5_data->ctl = NULL;
		}
		goto end;
	}

	/*
@@ -5200,6 +5206,7 @@ ctl_stop:
		mdp5_data->wfd = NULL;
	}

end:
	/* Release the last reference to the runtime device */
	rc = pm_runtime_put(&mfd->pdev->dev);
	if (rc)
@@ -5627,6 +5634,7 @@ int mdss_mdp_overlay_init(struct msm_fb_data_type *mfd)
	mdp5_data->hw_refresh = true;
	mdp5_data->cursor_ndx[CURSOR_PIPE_LEFT] = MSMFB_NEW_REQUEST;
	mdp5_data->cursor_ndx[CURSOR_PIPE_RIGHT] = MSMFB_NEW_REQUEST;
	mdp5_data->allow_kickoff = false;

	mfd->mdp.private1 = mdp5_data;
	mfd->wait_for_kickoff = true;