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

Commit 8e51935b authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran
Browse files

msm: mdss: avoid pipe_in_use check in recovery path



The pipe_in_use check is invalid during the recovery, as ctl_reset
is triggered and at that point, the pipes are not unstaged yet.
Avoid the pipe_in_use check as it would always be true during
recovery.

Change-Id: I281ab437c3f0beea71c0066d7ffcd3e282fd989f
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent ee630a97
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1202,7 +1202,7 @@ int mdss_mdp_wb_addr_setup(struct mdss_data_type *mdata,
	u32 num_wb, u32 num_intf_wb);
	u32 num_wb, u32 num_intf_wb);


void mdss_mdp_pipe_clk_force_off(struct mdss_mdp_pipe *pipe);
void mdss_mdp_pipe_clk_force_off(struct mdss_mdp_pipe *pipe);
int mdss_mdp_pipe_fetch_halt(struct mdss_mdp_pipe *pipe);
int mdss_mdp_pipe_fetch_halt(struct mdss_mdp_pipe *pipe, bool is_recovery);
int mdss_mdp_pipe_panic_signal_ctrl(struct mdss_mdp_pipe *pipe, bool enable);
int mdss_mdp_pipe_panic_signal_ctrl(struct mdss_mdp_pipe *pipe, bool enable);
void mdss_mdp_config_pipe_panic_lut(struct mdss_data_type *mdata);
void mdss_mdp_config_pipe_panic_lut(struct mdss_data_type *mdata);
void mdss_mdp_bwcpanic_ctrl(struct mdss_data_type *mdata, bool enable);
void mdss_mdp_bwcpanic_ctrl(struct mdss_data_type *mdata, bool enable);
@@ -1274,7 +1274,7 @@ void mdss_mdp_pipe_calc_pixel_extn(struct mdss_mdp_pipe *pipe);
int mdss_mdp_wb_set_secure(struct msm_fb_data_type *mfd, int enable);
int mdss_mdp_wb_set_secure(struct msm_fb_data_type *mfd, int enable);
int mdss_mdp_wb_get_secure(struct msm_fb_data_type *mfd, uint8_t *enable);
int mdss_mdp_wb_get_secure(struct msm_fb_data_type *mfd, uint8_t *enable);
void mdss_mdp_ctl_restore(bool locked);
void mdss_mdp_ctl_restore(bool locked);
int  mdss_mdp_ctl_reset(struct mdss_mdp_ctl *ctl);
int  mdss_mdp_ctl_reset(struct mdss_mdp_ctl *ctl, bool is_recovery);
int mdss_mdp_wait_for_xin_halt(u32 xin_id, bool is_vbif_nrt);
int mdss_mdp_wait_for_xin_halt(u32 xin_id, bool is_vbif_nrt);
void mdss_mdp_set_ot_limit(struct mdss_mdp_set_ot_params *params);
void mdss_mdp_set_ot_limit(struct mdss_mdp_set_ot_params *params);
int mdss_mdp_cmd_set_autorefresh_mode(struct mdss_mdp_ctl *ctl,
int mdss_mdp_cmd_set_autorefresh_mode(struct mdss_mdp_ctl *ctl,
+7 −7
Original line number Original line Diff line number Diff line
@@ -3390,7 +3390,7 @@ end:
 * This function called during control path reset and will halt
 * This function called during control path reset and will halt
 * all the pipes staged on the mixer.
 * all the pipes staged on the mixer.
 */
 */
static void mdss_mdp_pipe_reset(struct mdss_mdp_mixer *mixer)
static void mdss_mdp_pipe_reset(struct mdss_mdp_mixer *mixer, bool is_recovery)
{
{
	unsigned long pipe_map = mixer->pipe_mapped;
	unsigned long pipe_map = mixer->pipe_mapped;
	u32 bit = 0;
	u32 bit = 0;
@@ -3403,7 +3403,7 @@ static void mdss_mdp_pipe_reset(struct mdss_mdp_mixer *mixer)


		pipe = mdss_mdp_pipe_search(mdata, 1 << bit);
		pipe = mdss_mdp_pipe_search(mdata, 1 << bit);
		if (pipe) {
		if (pipe) {
			mdss_mdp_pipe_fetch_halt(pipe);
			mdss_mdp_pipe_fetch_halt(pipe, is_recovery);
			if (sw_rst_avail)
			if (sw_rst_avail)
				mdss_mdp_pipe_clk_force_off(pipe);
				mdss_mdp_pipe_clk_force_off(pipe);
		}
		}
@@ -3418,7 +3418,7 @@ static void mdss_mdp_pipe_reset(struct mdss_mdp_mixer *mixer)
 *
 *
 * Note: called within atomic context.
 * Note: called within atomic context.
 */
 */
int mdss_mdp_ctl_reset(struct mdss_mdp_ctl *ctl)
int mdss_mdp_ctl_reset(struct mdss_mdp_ctl *ctl, bool is_recovery)
{
{
	u32 status = 1;
	u32 status = 1;
	int cnt = 20;
	int cnt = 20;
@@ -3439,10 +3439,10 @@ int mdss_mdp_ctl_reset(struct mdss_mdp_ctl *ctl)
	} while (cnt > 0 && status);
	} while (cnt > 0 && status);


	if (mixer) {
	if (mixer) {
		mdss_mdp_pipe_reset(mixer);
		mdss_mdp_pipe_reset(mixer, is_recovery);


		if (ctl->mfd->split_mode == MDP_DUAL_LM_SINGLE_DISPLAY)
		if (ctl->mfd->split_mode == MDP_DUAL_LM_SINGLE_DISPLAY)
			mdss_mdp_pipe_reset(ctl->mixer_right);
			mdss_mdp_pipe_reset(ctl->mixer_right, is_recovery);
	}
	}


	if (!cnt)
	if (!cnt)
@@ -4302,9 +4302,9 @@ int mdss_mdp_display_wait4pingpong(struct mdss_mdp_ctl *ctl, bool use_lock)
	}
	}


	if (recovery_needed) {
	if (recovery_needed) {
		mdss_mdp_ctl_reset(ctl);
		mdss_mdp_ctl_reset(ctl, true);
		if (sctl)
		if (sctl)
			mdss_mdp_ctl_reset(sctl);
			mdss_mdp_ctl_reset(sctl, true);


		mdss_mdp_ctl_intf_event(ctl,
		mdss_mdp_ctl_intf_event(ctl,
				MDSS_EVENT_DSI_RESET_WRITE_PTR, NULL, false);
				MDSS_EVENT_DSI_RESET_WRITE_PTR, NULL, false);
+1 −1
Original line number Original line Diff line number Diff line
@@ -857,7 +857,7 @@ static void mdss_mdp_cmd_intf_recovery(void *data, int event)
	}
	}


	if (atomic_read(&ctx->koff_cnt)) {
	if (atomic_read(&ctx->koff_cnt)) {
		mdss_mdp_ctl_reset(ctx->ctl);
		mdss_mdp_ctl_reset(ctx->ctl, true);
		reset_done = true;
		reset_done = true;
	}
	}


+1 −1
Original line number Original line Diff line number Diff line
@@ -560,7 +560,7 @@ static int mdss_mdp_video_stop(struct mdss_mdp_ctl *ctl, int panel_power_state)


	MDSS_XLOG(ctl->num, ctl->vsync_cnt);
	MDSS_XLOG(ctl->num, ctl->vsync_cnt);


	mdss_mdp_ctl_reset(ctl);
	mdss_mdp_ctl_reset(ctl, false);
	ctl->intf_ctx[MASTER_CTX] = NULL;
	ctl->intf_ctx[MASTER_CTX] = NULL;


	if (ctl->cdm) {
	if (ctl->cdm) {
+2 −2
Original line number Original line Diff line number Diff line
@@ -1212,7 +1212,7 @@ static void mdss_mdp_overlay_cleanup(struct msm_fb_data_type *mfd,
	mutex_lock(&mdp5_data->list_lock);
	mutex_lock(&mdp5_data->list_lock);
	list_for_each_entry(pipe, destroy_pipes, list) {
	list_for_each_entry(pipe, destroy_pipes, list) {
		/* make sure pipe fetch has been halted before freeing buffer */
		/* make sure pipe fetch has been halted before freeing buffer */
		if (mdss_mdp_pipe_fetch_halt(pipe)) {
		if (mdss_mdp_pipe_fetch_halt(pipe, false)) {
			/*
			/*
			 * if pipe is not able to halt. Enter recovery mode,
			 * if pipe is not able to halt. Enter recovery mode,
			 * by un-staging any pipes that are attached to mixer
			 * by un-staging any pipes that are attached to mixer
@@ -2536,7 +2536,7 @@ static void mdss_mdp_recover_underrun_handler(struct mdss_mdp_ctl *ctl,
		return;
		return;
	}
	}


	mdss_mdp_ctl_reset(ctl);
	mdss_mdp_ctl_reset(ctl, true);
	schedule_work(&ctl->remove_underrun_handler);
	schedule_work(&ctl->remove_underrun_handler);
}
}


Loading