From ed2f52f863ba21967a99bea023bce6b6883c42dc Mon Sep 17 00:00:00 2001 From: Dhaval Patel Date: Mon, 8 Jun 2015 17:22:24 -0700 Subject: [PATCH] mdss: mdp: fix smmu power rail handoff configuration mdss smmu driver turns on the power rail during probe and leave it on for continuous splash screen scenario. It avoids extra refcount during attach for this scenario by relaying on MDP handoff status. However, MDP handoff status is updated before context banks are attached for video mode panel. This adds extra refcount to power rails and leave them on always. This fix moves the power rail handoff to smmu structure instead of relying on MDP status. Change-Id: Ifc98c0e3812c7b78224f0167886dcb49dba3b267 Signed-off-by: Dhaval Patel --- drivers/video/fbdev/msm/mdss.h | 1 + drivers/video/fbdev/msm/mdss_smmu.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/msm/mdss.h b/drivers/video/fbdev/msm/mdss.h index fbaa083ba06b..975018ad5965 100644 --- a/drivers/video/fbdev/msm/mdss.h +++ b/drivers/video/fbdev/msm/mdss.h @@ -181,6 +181,7 @@ struct mdss_smmu_client { struct dma_iommu_mapping *mmu_mapping; struct dss_module_power mp; bool domain_attached; + bool handoff_pending; }; struct mdss_data_type; diff --git a/drivers/video/fbdev/msm/mdss_smmu.c b/drivers/video/fbdev/msm/mdss_smmu.c index 6f2d34aff5cb..51afa03c8bbf 100644 --- a/drivers/video/fbdev/msm/mdss_smmu.c +++ b/drivers/video/fbdev/msm/mdss_smmu.c @@ -152,7 +152,7 @@ static int mdss_smmu_attach_v2(struct mdss_data_type *mdata) mdss_smmu = mdss_smmu_get_cb(i); if (mdss_smmu->dev) { mp = &mdss_smmu->mp; - if (!mdata->handoff_pending) { + if (!mdss_smmu->handoff_pending) { rc = mdss_smmu_enable_power(mp, true); if (rc) { pr_err("power enable failed - domain:[%d] rc:%d\n", @@ -160,6 +160,7 @@ static int mdss_smmu_attach_v2(struct mdss_data_type *mdata) goto err; } } + mdss_smmu->handoff_pending = false; if (!mdss_smmu->domain_attached) { rc = arm_iommu_attach_device(mdss_smmu->dev, @@ -598,6 +599,8 @@ int mdss_smmu_probe(struct platform_device *pdev) if (!mdata->handoff_pending) mdss_smmu_enable_power(mp, false); + else + mdss_smmu->handoff_pending = true; mdss_smmu->dev = dev; pr_info("iommu v2 domain[%d] mapping and clk register successful!\n",