From 78e3d22da3c2513d425c8c2560468ce854a982dd Mon Sep 17 00:00:00 2001 From: Aparna Das Date: Tue, 11 Sep 2018 17:11:44 -0700 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1812379 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/vgpu.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/gpu/nvgpu/vgpu/vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index 9ad0468e..7d7df9b3 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "gk20a/gk20a.h" #include "fecs_trace_vgpu.h" @@ -235,6 +236,13 @@ void vgpu_remove_support_common(struct gk20a *g) &msg, sizeof(msg)); WARN_ON(err); nvgpu_thread_stop(&priv->intr_handler); + + nvgpu_clk_arb_cleanup_arbiter(g); + + nvgpu_mutex_destroy(&g->clk_arb_enable_lock); + nvgpu_mutex_destroy(&priv->vgpu_clk_get_freq_lock); + + nvgpu_kfree(g, priv->freqs); } void vgpu_detect_chip(struct gk20a *g) -- cgit v1.2.2