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

Commit 32b00d9d authored by Huijuan Xie's avatar Huijuan Xie Committed by huijuan.xie
Browse files

[ALPS08848700] drm: dsi: Support dynamic fps by sendng CMD in VFP



[Description]
Some panel need send command in VFP when switch fps.
Add code flow to support this feature

[Test]
Test ok

MTK-Commit-Id: 4ad53138820a8e06c8c58e076999118e474b3c71

Signed-off-by: default avatarHuijuan Xie <huijuan.xie@mediatek.com>
CR-Id: ALPS08848700
Feature: Always On Display
Change-Id: I243e4b8a5d78e13ef30ec8643df00fbe6d82ca33
parent 786b2f77
Loading
Loading
Loading
Loading
+49 −0
Original line number Original line Diff line number Diff line
@@ -9834,6 +9834,38 @@ static void mtk_dsi_vdo_timing_change(struct mtk_dsi *dsi,
			return;
			return;
		}
		}


		if (dsi && dsi->ext && dsi->ext->params
			&& dsi->ext->params->change_fps_by_vfp_send_cmd) {
			/*wait and clear EOF
			 * avoid other display related task break fps change task
			 * because fps change need stop & re-start vdo mode
			 */
			cmdq_pkt_wfe(handle,
				     mtk_crtc->gce_obj.event[EVENT_CMD_EOF]);
			/*1.1 send cmd: stop vdo mode*/
			mtk_dsi_stop_vdo_mode(dsi, handle);
			/* for crtc first enable,dyn fps fail*/
			if (dsi->data_rate == 0) {
				dsi->data_rate = mtk_dsi_default_rate(dsi);
				mtk_mipi_tx_pll_rate_set_adpt(dsi->phy, dsi->data_rate);
				if (dsi->ext->params->data_rate_khz)
					mtk_mipi_tx_pll_rate_khz_set_adpt(dsi->phy,
						dsi->ext->params->data_rate_khz);
				if (dsi->slave_dsi) {
					dsi->slave_dsi->data_rate = dsi->data_rate;
					mtk_mipi_tx_pll_rate_set_adpt(dsi->slave_dsi->phy, dsi->data_rate);
					if (dsi->ext->params->data_rate_khz)
						mtk_mipi_tx_pll_rate_khz_set_adpt(dsi->slave_dsi->phy,
							dsi->ext->params->data_rate_khz);
				}
				if (dsi->data_rate) {
					mtk_dsi_phy_timconfig(dsi, NULL);
					if (dsi->slave_dsi)
						mtk_dsi_phy_timconfig(dsi->slave_dsi, NULL);
				}
			}
		}

		if (dsi->mipi_hopping_sta && dsi->ext) {
		if (dsi->mipi_hopping_sta && dsi->ext) {
			DDPINFO("%s,mipi_clk_change_sta\n", __func__);
			DDPINFO("%s,mipi_clk_change_sta\n", __func__);
			vfp = dsi->ext->params->dyn.vfp;
			vfp = dsi->ext->params->dyn.vfp;
@@ -9874,6 +9906,23 @@ static void mtk_dsi_vdo_timing_change(struct mtk_dsi *dsi,
		if (dsi->slave_dsi)
		if (dsi->slave_dsi)
			mtk_dsi_porch_setting(&dsi->slave_dsi->ddp_comp,
			mtk_dsi_porch_setting(&dsi->slave_dsi->ddp_comp,
						handle, DSI_VFP, vfp);
						handle, DSI_VFP, vfp);

		if (dsi && dsi->ext && dsi->ext->params
			&& dsi->ext->params->change_fps_by_vfp_send_cmd) {
			/*1.2 send cmd: send cmd*/
			mtk_dsi_send_switch_cmd(dsi, handle, mtk_crtc, src_mode,
						drm_mode_vrefresh(&adjusted_mode));
			/*1.3 send cmd: start vdo mode*/
			mtk_dsi_start_vdo_mode(comp, handle);
			/*clear EOF
			 * avoid config continue after we trigger vdo mode
			 */
			cmdq_pkt_clear_event(handle,
				     mtk_crtc->gce_obj.event[EVENT_CMD_EOF]);
			/*1.4 send cmd: trigger*/
			mtk_disp_mutex_trigger(comp->mtk_crtc->mutex[0], handle);
			mtk_dsi_trigger(comp, handle);
		}
	}
	}


	if (mtk_crtc->qos_ctx)
	if (mtk_crtc->qos_ctx)
+1 −0
Original line number Original line Diff line number Diff line
@@ -501,6 +501,7 @@ struct mtk_panel_params {
	unsigned int data_rate;
	unsigned int data_rate;
	unsigned int data_rate_khz;
	unsigned int data_rate_khz;
	unsigned int vdo_per_frame_lp_enable; /* Enable video mode per frame lp */
	unsigned int vdo_per_frame_lp_enable; /* Enable video mode per frame lp */
	unsigned int change_fps_by_vfp_send_cmd;
	struct mtk_dsi_phy_timcon phy_timcon;
	struct mtk_dsi_phy_timcon phy_timcon;
	unsigned int vfp_low_power;
	unsigned int vfp_low_power;
	struct dynamic_mipi_params dyn;
	struct dynamic_mipi_params dyn;