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

Commit 928820f9 authored by Siddhartha Agrawal's avatar Siddhartha Agrawal
Browse files

msm: mdss: Correctly calculate DSI clocks if fbc is enabled



In cases where frame-buffer compression(fbc) is enabled, the
compressed ratio for xres isn't considered. Add logic to correctly
account for fbc when needed.

Change-Id: I0eec90cbbe0a0ffaea94cf1c2d6231e6545403b6
Signed-off-by: default avatarSiddhartha Agrawal <agrawals@codeaurora.org>
parent ee6fa243
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -855,7 +855,7 @@ static int mdss_dsi_dfps_config(struct mdss_panel_data *pdata, int new_fps)
			vsync_period =
				mdss_panel_get_vtotal(&pdata->panel_info);
			hsync_period =
				mdss_panel_get_htotal(&pdata->panel_info);
				mdss_panel_get_htotal(&pdata->panel_info, true);
			current_dsi_v_total =
				MIPI_INP((ctrl_pdata->ctrl_base) + 0x2C);
			new_dsi_v_total =
+1 −1
Original line number Diff line number Diff line
@@ -333,7 +333,7 @@ int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe,
		v_total = mdss_panel_get_vtotal(pinfo);
		xres = pinfo->xres;
		is_fbc = pinfo->fbc.enabled;
		h_total = mdss_panel_get_htotal(pinfo);
		h_total = mdss_panel_get_htotal(pinfo, false);
	} else {
		v_total = mixer->height;
		xres = mixer->width;
+2 −2
Original line number Diff line number Diff line
@@ -493,7 +493,7 @@ static int mdss_mdp_video_vfp_fps_update(struct mdss_mdp_ctl *ctl, int new_fps)
	}

	vsync_period = mdss_panel_get_vtotal(&pdata->panel_info);
	hsync_period = mdss_panel_get_htotal(&pdata->panel_info);
	hsync_period = mdss_panel_get_htotal(&pdata->panel_info, true);
	curr_fps = mdss_panel_get_framerate(&pdata->panel_info);

	if (curr_fps > new_fps) {
@@ -555,7 +555,7 @@ static int mdss_mdp_video_config_fps(struct mdss_mdp_ctl *ctl,
	}

	vsync_period = mdss_panel_get_vtotal(&pdata->panel_info);
	hsync_period = mdss_panel_get_htotal(&pdata->panel_info);
	hsync_period = mdss_panel_get_htotal(&pdata->panel_info, true);

	if (pdata->panel_info.dfps_update
			!= DFPS_SUSPEND_RESUME_MODE) {
+15 −5
Original line number Diff line number Diff line
@@ -421,13 +421,23 @@ static inline int mdss_panel_get_vtotal(struct mdss_panel_info *pinfo)
/*
 * mdss_panel_get_htotal() - return panel horizontal width
 * @pinfo:	Pointer to panel info containing all panel information
 * @consider_fbc: true to factor fbc settings, false to ignore.
 *
 * Returns the total width of the panel including any blanking regions
 * which are not visible to user but used for calculations.
 * which are not visible to user but used for calculations. For certain
 * usescases where the fbc parameters need to be ignored like bandwidth
 * calculation, the appropriate flag can be passed.
 */
static inline int mdss_panel_get_htotal(struct mdss_panel_info *pinfo)
static inline int mdss_panel_get_htotal(struct mdss_panel_info *pinfo, bool
		consider_fbc)
{
	return pinfo->xres + pinfo->lcdc.h_back_porch +
	int adj_xres = pinfo->xres;

	if (consider_fbc && pinfo->fbc.enabled)
		adj_xres = mult_frac(pinfo->xres,
				pinfo->fbc.target_bpp, pinfo->bpp);

	return adj_xres + pinfo->lcdc.h_back_porch +
		pinfo->lcdc.h_front_porch +
		pinfo->lcdc.h_pulse_width;
}
+1 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ int mdss_dsi_clk_div_config(struct mdss_panel_info *panel_info,
		break;
	}

	h_period = mdss_panel_get_htotal(panel_info);
	h_period = mdss_panel_get_htotal(panel_info, true);
	v_period = mdss_panel_get_vtotal(panel_info);

	if ((frame_rate !=