summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c
diff options
context:
space:
mode:
authorArchit Taneja2016-06-15 14:34:31 +0200
committerRob Clark2016-07-16 16:08:58 +0200
commitcd79272696ef21fb03d8b140c4530ac6b049e417 (patch)
treed818d621336badc9d9bac431b5a252e6602ec0ec /drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c
parentdrm/msm/mdp5: Update the register offsets of MDP5 sub-blocks (diff)
downloadkernel-qcow2-linux-cd79272696ef21fb03d8b140c4530ac6b049e417.tar.gz
kernel-qcow2-linux-cd79272696ef21fb03d8b140c4530ac6b049e417.tar.xz
kernel-qcow2-linux-cd79272696ef21fb03d8b140c4530ac6b049e417.zip
drm/msm: Call pm_runtime_enable/disable for newly created devices
With the new device hierarchy for MDP5, we need to enable runtime PM for both the toplevel MDSS device and the MDP5 device itself. Enable runtime PM for the new devices. Since MDP4 and MDP5 now have different places where runtime PM is enabled, remove the previous pm_runtime_enable/disable calls, and squash them in the respective kms drivers. The new device hierarchy (as expressed in the DT bindings) has the GDSC tied only to the MDSS wrapper device. This GDSC needs to be enabled for accessing any register in the MDSS sub-blocks. Once every driver is runtime adapted, the GDSC will be enabled when any sub-block device calls runtime_get because of the parent-child relationship with MDSS. Until then, we call pm_runtime_get_sync() once for the MDSS device to ensure the GDSC is never disabled. This will be removed once all the drivers are runtime PM adapted. The error handling paths become a bit tricky when we call these runtime PM funcs. There doesn't seem to be any helper that checks if runtime PM is enabled already. Add bool variables in mdp4_kms/mdp5_kms structs to check if the driver had managed to call pm_runtime_enable before bailing out. Signed-off-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c')
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c
index 871c4424a820..d444a6901fff 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c
@@ -152,6 +152,10 @@ void msm_mdss_destroy(struct drm_device *dev)
mdss->irqcontroller.domain = NULL;
regulator_disable(mdss->vdd);
+
+ pm_runtime_put_sync(dev->dev);
+
+ pm_runtime_disable(dev->dev);
}
int msm_mdss_init(struct drm_device *dev)
@@ -215,6 +219,14 @@ int msm_mdss_init(struct drm_device *dev)
priv->mdss = mdss;
+ pm_runtime_enable(dev->dev);
+
+ /*
+ * TODO: This is needed as the MDSS GDSC is only tied to MDSS's power
+ * domain. Remove this once runtime PM is adapted for all the devices.
+ */
+ pm_runtime_get_sync(dev->dev);
+
return 0;
fail_irq:
regulator_disable(mdss->vdd);