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

Commit 6909fa94 authored by Padmanabhan Komanduru's avatar Padmanabhan Komanduru Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: featurize bus bandwidth vote required during IOMMU attach



On certain chipsets, MDSS need to have SYS_MM_NOC clock enabled to be
able to perform IOMMU transactions. IOMMU driver will not vote for
bandwidth since it is tied to SYS_NOC and not SYS_MM_NOC. This needs
some minimum bandwidth vote from MDSS side. Add a DT property to enable
featurization of this.

Change-Id: I4b6b2b946080019f3f803c96c7a1b31759aa9020
Signed-off-by: default avatarPadmanabhan Komanduru <pkomandu@codeaurora.org>
parent de4207a8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -511,6 +511,9 @@ Subnode properties:
- qcom,boot-indication-enabled: Boolean property that enables turning on the blue
				LED for notifying that the device is in boot
				process.
- qcom,mdss-needs-iommu-bw-vote: Boolean property to indicate if minimum bus
				bandwidth vote is needed for MDSS to perform
				IOMMU transactions.

Example:
	mdss_mdp: qcom,mdss_mdp@fd900000 {
@@ -643,6 +646,7 @@ Example:
		qcom,mdss-prefill-pingpong-buffer-pixels = <5120>;
		qcom,mdss-prefill-fbc-lines = <2>;
		qcom,mdss-idle-power-collapse-enabled;
		qcom,mdss-needs-iommu-bw-vote;

		mdss_fb0: qcom,mdss_fb_primary {
			cell-index = <0>;
+1 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ struct mdss_data_type {
	u8 has_non_scalar_rgb;
	bool has_src_split;
	bool idle_pc_enabled;
	bool needs_iommu_bw_vote;
	bool has_pingpong_split;
	bool has_pixel_ram;
	bool needs_hist_vote;
+10 −2
Original line number Diff line number Diff line
@@ -673,7 +673,9 @@ int mdss_iommu_ctrl(int enable)

	if (enable) {
		if (mdata->iommu_ref_cnt == 0) {
			mdss_bus_scale_set_quota(MDSS_HW_IOMMU, SZ_1M, SZ_1M);
			if (mdata->needs_iommu_bw_vote)
				mdss_bus_scale_set_quota(MDSS_HW_IOMMU,
					SZ_1M, SZ_1M);
			rc = mdss_iommu_attach(mdata);
		}
		mdata->iommu_ref_cnt++;
@@ -682,7 +684,9 @@ int mdss_iommu_ctrl(int enable)
			mdata->iommu_ref_cnt--;
			if (mdata->iommu_ref_cnt == 0) {
				rc = mdss_iommu_dettach(mdata);
				mdss_bus_scale_set_quota(MDSS_HW_IOMMU, 0, 0);
				if (mdata->needs_iommu_bw_vote)
					mdss_bus_scale_set_quota(MDSS_HW_IOMMU,
						0, 0);
			}
		} else {
			pr_err("unbalanced iommu ref\n");
@@ -1245,6 +1249,10 @@ static u32 mdss_mdp_res_init(struct mdss_data_type *mdata)
		mdata->iclient = NULL;
	}

	mdata->needs_iommu_bw_vote =
			of_property_read_bool(mdata->pdev->dev.of_node,
			 "qcom,mdss-needs-iommu-bw-vote");

	rc = mdss_iommu_init(mdata);

	return rc;