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

Commit 7f7cf760 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 64170700 b06d8023
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -5934,7 +5934,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;
@@ -5949,8 +5949,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_DSC(&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);
@@ -5961,8 +5962,9 @@ void dsi_display_adjust_mode_timing(

	case DSI_DYN_CLK_TYPE_CONST_FPS_ADJUST_VFP:
		htotal = DSI_H_TOTAL_DSC(&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 -