msm: kgsl: Set bus scaling function during gmu probe

When setting the bus scaling function, we are checking for gmu
based targets before gmu has probed. Simplify this by setting the
bus scaling function to interconnect by default. Then, replace
it with gmu based routine during gmu probe. This works because
only gmu based targets set bus votes via gmu.

Change-Id: Ib332e736b39e0f38b1028049422ba95bd0370839
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
This commit is contained in:
Harshdeep Dhatt 2020-02-12 17:05:18 -07:00
commit be60d9a000
2 changed files with 18 additions and 18 deletions

View file

@ -10,20 +10,6 @@
#include "kgsl_device.h"
#include "kgsl_trace.h"
static int gmu_bus_set(struct kgsl_device *device, int buslevel,
u32 ab)
{
struct kgsl_pwrctrl *pwr = &device->pwrctrl;
int ret;
ret = gmu_core_dcvs_set(device, INVALID_DCVS_IDX, buslevel);
if (!ret)
icc_set_bw(pwr->icc_path, MBps_to_icc(ab), 0);
return ret;
}
static int interconnect_bus_set(struct kgsl_device *device, int level,
u32 ab)
{
@ -179,10 +165,7 @@ done:
return PTR_ERR(pwr->icc_path);
}
if (gmu_core_scales_bandwidth(device))
pwr->bus_set = gmu_bus_set;
else
pwr->bus_set = interconnect_bus_set;
pwr->bus_set = interconnect_bus_set;
return 0;
}

View file

@ -1282,6 +1282,20 @@ static void gmu_acd_probe(struct kgsl_device *device, struct gmu_device *gmu,
"AOP mailbox init failed: %d\n", ret);
}
static int gmu_bus_set(struct kgsl_device *device, int buslevel,
u32 ab)
{
struct kgsl_pwrctrl *pwr = &device->pwrctrl;
int ret;
ret = gmu_core_dcvs_set(device, INVALID_DCVS_IDX, buslevel);
if (!ret)
icc_set_bw(pwr->icc_path, MBps_to_icc(ab), 0);
return ret;
}
/* Do not access any GMU registers in GMU probe function */
static int gmu_probe(struct kgsl_device *device, struct device_node *node)
{
@ -1409,6 +1423,9 @@ static int gmu_probe(struct kgsl_device *device, struct device_node *node)
gmu_acd_probe(device, gmu, node);
if (gmu_core_scales_bandwidth(device))
pwr->bus_set = gmu_bus_set;
set_bit(GMU_ENABLED, &device->gmu_core.flags);
device->gmu_core.dev_ops = &adreno_a6xx_gmudev;