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

Commit c7ae6b5c authored by Justin Philip's avatar Justin Philip
Browse files

msm: mdss: Dynamic FPS using VFP



Using Fixed fps and v_total for BW calculations, it
results in underrun if dynamic fps and v_total is used.
Dynamic FPS change should be Mutex protected for
synchronization between read/write so that multiple
processes don’t change fps at the same time. Line
count should be checked to make sure we have sufficient
lines before we start programming FPS. Do not configure
new fps when vsync timeout happens. Add support for
FIFO empty recovery.

CRs-Fixed: 651333
Change-Id: Icff48a7f85755484a321f0de26d4816f895c367e
Signed-off-by: default avatarJustin Philip <jphili@codeaurora.org>
Signed-off-by: default avatarraghavendra ambadas <rambad@codeaurora.org>
parent cd738d78
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1652,6 +1652,8 @@ int dsi_panel_device_register(struct device_node *pan_node,
		pinfo->new_fps = pinfo->mipi.frame_rate;
	}

	pinfo->panel_max_fps = mdss_panel_get_framerate(pinfo);
	pinfo->panel_max_vtotal = mdss_panel_get_vtotal(pinfo);
	ctrl_pdata->disp_en_gpio = of_get_named_gpio(ctrl_pdev->dev.of_node,
		"qcom,platform-enable-gpio", 0);

+1 −0
Original line number Diff line number Diff line
@@ -257,6 +257,7 @@ enum {

#define DSI_EV_PLL_UNLOCKED		0x0001
#define DSI_EV_MDP_FIFO_UNDERFLOW	0x0002
#define DSI_EV_DSI_FIFO_EMPTY		0x0003
#define DSI_EV_MDP_BUSY_RELEASE		0x80000000

struct mdss_dsi_ctrl_pdata {
+6 −1
Original line number Diff line number Diff line
@@ -1436,6 +1436,9 @@ static int dsi_event_thread(void *data)
			}
		}

		if (todo & DSI_EV_DSI_FIFO_EMPTY)
			mdss_dsi_sw_reset_restore(ctrl);

		if (todo & DSI_EV_MDP_BUSY_RELEASE) {
			spin_lock_irqsave(&ctrl->mdp_lock, flag);
			ctrl->mdp_busy = false;
@@ -1508,7 +1511,7 @@ void mdss_dsi_fifo_status(struct mdss_dsi_ctrl_pdata *ctrl)

	status = MIPI_INP(base + 0x000c);/* DSI_FIFO_STATUS */

	/* fifo underflow, overflow */
	/* fifo underflow, overflow and empty*/
	if (status & 0xcccc4489) {
		MIPI_OUTP(base + 0x000c, status);
		pr_err("%s: status=%x\n", __func__, status);
@@ -1516,6 +1519,8 @@ void mdss_dsi_fifo_status(struct mdss_dsi_ctrl_pdata *ctrl)
			dsi_send_events(ctrl, DSI_EV_MDP_FIFO_UNDERFLOW);
			MDSS_XLOG_TOUT_HANDLER("mdp", "dsi0", "dsi1",
						"edp", "hdmi", "panic");
		if (status & 0x11110000) /* DLN_FIFO_EMPTY */
			dsi_send_events(ctrl, DSI_EV_DSI_FIFO_EMPTY);
	}
}

+1 −0
Original line number Diff line number Diff line
@@ -431,6 +431,7 @@ struct mdss_overlay_private {

	struct mdss_data_type *mdata;
	struct mutex ov_lock;
	struct mutex dfps_lock;
	struct mdss_mdp_ctl *ctl;
	struct mdss_mdp_wb *wb;

+14 −4
Original line number Diff line number Diff line
@@ -391,8 +391,13 @@ int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe,
		struct mdss_panel_info *pinfo;

		pinfo = &mixer->ctl->panel_data->panel_info;
		if (pinfo->type == MIPI_VIDEO_PANEL) {
			fps = pinfo->panel_max_fps;
			v_total = pinfo->panel_max_vtotal;
		} else {
			fps = mdss_panel_get_framerate(pinfo);
			v_total = mdss_panel_get_vtotal(pinfo);
		}
		xres = pinfo->xres;
		is_fbc = pinfo->fbc.enabled;
		h_total = mdss_panel_get_htotal(pinfo, false);
@@ -524,8 +529,13 @@ static void mdss_mdp_perf_calc_mixer(struct mdss_mdp_mixer *mixer,
	if (!mixer->rotator_mode) {
		if (mixer->type == MDSS_MDP_MIXER_TYPE_INTF) {
			pinfo = &mixer->ctl->panel_data->panel_info;
			if (pinfo->type == MIPI_VIDEO_PANEL) {
				fps = pinfo->panel_max_fps;
				v_total = pinfo->panel_max_vtotal;
			} else {
				fps = mdss_panel_get_framerate(pinfo);
				v_total = mdss_panel_get_vtotal(pinfo);
			}

			if (pinfo->type == WRITEBACK_PANEL)
				pinfo = NULL;
Loading