summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSharat Masetty <smasetty@codeaurora.org>2017-08-17 11:20:48 +0530
committerSharat Masetty <smasetty@codeaurora.org>2017-08-18 10:49:54 +0530
commitdb67d1e70d564a932ed326e89ababf12449f9049 (patch)
tree79605c08385c04f5c4ec659229b9b057b04518e5
parent93f66037edbc5135becbb961e96131e3febf2708 (diff)
drm/msm: Disable clocks when GPU is inactive
This patch addresses an issue in the GPU init sequence where the clocks are turned on during the process but after the init is complete the clocks are not turned off. Due to this, the GPU clocks always have a refcount delta of 1 and never get disabled later even when explicitly requested. Change-Id: I40fa9a25cd86f5d39fbe6f6e3f83d6ab467d615f Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 9320437e923d..29834b1a36fb 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -863,7 +863,14 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
gpu->dev = drm;
gpu->funcs = funcs;
gpu->name = name;
- gpu->inactive = true;
+ /*
+ * Set the inactive flag to false, so that when the retire worker
+ * kicks in from the init path, it knows that it has to turn off the
+ * clocks. This should be fine to do since this is the init sequence
+ * and we have an init_lock in msm_open() to protect against bad things
+ * from happening.
+ */
+ gpu->inactive = false;
INIT_LIST_HEAD(&gpu->active_list);
INIT_WORK(&gpu->retire_work, retire_worker);