From 46477494b2f5d566a0c133746af00a3da4ee6b90 Mon Sep 17 00:00:00 2001 From: Aparna Das Date: Tue, 11 Sep 2018 13:23:40 -0700 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1820674 Reviewed-by: mobile promotions Tested-by: mobile promotions --- .../gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c | 29 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c') 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 @@ #include "gk20a/gk20a.h" #include "os/linux/platform_gk20a.h" -#include "clk_vgpu.h" +#include "vgpu/clk_vgpu.h" #include "vgpu_linux.h" static int gk20a_tegra_probe(struct device *dev) @@ -40,6 +40,29 @@ static int gk20a_tegra_probe(struct device *dev) #endif } +long vgpu_plat_clk_round_rate(struct device *dev, unsigned long rate) +{ + /* server will handle frequency rounding */ + return rate; +} + +int vgpu_plat_clk_get_freqs(struct device *dev, unsigned long **freqs, + int *num_freqs) +{ + struct gk20a_platform *platform = gk20a_get_platform(dev); + struct gk20a *g = platform->g; + + return vgpu_clk_get_freqs(g, freqs, num_freqs); +} + +int vgpu_plat_clk_cap_rate(struct device *dev, unsigned long rate) +{ + struct gk20a_platform *platform = gk20a_get_platform(dev); + struct gk20a *g = platform->g; + + return vgpu_clk_cap_rate(g, rate); +} + struct gk20a_platform vgpu_tegra_platform = { .has_syncpoints = true, .aggressive_sync_destroy_thresh = 64, @@ -60,8 +83,8 @@ struct gk20a_platform vgpu_tegra_platform = { .probe = gk20a_tegra_probe, - .clk_round_rate = vgpu_clk_round_rate, - .get_clk_freqs = vgpu_clk_get_freqs, + .clk_round_rate = vgpu_plat_clk_round_rate, + .get_clk_freqs = vgpu_plat_clk_get_freqs, /* frequency scaling configuration */ .devfreq_governor = "userspace", -- cgit v1.2.2