diff options
author | Aparna Das <aparnad@nvidia.com> | 2018-09-11 20:11:44 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-27 18:04:47 -0400 |
commit | 78e3d22da3c2513d425c8c2560468ce854a982dd (patch) | |
tree | 87ce6d1c47357c868cb58608e893afb4c14cfa69 /drivers/gpu/nvgpu/os | |
parent | 8789cafcfb0d1e16ad0b2c61b047d275f2d684b4 (diff) |
gpu: nvgpu: vgpu: support clk-arb
1. Implement the following vgpu functions to support clk-arb:
- vgpu_clk_get_range() to return min and max freqs from
supported frequencies
- implement vgpu_clk_get_round_rate() which sets rounded
rate to input rate. Rounding is handled in RM Server
- modify vgpu_clk_get_freqs() to retrieve freq table in IVM
memory instead of copying the value in array as part of cmd
message.
2. Add support for clk-arb related HALs for vgpu.
3. support_clk_freq_controller is assigned true for vgpu
provided guest VM has the privilege to set clock frequency.
Bug 200422845
Bug 2363882
Jira EVLR-3254
Change-Id: I91fc392db381c5db1d52b19d45ec0481fdc27554
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1812379
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c index e01178ed..aa2fa998 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <nvgpu/defaults.h> | 33 | #include <nvgpu/defaults.h> |
34 | #include <nvgpu/ltc.h> | 34 | #include <nvgpu/ltc.h> |
35 | #include <nvgpu/channel.h> | 35 | #include <nvgpu/channel.h> |
36 | #include <nvgpu/clk_arb.h> | ||
36 | 37 | ||
37 | #include "vgpu_linux.h" | 38 | #include "vgpu_linux.h" |
38 | #include "vgpu/fecs_trace_vgpu.h" | 39 | #include "vgpu/fecs_trace_vgpu.h" |
@@ -72,12 +73,19 @@ static void vgpu_remove_support(struct gk20a *g) | |||
72 | static void vgpu_init_vars(struct gk20a *g, struct gk20a_platform *platform) | 73 | static void vgpu_init_vars(struct gk20a *g, struct gk20a_platform *platform) |
73 | { | 74 | { |
74 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | 75 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); |
76 | struct vgpu_priv_data *priv = vgpu_get_priv_data(g); | ||
75 | 77 | ||
76 | nvgpu_mutex_init(&g->power_lock); | 78 | nvgpu_mutex_init(&g->power_lock); |
77 | nvgpu_mutex_init(&g->ctxsw_disable_lock); | 79 | nvgpu_mutex_init(&g->ctxsw_disable_lock); |
80 | nvgpu_mutex_init(&g->clk_arb_enable_lock); | ||
81 | |||
82 | nvgpu_mutex_init(&priv->vgpu_clk_get_freq_lock); | ||
83 | |||
78 | l->regs_saved = l->regs; | 84 | l->regs_saved = l->regs; |
79 | l->bar1_saved = l->bar1; | 85 | l->bar1_saved = l->bar1; |
80 | 86 | ||
87 | nvgpu_atomic_set(&g->clk_arb_global_nr, 0); | ||
88 | |||
81 | g->aggressive_sync_destroy = platform->aggressive_sync_destroy; | 89 | g->aggressive_sync_destroy = platform->aggressive_sync_destroy; |
82 | g->aggressive_sync_destroy_thresh = platform->aggressive_sync_destroy_thresh; | 90 | g->aggressive_sync_destroy_thresh = platform->aggressive_sync_destroy_thresh; |
83 | __nvgpu_set_enabled(g, NVGPU_HAS_SYNCPOINTS, platform->has_syncpoints); | 91 | __nvgpu_set_enabled(g, NVGPU_HAS_SYNCPOINTS, platform->has_syncpoints); |
@@ -206,6 +214,12 @@ int vgpu_pm_finalize_poweron(struct device *dev) | |||
206 | goto done; | 214 | goto done; |
207 | } | 215 | } |
208 | 216 | ||
217 | err = nvgpu_clk_arb_init_arbiter(g); | ||
218 | if (err) { | ||
219 | nvgpu_err(g, "failed to init clk arb"); | ||
220 | goto done; | ||
221 | } | ||
222 | |||
209 | err = g->ops.chip_init_gpu_characteristics(g); | 223 | err = g->ops.chip_init_gpu_characteristics(g); |
210 | if (err) { | 224 | if (err) { |
211 | nvgpu_err(g, "failed to init gk20a gpu characteristics"); | 225 | nvgpu_err(g, "failed to init gk20a gpu characteristics"); |