diff options
author | Aparna Das <aparnad@nvidia.com> | 2018-09-11 16:23:40 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-20 13:52:18 -0400 |
commit | 46477494b2f5d566a0c133746af00a3da4ee6b90 (patch) | |
tree | cf5b7e30d26bb493fe291a40fc95614ccab998f7 /drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c | |
parent | c28e73ee2f92d1d287637a22d40d170b42771f96 (diff) |
gpu: nvgpu: vgpu: restructure vgpu clk implementation
Move OS agnostic parts of vgpu clk code out of os/linux specific
path. This includes implementation sending rpc commands to
RM Server. Move Linux specific vgpu clk code to platform vgpu files
keeping it consistent with native implementation.
Bug 2363882
Jira EVLR-3254
Change-Id: I0aae014ef16415bb356c81e9bfd76bc65206d9fd
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1820674
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c index 7cf22d9d..f5628bc1 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c | |||
@@ -35,7 +35,7 @@ | |||
35 | 35 | ||
36 | #include "vgpu_linux.h" | 36 | #include "vgpu_linux.h" |
37 | #include "vgpu/fecs_trace_vgpu.h" | 37 | #include "vgpu/fecs_trace_vgpu.h" |
38 | #include "clk_vgpu.h" | 38 | #include "vgpu/clk_vgpu.h" |
39 | #include "gk20a/tsg_gk20a.h" | 39 | #include "gk20a/tsg_gk20a.h" |
40 | #include "gk20a/regops_gk20a.h" | 40 | #include "gk20a/regops_gk20a.h" |
41 | #include "gm20b/hal_gm20b.h" | 41 | #include "gm20b/hal_gm20b.h" |
@@ -46,6 +46,7 @@ | |||
46 | #include "os/linux/scale.h" | 46 | #include "os/linux/scale.h" |
47 | #include "os/linux/driver_common.h" | 47 | #include "os/linux/driver_common.h" |
48 | #include "os/linux/platform_gk20a.h" | 48 | #include "os/linux/platform_gk20a.h" |
49 | #include "os/linux/vgpu/platform_vgpu_tegra.h" | ||
49 | 50 | ||
50 | struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g) | 51 | struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g) |
51 | { | 52 | { |
@@ -244,7 +245,7 @@ static int vgpu_qos_notify(struct notifier_block *nb, | |||
244 | nvgpu_log_fn(g, " "); | 245 | nvgpu_log_fn(g, " "); |
245 | 246 | ||
246 | max_freq = (u32)pm_qos_read_max_bound(PM_QOS_GPU_FREQ_BOUNDS); | 247 | max_freq = (u32)pm_qos_read_max_bound(PM_QOS_GPU_FREQ_BOUNDS); |
247 | err = vgpu_clk_cap_rate(profile->dev, max_freq); | 248 | err = vgpu_plat_clk_cap_rate(profile->dev, max_freq); |
248 | if (err) | 249 | if (err) |
249 | nvgpu_err(g, "%s failed, err=%d", __func__, err); | 250 | nvgpu_err(g, "%s failed, err=%d", __func__, err); |
250 | 251 | ||
@@ -286,6 +287,7 @@ static void vgpu_pm_qos_remove(struct device *dev) | |||
286 | static int vgpu_pm_init(struct device *dev) | 287 | static int vgpu_pm_init(struct device *dev) |
287 | { | 288 | { |
288 | struct gk20a *g = get_gk20a(dev); | 289 | struct gk20a *g = get_gk20a(dev); |
290 | struct gk20a_platform *platform = gk20a_get_platform(dev); | ||
289 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | 291 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); |
290 | unsigned long *freqs; | 292 | unsigned long *freqs; |
291 | int num_freqs; | 293 | int num_freqs; |
@@ -303,7 +305,7 @@ static int vgpu_pm_init(struct device *dev) | |||
303 | 305 | ||
304 | if (l->devfreq) { | 306 | if (l->devfreq) { |
305 | /* set min/max frequency based on frequency table */ | 307 | /* set min/max frequency based on frequency table */ |
306 | err = vgpu_clk_get_freqs(dev, &freqs, &num_freqs); | 308 | err = platform->get_clk_freqs(dev, &freqs, &num_freqs); |
307 | if (err) | 309 | if (err) |
308 | return err; | 310 | return err; |
309 | 311 | ||