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

Commit 6bf146d3 authored by Sachin Bhayare's avatar Sachin Bhayare Committed by Krishna Manikandan
Browse files

msm: mdss: fix fence time out issue



Stop the DMA transfer in ULP mode before turning
off the clocks.

Change-Id: Iaaf9d09e66480a70049f7b62188b4800c55d55ea
Signed-off-by: default avatarSachin Bhayare <sachin.bhayare@codeaurora.org>
parent c8953aae
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1071,6 +1071,17 @@ u64 mdp3_get_panic_lut_cfg(u32 panel_width)
	return panic_config;
}

int mdp3_enable_panic_ctrl(void)
{
	int rc = 0;

	if (MDP3_REG_READ(MDP3_PANIC_ROBUST_CTRL) == 0) {
		pr_err("%s: Enable Panic Control\n", __func__);
		MDP3_REG_WRITE(MDP3_PANIC_ROBUST_CTRL, BIT(0));
	}
	return rc;
}

int mdp3_qos_remapper_setup(struct mdss_panel_data *panel)
{
	int rc = 0;
+1 −0
Original line number Diff line number Diff line
@@ -265,6 +265,7 @@ u64 mdp3_clk_round_off(u64 clk_rate);
void mdp3_calc_dma_res(struct mdss_panel_info *panel_info, u64 *clk_rate,
		u64 *ab, u64 *ib, uint32_t bpp);
void mdp3_clear_irq(u32 interrupt_mask);
int mdp3_enable_panic_ctrl(void);

#define MDP3_REG_WRITE(addr, val) writel_relaxed(val, mdp3_res->mdp_base + addr)
#define MDP3_REG_READ(addr) readl_relaxed(mdp3_res->mdp_base + addr)
+14 −0
Original line number Diff line number Diff line
@@ -773,6 +773,8 @@ static int mdp3_ctrl_on(struct msm_fb_data_type *mfd)
				MDSS_EVENT_UNBLANK, NULL);
		rc |= panel->event_handler(panel,
				MDSS_EVENT_PANEL_ON, NULL);
		if (mdss_fb_is_power_on_ulp(mfd))
			rc |= mdp3_enable_panic_ctrl();
			mdp3_clk_enable(0, 0);
		}
	}
@@ -1020,6 +1022,18 @@ static int mdp3_ctrl_off(struct msm_fb_data_type *mfd)
	if (mdss_fb_is_power_on_ulp(mfd) &&
		(mfd->panel.type == MIPI_CMD_PANEL)) {
		pr_debug("%s: Disable MDP3 clocks in ULP\n", __func__);
		if (!mdp3_session->clk_on)
			mdp3_ctrl_clk_enable(mfd, 1);
		/*
		 * STOP DMA transfer first and signal vsync notification
		 * Before releasing the resource in ULP state.
		 */
		rc = mdp3_session->dma->stop(mdp3_session->dma,
					mdp3_session->intf);
		if (rc)
			pr_warn("fail to stop the MDP3 dma in ULP\n");
		/* Wait to ensure TG to turn off */
		msleep(20);
		/*
		 * Handle ULP request initiated from fb_pm_suspend.
		 * For ULP panel power state disabling vsync and set