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

Commit 706f221c authored by Ingrid Gallardo's avatar Ingrid Gallardo
Browse files

msm: mdss: update panel timings in upstream driver during vblank



During the controller configuration, some of the panel
timings could have been updated by the driver.
This change updates the panel information shared with the
upstream driver to keep updated the panel settings
that have changed after the controller setup.

Change-Id: I4d050d74f1aec50dbc294357ba0dace7c0940a16
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent c5818705
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@
#define CREATE_TRACE_POINTS
#include "mdss_debug.h"
#include "mdss_smmu.h"
#include "mdss_mdp.h"

#ifdef CONFIG_FB_MSM_TRIPLE_BUFFER
#define MDSS_FB_NUM 3
@@ -1448,6 +1449,9 @@ static int mdss_fb_blank_unblank(struct msm_fb_data_type *mfd)
	}

	if (mfd->mdp.on_fnc) {
		struct mdss_panel_info *panel_info = mfd->panel_info;
		struct fb_var_screeninfo *var = &mfd->fbi->var;

		ret = mfd->mdp.on_fnc(mfd);
		if (ret) {
			mdss_fb_stop_disp_thread(mfd);
@@ -1461,6 +1465,13 @@ static int mdss_fb_blank_unblank(struct msm_fb_data_type *mfd)
		mfd->update.is_suspend = 0;
		mutex_unlock(&mfd->update.lock);

		/*
		 * Panel info can change depending in the information
		 * programmed in the controller.
		 * Update this info in the upstream structs.
		 */
		mdss_panelinfo_to_fb_var(panel_info, var);

		/* Start the work thread to signal idle time */
		if (mfd->idle_time)
			schedule_delayed_work(&mfd->idle_notify_work,
@@ -3096,8 +3107,10 @@ static void mdss_panelinfo_to_fb_var(struct mdss_panel_info *pinfo,

	var->xres = mdss_fb_get_panel_xres(&pdata->panel_info);
	var->yres = pinfo->yres;
	var->lower_margin = pinfo->lcdc.v_front_porch;
	var->upper_margin = pinfo->lcdc.v_back_porch;
	var->lower_margin = pinfo->lcdc.v_front_porch -
		pinfo->prg_fet;
	var->upper_margin = pinfo->lcdc.v_back_porch +
		pinfo->prg_fet;
	var->vsync_len = pinfo->lcdc.v_pulse_width;
	var->right_margin = pinfo->lcdc.h_front_porch;
	var->left_margin = pinfo->lcdc.h_back_porch;
+0 −1
Original line number Diff line number Diff line
@@ -304,7 +304,6 @@ struct mdss_mdp_ctl {
	void *priv_data;
	void *intf_ctx[2];
	u32 wb_type;
	u32 prg_fet;

	struct mdss_mdp_writeback *wb;

+1 −1
Original line number Diff line number Diff line
@@ -1170,7 +1170,7 @@ static u32 mdss_mdp_get_vbp_factor(struct mdss_mdp_ctl *ctl)
	fps = mdss_panel_get_framerate(pinfo);
	v_total = mdss_panel_get_vtotal(pinfo);
	vbp = pinfo->lcdc.v_back_porch + pinfo->lcdc.v_pulse_width;
	vbp += ctl->prg_fet;
	vbp += pinfo->prg_fet;

	vbp_fac = (vbp) ? fps * v_total / vbp : 0;
	pr_debug("vbp_fac=%d vbp=%d v_total=%d\n", vbp_fac, vbp, v_total);
+10 −9
Original line number Diff line number Diff line
@@ -1153,12 +1153,12 @@ static void mdss_mdp_disable_prefill(struct mdss_mdp_ctl *ctl)
	struct mdss_panel_info *pinfo = &ctl->panel_data->panel_info;
	struct mdss_data_type *mdata = ctl->mdata;

	if ((ctl->prg_fet + pinfo->lcdc.v_back_porch +
	if ((pinfo->prg_fet + pinfo->lcdc.v_back_porch +
			pinfo->lcdc.v_pulse_width) > mdata->min_prefill_lines) {
		ctl->disable_prefill = true;
		pr_debug("disable prefill vbp:%d vpw:%d prg_fet:%d\n",
			pinfo->lcdc.v_back_porch, pinfo->lcdc.v_pulse_width,
			ctl->prg_fet);
			pinfo->prg_fet);
	}
}

@@ -1171,8 +1171,8 @@ static void mdss_mdp_fetch_start_config(struct mdss_mdp_video_ctx *ctx,

	mdata = ctl->mdata;

	ctl->prg_fet = mdss_mdp_get_prefetch_lines(ctl);
	if (!ctl->prg_fet) {
	pinfo->prg_fet = mdss_mdp_get_prefetch_lines(ctl);
	if (!pinfo->prg_fet) {
		pr_debug("programmable fetch is not needed/supported\n");
		return;
	}
@@ -1184,7 +1184,7 @@ static void mdss_mdp_fetch_start_config(struct mdss_mdp_video_ctx *ctx,
	v_total = mdss_panel_get_vtotal(pinfo);
	h_total = mdss_panel_get_htotal(pinfo, true);

	fetch_start = (v_total - ctl->prg_fet) * h_total + 1;
	fetch_start = (v_total - pinfo->prg_fet) * h_total + 1;
	fetch_enable = BIT(31);

	if (pinfo->dynamic_fps && (pinfo->dfps_update ==
@@ -1192,7 +1192,7 @@ static void mdss_mdp_fetch_start_config(struct mdss_mdp_video_ctx *ctx,
		fetch_enable |= BIT(23);

	pr_debug("ctl:%d fetch_start:%d lines:%d\n",
		ctl->num, fetch_start, ctl->prg_fet);
		ctl->num, fetch_start, pinfo->prg_fet);

	mdp_video_write(ctx, MDSS_MDP_REG_INTF_PROG_FETCH_START, fetch_start);
	mdp_video_write(ctx, MDSS_MDP_REG_INTF_CONFIG, fetch_enable);
@@ -1245,8 +1245,9 @@ static int mdss_mdp_video_cdm_setup(struct mdss_mdp_cdm *cdm,
static void mdss_mdp_handoff_programmable_fetch(struct mdss_mdp_ctl *ctl,
	struct mdss_mdp_video_ctx *ctx)
{
	struct mdss_panel_info *pinfo = &ctl->panel_data->panel_info;
	u32 fetch_start_handoff, v_total_handoff, h_total_handoff;
	ctl->prg_fet = 0;
	pinfo->prg_fet = 0;
	if (mdp_video_read(ctx, MDSS_MDP_REG_INTF_CONFIG) & BIT(31)) {
		fetch_start_handoff = mdp_video_read(ctx,
			MDSS_MDP_REG_INTF_PROG_FETCH_START);
@@ -1254,10 +1255,10 @@ static void mdss_mdp_handoff_programmable_fetch(struct mdss_mdp_ctl *ctl,
			MDSS_MDP_REG_INTF_HSYNC_CTL) >> 16;
		v_total_handoff = mdp_video_read(ctx,
			MDSS_MDP_REG_INTF_VSYNC_PERIOD_F0)/h_total_handoff;
		ctl->prg_fet = v_total_handoff -
		pinfo->prg_fet = v_total_handoff -
			((fetch_start_handoff - 1)/h_total_handoff);
		pr_debug("programmable fetch lines %d start:%d\n",
			ctl->prg_fet, fetch_start_handoff);
			pinfo->prg_fet, fetch_start_handoff);
	}
}

+1 −0
Original line number Diff line number Diff line
@@ -516,6 +516,7 @@ struct mdss_panel_info {
	u32 min_height;
	u32 min_fps;
	u32 max_fps;
	u32 prg_fet;

	u32 cont_splash_enabled;
	bool esd_rdy;