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

Commit 4a85d315 authored by Satya Rama Aditya Pinapala's avatar Satya Rama Aditya Pinapala
Browse files

disp: msm: dsi: Fix porch calculation issue for constant fps



For constant fps feature, porch is calculated based on supported
clk rates. Currently, data type of local variables used for porch
calculation is u32 which leads to incorrect porch calculation for
higher clk rates. So, update the data type to u64.

Change-Id: I8eb04487d1dcce05989448c0b063e56752af412b
Signed-off-by: default avatarLipsa Rout <lrout@codeaurora.org>
Signed-off-by: default avatarRitesh Kumar <riteshk@codeaurora.org>
Signed-off-by: default avatarSatya Rama Aditya Pinapala <psraditya30@codeaurora.org>
parent 10fde7ee
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -5931,7 +5931,7 @@ void dsi_display_adjust_mode_timing(
			struct dsi_display_mode *dsi_mode,
			int lanes, int bpp)
{
	u32 new_htotal, new_vtotal, htotal, vtotal, old_htotal;
	u64 new_htotal, new_vtotal, htotal, vtotal, old_htotal, div;

	if (!dyn_clk_caps->maintain_const_fps)
		return;
@@ -5946,8 +5946,9 @@ void dsi_display_adjust_mode_timing(
	case DSI_DYN_CLK_TYPE_CONST_FPS_ADJUST_HFP:
		vtotal = DSI_V_TOTAL(&dsi_mode->timing);
		old_htotal = dsi_h_total_dce(&dsi_mode->timing);
		new_htotal = (dsi_mode->timing.clk_rate_hz * lanes);
		new_htotal /= (bpp * vtotal * dsi_mode->timing.refresh_rate);
		new_htotal = dsi_mode->timing.clk_rate_hz * lanes;
		div = bpp * vtotal * dsi_mode->timing.refresh_rate;
		do_div(new_htotal, div);
		if (old_htotal > new_htotal)
			dsi_mode->timing.h_front_porch -=
					(old_htotal - new_htotal);
@@ -5958,8 +5959,9 @@ void dsi_display_adjust_mode_timing(

	case DSI_DYN_CLK_TYPE_CONST_FPS_ADJUST_VFP:
		htotal = dsi_h_total_dce(&dsi_mode->timing);
		new_vtotal = (dsi_mode->timing.clk_rate_hz * lanes);
		new_vtotal /= (bpp * htotal * dsi_mode->timing.refresh_rate);
		new_vtotal = dsi_mode->timing.clk_rate_hz * lanes;
		div = bpp * htotal * dsi_mode->timing.refresh_rate;
		do_div(new_vtotal, div);
		dsi_mode->timing.v_front_porch = new_vtotal -
				dsi_mode->timing.v_back_porch -
				dsi_mode->timing.v_sync_width -