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

Commit bdba8109 authored by Ingrid Gallardo's avatar Ingrid Gallardo
Browse files

msm: mdss: disable dsi burst mode when idle is enabled



When driver programs dsi to add an idle delay,
burst mode needs to be disabled so the
idle delay is inserted between packets.
This change makes sure that burst mode gets
disabled when idle is enabled, fixing some
corruption shown in jdi panel that needs an
extra delay during partial update for small
widths.

CRs-Fixed: 959818
Change-Id: Ida840302f9f5313e46e3d27933c40bfc2b65e8f7
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent 1c10389d
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -2865,7 +2865,7 @@ static int mdss_dsi_cont_splash_config(struct mdss_panel_info *pinfo,
				       struct mdss_dsi_ctrl_pdata *ctrl_pdata)
{
	void *clk_handle;
	int rc = 0, data;
	int rc = 0;

	if (pinfo->cont_splash_enabled) {
		rc = mdss_dsi_panel_power_ctrl(&(ctrl_pdata->panel_data),
@@ -2887,12 +2887,9 @@ static int mdss_dsi_cont_splash_config(struct mdss_panel_info *pinfo,
				  MDSS_DSI_ALL_CLKS, MDSS_DSI_CLK_ON);
		ctrl_pdata->is_phyreg_enabled = 1;
		mdss_dsi_get_hw_revision(ctrl_pdata);
		if ((ctrl_pdata->shared_data->hw_rev >= MDSS_DSI_HW_REV_103)
			&& (pinfo->type == MIPI_CMD_PANEL)) {
			data = MIPI_INP(ctrl_pdata->ctrl_base + 0x1b8);
			if (data & BIT(16))
				ctrl_pdata->burst_mode_enabled = true;
		}

		if (pinfo->type == MIPI_CMD_PANEL)
			mdss_dsi_set_burst_mode(ctrl_pdata);
	} else {
		pinfo->panel_power_state = MDSS_PANEL_POWER_OFF;
	}
+2 −0
Original line number Diff line number Diff line
@@ -512,6 +512,7 @@ struct mdss_dsi_ctrl_pdata {
	bool cmd_cfg_restore;
	bool do_unicast;

	bool idle_enabled;
	int horizontal_idle_cnt;
	struct panel_horizontal_idle *line_idle;
	struct mdss_util_intf *mdss_util;
@@ -649,6 +650,7 @@ void mdss_dsi_panel_dsc_pps_send(struct mdss_dsi_ctrl_pdata *ctrl,
void mdss_dsi_dsc_config(struct mdss_dsi_ctrl_pdata *ctrl,
	struct dsc_desc *dsc);
void mdss_dsi_dfps_config_8996(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_set_burst_mode(struct mdss_dsi_ctrl_pdata *ctrl);

static inline const char *__mdss_dsi_pm_name(enum dsi_pm_type module)
{
+27 −7
Original line number Diff line number Diff line
@@ -1239,6 +1239,32 @@ void mdss_dsi_dsc_config(struct mdss_dsi_ctrl_pdata *ctrl, struct dsc_desc *dsc)
	MIPI_OUTP((ctrl->ctrl_base) + offset, data);
}

void mdss_dsi_set_burst_mode(struct mdss_dsi_ctrl_pdata *ctrl)
{
	u32 data;

	if (ctrl->shared_data->hw_rev < MDSS_DSI_HW_REV_103)
		return;

	data = MIPI_INP(ctrl->ctrl_base + 0x1b8);

	/*
	 * idle and burst mode are mutually exclusive features,
	 * so disable burst mode if idle has been configured for
	 * the panel, otherwise enable the feature.
	 */
	if (ctrl->idle_enabled)
		data &= ~BIT(16); /* disable burst mode */
	else
		data |= BIT(16); /* enable burst mode */

	ctrl->burst_mode_enabled = !ctrl->idle_enabled;

	MIPI_OUTP((ctrl->ctrl_base + 0x1b8), data);
	pr_debug("%s: burst=%d\n", __func__, ctrl->burst_mode_enabled);

}

static void mdss_dsi_mode_setup(struct mdss_panel_data *pdata)
{
	struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
@@ -1349,13 +1375,7 @@ static void mdss_dsi_mode_setup(struct mdss_panel_data *pdata)
			MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x2b4, data);
		}

		/* Enable frame transfer in burst mode */
		if (ctrl_pdata->shared_data->hw_rev >= MDSS_DSI_HW_REV_103) {
			data = MIPI_INP(ctrl_pdata->ctrl_base + 0x1b8);
			data = data | BIT(16);
			MIPI_OUTP((ctrl_pdata->ctrl_base + 0x1b8), data);
			ctrl_pdata->burst_mode_enabled = 1;
		}
		mdss_dsi_set_burst_mode(ctrl_pdata);

		/* DSI_COMMAND_MODE_MDP_STREAM_CTRL */
		MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x60, stream_ctrl);
+7 −0
Original line number Diff line number Diff line
@@ -1748,6 +1748,13 @@ static void mdss_dsi_parse_panel_horizintal_line_idle(struct device_node *np,
		ctrl->horizontal_idle_cnt++;
	}

	/*
	 * idle is enabled for this controller, this will be used to
	 * enable/disable burst mode since both features are mutually
	 * exclusive.
	 */
	ctrl->idle_enabled = true;

	pr_debug("%s: horizontal_idle_cnt=%d\n", __func__,
				ctrl->horizontal_idle_cnt);
}