diff options
author | Peter Daifuku <pdaifuku@nvidia.com> | 2018-09-27 20:23:37 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-29 02:04:32 -0400 |
commit | 1e125f245e95982d02746aab0fd2b9ea8db009f8 (patch) | |
tree | 4582918af8fbb26c805cb4ad948804f417b38a99 /drivers/gpu/nvgpu/clk/clk_arb.c | |
parent | 82baff9f6f3c7bb242d5378e3118763069460033 (diff) |
gpu: nvgpu: support for clk.measure_freq for igpu
Add support for the measure_freq clock op for igpu:
- add nvgpu_clk_measure_freq(), which in turn calls
the get_rate() clock op.
- Initialize the measure_freq clock op to nvgpu_clk_measure_freq()
for native linux and vgpu.
JIRA ESRM-398
Change-Id: I8a3b2ee79e29e3491a16f55281494f05cd841b07
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1850585
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nirav Patel <nipatel@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk_arb.c')
-rw-r--r-- | drivers/gpu/nvgpu/clk/clk_arb.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c index 3d97535d..6cf005c8 100644 --- a/drivers/gpu/nvgpu/clk/clk_arb.c +++ b/drivers/gpu/nvgpu/clk/clk_arb.c | |||
@@ -1049,6 +1049,20 @@ int nvgpu_clk_arb_get_arbiter_actual_mhz(struct gk20a *g, | |||
1049 | return err; | 1049 | return err; |
1050 | } | 1050 | } |
1051 | 1051 | ||
1052 | unsigned long nvgpu_clk_measure_freq(struct gk20a *g, u32 api_domain) | ||
1053 | { | ||
1054 | unsigned long freq = 0UL; | ||
1055 | |||
1056 | switch (api_domain) { | ||
1057 | case CTRL_CLK_DOMAIN_GPC2CLK: | ||
1058 | freq = g->ops.clk.get_rate(g, CTRL_CLK_DOMAIN_GPCCLK) * 2UL; | ||
1059 | break; | ||
1060 | default: | ||
1061 | break; | ||
1062 | } | ||
1063 | return freq; | ||
1064 | } | ||
1065 | |||
1052 | int nvgpu_clk_arb_get_arbiter_effective_mhz(struct gk20a *g, | 1066 | int nvgpu_clk_arb_get_arbiter_effective_mhz(struct gk20a *g, |
1053 | u32 api_domain, u16 *freq_mhz) | 1067 | u32 api_domain, u16 *freq_mhz) |
1054 | { | 1068 | { |