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

Commit 60c2506c authored by Dhaval Patel's avatar Dhaval Patel Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: keep minimum bus vote during client enable



Keep minimum bus vote during client enable instead
of 20M during parsing. This minimum bw votes keeps
refcount on MNOC GDSC and allows to turn on MDP
GDSC after it.

Change-Id: I0d09e1815b30bfa3d7080bb8c2bfc103826a2c48
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent b2941e2e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1692,11 +1692,11 @@ static void sde_crtc_install_properties(struct drm_crtc *crtc,
			CRTC_PROP_CORE_CLK);
	msm_property_install_range(&sde_crtc->property_info,
			"core_ab", 0x0, 0, U64_MAX,
			SDE_POWER_HANDLE_DATA_BUS_AB_QUOTA,
			SDE_POWER_HANDLE_ENABLE_BUS_AB_QUOTA,
			CRTC_PROP_CORE_AB);
	msm_property_install_range(&sde_crtc->property_info,
			"core_ib", 0x0, 0, U64_MAX,
			SDE_POWER_HANDLE_DATA_BUS_IB_QUOTA,
			SDE_POWER_HANDLE_ENABLE_BUS_IB_QUOTA,
			CRTC_PROP_CORE_IB);

	msm_property_install_blob(&sde_crtc->property_info, "capabilities",
+42 −12
Original line number Diff line number Diff line
@@ -482,18 +482,6 @@ static int sde_power_data_bus_parse(struct platform_device *pdev,
			goto end;
		}
		pr_debug("register data_bus_hdl=%x\n", pdbus->data_bus_hdl);

		/*
		 * Following call will not result in actual vote rather update
		 * the current index and ab/ib value. When continuous splash
		 * is enabled, actual vote will happen when splash handoff is
		 * done.
		 */
		return _sde_power_data_bus_set_quota(pdbus,
				SDE_POWER_HANDLE_DATA_BUS_AB_QUOTA,
				SDE_POWER_HANDLE_DATA_BUS_AB_QUOTA,
				SDE_POWER_HANDLE_DATA_BUS_IB_QUOTA,
				SDE_POWER_HANDLE_DATA_BUS_IB_QUOTA);
	}

end:
@@ -537,6 +525,31 @@ static void sde_power_reg_bus_unregister(u32 reg_bus_hdl)
		msm_bus_scale_unregister_client(reg_bus_hdl);
}

static int sde_power_data_bus_update(struct sde_power_data_bus_handle *pdbus,
							bool enable)
{
	int rc = 0;
	u64 ab_quota_rt, ab_quota_nrt;
	u64 ib_quota_rt, ib_quota_nrt;

	ab_quota_rt = ab_quota_nrt = enable ?
			SDE_POWER_HANDLE_ENABLE_BUS_AB_QUOTA :
			SDE_POWER_HANDLE_DISABLE_BUS_AB_QUOTA;
	ib_quota_rt = ib_quota_nrt = enable ?
			SDE_POWER_HANDLE_ENABLE_BUS_IB_QUOTA :
			SDE_POWER_HANDLE_DISABLE_BUS_IB_QUOTA;

	if (pdbus->data_bus_hdl)
		rc = _sde_power_data_bus_set_quota(pdbus, ab_quota_rt,
				ab_quota_nrt, ib_quota_rt, ib_quota_nrt);

	if (rc)
		pr_err("failed to set data bus vote rc=%d enable:%d\n",
							rc, enable);

	return rc;
}

static int sde_power_reg_bus_update(u32 reg_bus_hdl, u32 usecase_ndx)
{
	int rc = 0;
@@ -582,6 +595,12 @@ static int sde_power_reg_bus_update(u32 reg_bus_hdl, u32 usecase_ndx)
{
	return 0;
}

static int sde_power_data_bus_update(struct sde_power_data_bus_handle *pdbus,
							bool enable)
{
	return 0;
}
#endif

int sde_power_resource_init(struct platform_device *pdev,
@@ -738,6 +757,13 @@ int sde_power_resource_enable(struct sde_power_handle *phandle,
		goto end;

	if (enable) {
		rc = sde_power_data_bus_update(&phandle->data_bus_handle,
									enable);
		if (rc) {
			pr_err("failed to set data bus vote rc=%d\n", rc);
			goto data_bus_hdl_err;
		}

		rc = msm_dss_enable_vreg(mp->vreg_config, mp->num_vreg, enable);
		if (rc) {
			pr_err("failed to enable vregs rc=%d\n", rc);
@@ -763,6 +789,8 @@ int sde_power_resource_enable(struct sde_power_handle *phandle,
							max_usecase_ndx);

		msm_dss_enable_vreg(mp->vreg_config, mp->num_vreg, enable);

		sde_power_data_bus_update(&phandle->data_bus_handle, enable);
	}

end:
@@ -774,6 +802,8 @@ int sde_power_resource_enable(struct sde_power_handle *phandle,
reg_bus_hdl_err:
	msm_dss_enable_vreg(mp->vreg_config, mp->num_vreg, 0);
vreg_err:
	sde_power_data_bus_update(&phandle->data_bus_handle, 0);
data_bus_hdl_err:
	phandle->current_usecase_ndx = prev_usecase_ndx;
	mutex_unlock(&phandle->phandle_lock);
	return rc;
+4 −2
Original line number Diff line number Diff line
@@ -16,8 +16,10 @@

#define MAX_CLIENT_NAME_LEN 128

#define SDE_POWER_HANDLE_DATA_BUS_IB_QUOTA 2000000000
#define SDE_POWER_HANDLE_DATA_BUS_AB_QUOTA 2000000000
#define SDE_POWER_HANDLE_ENABLE_BUS_AB_QUOTA	64000
#define SDE_POWER_HANDLE_DISABLE_BUS_AB_QUOTA	0
#define SDE_POWER_HANDLE_ENABLE_BUS_IB_QUOTA	64000
#define SDE_POWER_HANDLE_DISABLE_BUS_IB_QUOTA	0

/**
 * mdss_bus_vote_type: register bus vote type