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

Commit cc99b783 authored by Ingrid Gallardo's avatar Ingrid Gallardo Committed by Abhijith Desai
Browse files

msm: mdss: fix autorefresh during kickoff



When autorefresh is enabled, any kickoff that
gets processed needs to wait to make sure the
transfer is on-going before continuing
the commit; current driver only waits for
autorefresh interrupt but this doesn't
guarantee that transfer is already on-going.
This change waits for the write pointer,
to make sure a transfer is on-going.

Change-Id: I247b3aad8f2f6ea8954d54f34492e293f80f99d4
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent 0670ca43
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -2611,10 +2611,11 @@ static void mdss_mdp_cmd_wait4_autorefresh_done(struct mdss_mdp_ctl *ctl)
	struct mdss_mdp_cmd_ctx *ctx = ctl->intf_ctx[MASTER_CTX];
	unsigned long flags;
	unsigned long autorefresh_timeout;
	u32 timeout_us = 20000;

	line_out = mdss_mdp_pingpong_read(pp_base, MDSS_MDP_REG_PP_LINE_COUNT);

	MDSS_XLOG(ctl->num, line_out, ctl->mixer_left->roi.h);
	MDSS_XLOG(ctl->num, line_out, ctl->mixer_left->roi.h, 0x111);

	reinit_completion(&ctx->autorefresh_done);

@@ -2673,6 +2674,26 @@ static void mdss_mdp_cmd_wait4_autorefresh_done(struct mdss_mdp_ctl *ctl)
			"dsi1_ctrl", "dsi1_phy", "vbif", "vbif_nrt",
			"dbg_bus", "vbif_dbg_bus", "panic");
	}

	/* once autorefresh is done, wait for write pointer */
	line_out = mdss_mdp_pingpong_read(pp_base, MDSS_MDP_REG_PP_LINE_COUNT);
	MDSS_XLOG(ctl->num, line_out, 0x222);

	/* wait until the first line is out to make sure transfer is on-going */
	rc = readl_poll_timeout(pp_base +
		MDSS_MDP_REG_PP_LINE_COUNT, val,
		(val & 0xffff) >= 1, 10, timeout_us);

	if (rc) {
		pr_err("timed out waiting for line out ctl:%d val:0x%x\n",
			ctl->num, val);
		MDSS_XLOG(0xbad5, val);
		MDSS_XLOG_TOUT_HANDLER("mdp", "dsi0_ctrl", "dsi0_phy",
			"dsi1_ctrl", "dsi1_phy", "vbif", "vbif_nrt",
			"dbg_bus", "vbif_dbg_bus", "panic");
	}

	MDSS_XLOG(val, 0x333);
}

/* caller needs to hold autorefresh_lock before calling this function */