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

Commit 58edaf36 authored by Ingrid Gallardo's avatar Ingrid Gallardo Committed by Sandeep Panda
Browse files

msm: mdss: fix frame rate calculation for resolution switch



Current resolution switch calculation is using the wrong
values for the fps calculation.
Correct the values, by using the correct pixel clock
value and adjusting if dsc is enabled as well as
use the default fps, for panels where default frame
rate is not 60.

Change-Id: I4be0a9d5d163b0630e8cfeb930e72c32f487ccb1
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: default avatarSandeep Panda <spanda@codeaurora.org>
parent d3068532
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3370,6 +3370,14 @@ static void mdss_fb_var_to_panelinfo(struct fb_var_screeninfo *var,
		pinfo->clk_rate = var->pixclock;
	else
		pinfo->clk_rate = PICOS2KHZ(var->pixclock) * 1000;

	/*
	 * if it is a DBA panel i.e. HDMI TV connected through
	 * DSI interface, then store the pixel clock value in
	 * DSI specific variable.
	 */
	if (pinfo->is_dba_panel)
		pinfo->mipi.dsi_pclk_rate = pinfo->clk_rate;
}

void mdss_panelinfo_to_fb_var(struct mdss_panel_info *pinfo,
+8 −3
Original line number Diff line number Diff line
@@ -919,12 +919,17 @@ static inline u8 mdss_panel_calc_frame_rate(struct mdss_panel_info *pinfo)
{
		u32 pixel_total = 0;
		u8 frame_rate = 0;
		unsigned long pclk_rate = pinfo->clk_rate;
		unsigned long pclk_rate = pinfo->mipi.dsi_pclk_rate;
		u32 xres;

		xres = pinfo->xres;
		if (pinfo->compression_mode == COMPRESSION_DSC)
			xres /= 3;

		pixel_total = (pinfo->lcdc.h_back_porch +
			  pinfo->lcdc.h_front_porch +
			  pinfo->lcdc.h_pulse_width +
			  pinfo->xres) *
			  xres) *
			 (pinfo->lcdc.v_back_porch +
			  pinfo->lcdc.v_front_porch +
			  pinfo->lcdc.v_pulse_width +
@@ -934,7 +939,7 @@ static inline u8 mdss_panel_calc_frame_rate(struct mdss_panel_info *pinfo)
			frame_rate =
				DIV_ROUND_CLOSEST(pclk_rate, pixel_total);
		else
			frame_rate = DEFAULT_FRAME_RATE;
			frame_rate = pinfo->panel_max_fps;

		return frame_rate;
}