gpu: nvgpu: Use cached VF table for target voltage instead of RPC

Nvgpu uses RPC to get target voltage for a freq, though this gets
the latest Voltage, there could be mismatch b/w data in nvgpu & PMU.
To make it consistent, use the local VF table for getting the voltage.
Also the slave ratio calculation is inaccurate due to quantization.
So instead of calculating, use the slave ratio from parsed vbios table.

Bug 200545403

Change-Id: Ibb064f2a0f5eba77166e2b3f9868da9e3fcc7193
Signed-off-by: Abdul Salam <absalam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2183546
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Abdul Salam
2019-08-26 14:55:33 +05:30
committed by mobile promotions
parent 2272e04861
commit 3ee12f5370
4 changed files with 29 additions and 24 deletions

View File

@@ -59,7 +59,7 @@ static int getslaveclk_prog_1x_master(struct gk20a *g,
struct clk_prog_1x_master *p1xmaster,
u8 slave_clk_domain,
u16 *pclkmhz,
u16 masterclkmhz);
u16 masterclkmhz, u8 *ratio);
static int _clk_progs_pmudatainit(struct gk20a *g,
struct boardobjgrp *pboardobjgrp,
@@ -1298,7 +1298,7 @@ done:
static int getslaveclk_prog_1x_master(struct gk20a *g,
struct nvgpu_clk_pmupstate *pclk,
struct clk_prog_1x_master *p1xmaster,
u8 slave_clk_domain, u16 *pclkmhz, u16 masterclkmhz
u8 slave_clk_domain, u16 *pclkmhz, u16 masterclkmhz, u8 *ratio
)
{
struct nvgpu_clk_progs *pclkprogobjs;
@@ -1362,6 +1362,7 @@ static int getslaveclk_prog_1x_master(struct gk20a *g,
*pclkmhz = (masterclkmhz * pslaveents->ratio)/100U;
/* Floor/Quantize all the slave clocks to the multiple of step size*/
*pclkmhz = (*pclkmhz / FREQ_STEP_SIZE_MHZ) * FREQ_STEP_SIZE_MHZ;
*ratio = pslaveents->ratio;
} else {
/* only support ratio for now */
return -EINVAL;