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

Commit 409b52ab authored by Ingrid Gallardo's avatar Ingrid Gallardo
Browse files

msm: mdss: prevent power off iommu if handoff is still pending



When continuous splash handoff is still pending, is not
needed to enable/release the iommu, since clocks and iommu
are already refcounted and enabled.
Add a check so by the time that aplash screen is still
on-going, we do not release the iommu.

Change-Id: I5ea948b2997aeac594f933ddca1096b755473884
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent 16fffd7a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -736,8 +736,9 @@ int mdss_iommu_ctrl(int enable)
	int rc = 0;

	mutex_lock(&mdp_iommu_lock);
	pr_debug("%pS: enable %d mdata->iommu_ref_cnt %d\n",
		__builtin_return_address(0), enable, mdata->iommu_ref_cnt);
	pr_debug("%pS: enable:%d ref_cnt:%d attach:%d hoff:%d\n",
		__builtin_return_address(0), enable, mdata->iommu_ref_cnt,
		mdata->iommu_attached, mdata->handoff_pending);

	if (enable) {
		/*
+2 −5
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ static int mdss_smmu_attach_v2(struct mdss_data_type *mdata)
			}
		} else {
			pr_err("iommu device not attached for domain[%d]\n", i);
			goto err;
			return -ENODEV;
		}
	}
	return 0;
@@ -210,18 +210,15 @@ static int mdss_smmu_detach_v2(struct mdss_data_type *mdata)
{
	struct mdss_smmu_client *mdss_smmu;
	int i;
	struct dss_module_power *mp;

	for (i = 0; i < MDSS_IOMMU_MAX_DOMAIN; i++) {
		if (!mdss_smmu_is_valid_domain_type(mdata, i))
			continue;

		mdss_smmu = mdss_smmu_get_cb(i);
		if (mdss_smmu->dev) {
			mp = &mdss_smmu->mp;
		if (mdss_smmu->dev && !mdss_smmu->handoff_pending)
			mdss_smmu_enable_power(mdss_smmu, false);
	}
	}
	return 0;
}