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/platform_vgpu_tegra.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/platform_vgpu_tegra.c')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c b/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c index 44879a45..25b76988 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | #include "gk20a/gk20a.h" | 21 | #include "gk20a/gk20a.h" |
22 | #include "os/linux/platform_gk20a.h" | 22 | #include "os/linux/platform_gk20a.h" |
23 | #include "clk_vgpu.h" | 23 | #include "vgpu/clk_vgpu.h" |
24 | #include "vgpu_linux.h" | 24 | #include "vgpu_linux.h" |
25 | 25 | ||
26 | static int gk20a_tegra_probe(struct device *dev) | 26 | static int gk20a_tegra_probe(struct device *dev) |
@@ -40,6 +40,29 @@ static int gk20a_tegra_probe(struct device *dev) | |||
40 | #endif | 40 | #endif |
41 | } | 41 | } |
42 | 42 | ||
43 | long vgpu_plat_clk_round_rate(struct device *dev, unsigned long rate) | ||
44 | { | ||
45 | /* server will handle frequency rounding */ | ||
46 | return rate; | ||
47 | } | ||
48 | |||
49 | int vgpu_plat_clk_get_freqs(struct device *dev, unsigned long **freqs, | ||
50 | int *num_freqs) | ||
51 | { | ||
52 | struct gk20a_platform *platform = gk20a_get_platform(dev); | ||
53 | struct gk20a *g = platform->g; | ||
54 | |||
55 | return vgpu_clk_get_freqs(g, freqs, num_freqs); | ||
56 | } | ||
57 | |||
58 | int vgpu_plat_clk_cap_rate(struct device *dev, unsigned long rate) | ||
59 | { | ||
60 | struct gk20a_platform *platform = gk20a_get_platform(dev); | ||
61 | struct gk20a *g = platform->g; | ||
62 | |||
63 | return vgpu_clk_cap_rate(g, rate); | ||
64 | } | ||
65 | |||
43 | struct gk20a_platform vgpu_tegra_platform = { | 66 | struct gk20a_platform vgpu_tegra_platform = { |
44 | .has_syncpoints = true, | 67 | .has_syncpoints = true, |
45 | .aggressive_sync_destroy_thresh = 64, | 68 | .aggressive_sync_destroy_thresh = 64, |
@@ -60,8 +83,8 @@ struct gk20a_platform vgpu_tegra_platform = { | |||
60 | 83 | ||
61 | .probe = gk20a_tegra_probe, | 84 | .probe = gk20a_tegra_probe, |
62 | 85 | ||
63 | .clk_round_rate = vgpu_clk_round_rate, | 86 | .clk_round_rate = vgpu_plat_clk_round_rate, |
64 | .get_clk_freqs = vgpu_clk_get_freqs, | 87 | .get_clk_freqs = vgpu_plat_clk_get_freqs, |
65 | 88 | ||
66 | /* frequency scaling configuration */ | 89 | /* frequency scaling configuration */ |
67 | .devfreq_governor = "userspace", | 90 | .devfreq_governor = "userspace", |