From f44d1a49b99e015ea0b291ed2cdb990c0156ec7b Mon Sep 17 00:00:00 2001 From: Harshdeep Dhatt Date: Tue, 28 Apr 2020 12:00:44 -0700 Subject: [PATCH] msm: kgsl: Fix gpu boot ab vote The ab is in megabytes and ddr_table is in kilobytes. So do the conversion to fix the first ab vote out of slumber. Also fix the ib vote units for the very first gmu boot. Change-Id: I57efd80fa2de8262842475e02a363e0436a7b0f2 Signed-off-by: Harshdeep Dhatt --- drivers/gpu/msm/kgsl_bus.c | 7 +++++-- drivers/gpu/msm/kgsl_gmu.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/msm/kgsl_bus.c b/drivers/gpu/msm/kgsl_bus.c index b79f60a25d64..84d71dfa30ad 100644 --- a/drivers/gpu/msm/kgsl_bus.c +++ b/drivers/gpu/msm/kgsl_bus.c @@ -35,9 +35,12 @@ static u32 _ab_buslevel_update(struct kgsl_pwrctrl *pwr, if (!ib) return 0; - /* In the absence of any other settings, make ab 25% of ib */ + /* + * In the absence of any other settings, make ab 25% of ib + * where the ib vote is in kbps + */ if ((!pwr->bus_percent_ab) && (!pwr->bus_ab_mbytes)) - return 25 * ib / 100; + return 25 * ib / 100000; if (pwr->bus_width) return pwr->bus_ab_mbytes; diff --git a/drivers/gpu/msm/kgsl_gmu.c b/drivers/gpu/msm/kgsl_gmu.c index f5bdf6abfca9..9a833f301da9 100644 --- a/drivers/gpu/msm/kgsl_gmu.c +++ b/drivers/gpu/msm/kgsl_gmu.c @@ -1594,7 +1594,7 @@ static int gmu_start(struct kgsl_device *device) /* Vote for minimal DDR BW for GMU to init */ level = pwr->pwrlevels[pwr->default_pwrlevel].bus_min; icc_set_bw(pwr->icc_path, 0, - MBps_to_icc(pwr->ddr_table[level])); + kBps_to_icc(pwr->ddr_table[level])); ret = gmu_dev_ops->rpmh_gpu_pwrctrl(device, GMU_FW_START, GMU_COLD_BOOT, 0);