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

Commit 08ce1afe authored by Dhaval Patel's avatar Dhaval Patel
Browse files

drm:msm: add kona sde rsc support



Add kona sde rsc support with backward compatible
support. It updates the kona sde rsc solver state
support for primary command mode display and primary
video mode display. It also updates the mode-2
entry/exit sequence based on HPG update. The change
includes the kona sde rsc sequencer change also.

Change-Id: Ide8126b81ae96aba8f44907fd8e9da1d947c2d64
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 7ef8c71c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ msm_drm-$(CONFIG_DRM_MSM_MDP5) += disp/mdp_format.o \

msm_drm-$(CONFIG_DRM_SDE_RSC) += sde_rsc.o \
	sde_rsc_hw.o \
	sde_rsc_hw_v3.o \

# use drm gpu driver only if qcom_kgsl driver not available
ifneq ($(CONFIG_QCOM_KGSL),y)
+2 −1
Original line number Diff line number Diff line
@@ -1803,7 +1803,8 @@ static int dsi_panel_parse_jitter_config(
				  &priv_info->panel_prefill_lines);
	if (rc) {
		pr_debug("panel prefill lines are not defined rc=%d\n", rc);
		priv_info->panel_prefill_lines = DEFAULT_PANEL_PREFILL_LINES;
		priv_info->panel_prefill_lines = mode->timing.v_back_porch +
			mode->timing.v_sync_width + mode->timing.v_front_porch;
	} else if (priv_info->panel_prefill_lines >=
					DSI_V_TOTAL(&mode->timing)) {
		pr_debug("invalid prefill lines config=%d setting to:%d\n",
+10 −2
Original line number Diff line number Diff line
@@ -700,8 +700,8 @@ void sde_core_perf_crtc_update(struct drm_crtc *crtc,

			/* display rsc override during solver mode */
			if (kms->perf.bw_vote_mode == DISP_RSC_MODE &&
				get_sde_rsc_current_state(SDE_RSC_INDEX) ==
						SDE_RSC_CMD_STATE) {
				get_sde_rsc_current_state(SDE_RSC_INDEX) !=
						SDE_RSC_CLK_STATE) {
				/* update new bandwidth in all cases */
				if (params_changed && ((new->bw_ctl[i] !=
						old->bw_ctl[i]) ||
@@ -754,6 +754,14 @@ void sde_core_perf_crtc_update(struct drm_crtc *crtc,
			_sde_core_perf_crtc_update_bus(kms, crtc, i);
	}

	if (kms->perf.bw_vote_mode == DISP_RSC_MODE &&
	    ((get_sde_rsc_current_state(SDE_RSC_INDEX) != SDE_RSC_CLK_STATE
	      && params_changed) ||
	    (get_sde_rsc_current_state(SDE_RSC_INDEX) == SDE_RSC_CLK_STATE
	      && update_bus)))
		sde_rsc_client_trigger_vote(sde_cstate->rsc_client,
				update_bus ? true : false);

	/*
	 * Update the clock after bandwidth vote to ensure
	 * bandwidth is available before clock rate is increased.
+22 −13
Original line number Diff line number Diff line
@@ -1824,14 +1824,13 @@ static int _sde_encoder_update_rsc_client(
		}
	}

	if (sde_encoder_in_clone_mode(drm_enc))
	if (sde_encoder_in_clone_mode(drm_enc) || !disp_info->is_primary ||
			  (disp_info->is_primary && qsync_mode))
		rsc_state = enable ? SDE_RSC_CLK_STATE : SDE_RSC_IDLE_STATE;
	else
		rsc_state = enable ?
			(((disp_info->capabilities & MSM_DISPLAY_CAP_CMD_MODE)
			  && disp_info->is_primary && !qsync_mode) ?
			 SDE_RSC_CMD_STATE : SDE_RSC_VID_STATE) :
			SDE_RSC_IDLE_STATE;
	else if (disp_info->capabilities & MSM_DISPLAY_CAP_CMD_MODE)
		rsc_state = enable ? SDE_RSC_CMD_STATE : SDE_RSC_IDLE_STATE;
	else if (disp_info->capabilities & MSM_DISPLAY_CAP_VID_MODE)
		rsc_state = enable ? SDE_RSC_VID_STATE : SDE_RSC_IDLE_STATE;

	SDE_EVT32(rsc_state, qsync_mode);

@@ -3097,15 +3096,16 @@ static void sde_encoder_virt_disable(struct drm_encoder *drm_enc)
		input_unregister_handler(sde_enc->input_handler);

	/*
	 * For primary command mode encoders, execute the resource control
	 * pre-stop operations before the physical encoders are disabled, to
	 * allow the rsc to transition its states properly.
	 * For primary command mode and video mode encoders, execute the
	 * resource control pre-stop operations before the physical encoders
	 * are disabled, to allow the rsc to transition its states properly.
	 *
	 * For other encoder types, rsc should not be enabled until after
	 * they have been fully disabled, so delay the pre-stop operations
	 * until after the physical disable calls have returned.
	 */
	if (sde_enc->disp_info.is_primary && intf_mode == INTF_MODE_CMD) {
	if (sde_enc->disp_info.is_primary &&
	    (intf_mode == INTF_MODE_CMD || intf_mode == INTF_MODE_VIDEO)) {
		sde_encoder_resource_control(drm_enc,
				SDE_ENC_RC_EVENT_PRE_STOP);
		for (i = 0; i < sde_enc->num_phys_encs; i++) {
@@ -5065,7 +5065,8 @@ struct drm_encoder *sde_encoder_init(
	struct sde_encoder_virt *sde_enc = NULL;
	int drm_enc_mode = DRM_MODE_ENCODER_NONE;
	char name[SDE_NAME_SIZE];
	int ret = 0;
	int ret = 0, i, intf_index = INTF_MAX;
	struct sde_encoder_phys *phys = NULL;

	sde_enc = kzalloc(sizeof(*sde_enc), GFP_KERNEL);
	if (!sde_enc) {
@@ -5091,9 +5092,17 @@ struct drm_encoder *sde_encoder_init(
		timer_setup(&sde_enc->vsync_event_timer,
				sde_encoder_vsync_event_handler, 0);

	for (i = 0; i < sde_enc->num_phys_encs; i++) {
		phys = sde_enc->phys_encs[i];
		if (!phys)
			continue;
		if (phys->ops.is_master && phys->ops.is_master(phys))
			intf_index = phys->intf_idx - INTF_0;
	}
	snprintf(name, SDE_NAME_SIZE, "rsc_enc%u", drm_enc->base.id);
	sde_enc->rsc_client = sde_rsc_client_create(SDE_RSC_INDEX, name,
					disp_info->is_primary);
		disp_info->is_primary ? SDE_RSC_PRIMARY_DISP_CLIENT :
		SDE_RSC_EXTERNAL_DISP_CLIENT, intf_index);
	if (IS_ERR_OR_NULL(sde_enc->rsc_client)) {
		SDE_DEBUG("sde rsc client create failed :%ld\n",
						PTR_ERR(sde_enc->rsc_client));
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ static inline void sde_power_rsc_client_init(struct sde_power_handle *phandle)
	/* creates the rsc client */
	if (!phandle->rsc_client_init) {
		phandle->rsc_client = sde_rsc_client_create(SDE_RSC_INDEX,
				"sde_power_handle", false);
				"sde_power_handle", SDE_RSC_CLK_CLIENT, 0);
		if (IS_ERR_OR_NULL(phandle->rsc_client)) {
			pr_debug("sde rsc client create failed :%ld\n",
						PTR_ERR(phandle->rsc_client));
Loading