summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-12-15 14:14:37 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-12-15 14:14:37 -0800
commit89db7216b2f5dfd362c44d7187842705ee708a0d (patch)
treead7e6f1b87530d1c23dda27ea7ac97b2e9f5ea64 /drivers
parent62d6ead3eea571f6b1fb426448be4262c7c30188 (diff)
parent8ec33ac38f0bc3cc66c1a641f0e2c81661d61de9 (diff)
Merge "drm/msm: Correctly retrieve gpu's active power level"
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 8986ba6c110b..16b10b608855 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -397,14 +397,6 @@ static int _adreno_get_pwrlevels(struct msm_gpu *gpu, struct device_node *node)
{
struct device_node *child;
- gpu->active_level = 1;
-
- /* The device tree will tell us the best clock to initialize with */
- of_property_read_u32(node, "qcom,initial-pwrlevel", &gpu->active_level);
-
- if (gpu->active_level >= ARRAY_SIZE(gpu->gpufreq))
- gpu->active_level = 1;
-
for_each_child_of_node(node, child) {
unsigned int index;
@@ -453,6 +445,15 @@ static int adreno_get_pwrlevels(struct msm_gpu *gpu, struct device_node *parent)
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
struct device_node *node, *child;
+ gpu->active_level = 1;
+
+ /* The device tree will tell us the best clock to initialize with */
+ of_property_read_u32(parent, "qcom,initial-pwrlevel",
+ &gpu->active_level);
+
+ if (gpu->active_level >= ARRAY_SIZE(gpu->gpufreq))
+ gpu->active_level = 1;
+
/* See if the target has defined a number of power bins */
node = of_find_node_by_name(parent, "qcom,gpu-pwrlevel-bins");
if (!node) {