summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/gv11b
diff options
context:
space:
mode:
authorAparna Das <aparnad@nvidia.com>2018-09-11 20:11:44 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-27 18:04:47 -0400
commit78e3d22da3c2513d425c8c2560468ce854a982dd (patch)
tree87ce6d1c47357c868cb58608e893afb4c14cfa69 /drivers/gpu/nvgpu/vgpu/gv11b
parent8789cafcfb0d1e16ad0b2c61b047d275f2d684b4 (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/vgpu/gv11b')
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c
index 1fc1b0f2..c0e1b1bb 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c
+++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c
@@ -68,6 +68,7 @@
68#include <gp10b/ce_gp10b.h> 68#include <gp10b/ce_gp10b.h>
69#include "gp10b/gr_gp10b.h" 69#include "gp10b/gr_gp10b.h"
70#include <gp10b/fifo_gp10b.h> 70#include <gp10b/fifo_gp10b.h>
71#include "gp10b/clk_arb_gp10b.h"
71 72
72#include <gp106/pmu_gp106.h> 73#include <gp106/pmu_gp106.h>
73#include <gp106/acr_gp106.h> 74#include <gp106/acr_gp106.h>
@@ -522,6 +523,15 @@ static const struct gpu_ops vgpu_gv11b_ops = {
522 .pmu_pg_set_sub_feature_mask = NULL, 523 .pmu_pg_set_sub_feature_mask = NULL,
523 .is_pmu_supported = NULL, 524 .is_pmu_supported = NULL,
524 }, 525 },
526 .clk_arb = {
527 .get_arbiter_clk_domains = gp10b_get_arbiter_clk_domains,
528 .get_arbiter_f_points = gp10b_get_arbiter_f_points,
529 .get_arbiter_clk_range = gp10b_get_arbiter_clk_range,
530 .get_arbiter_clk_default = gp10b_get_arbiter_clk_default,
531 .arbiter_clk_init = gp10b_init_clk_arbiter,
532 .clk_arb_run_arbiter_cb = gp10b_clk_arb_run_arbiter_cb,
533 .clk_arb_cleanup = gp10b_clk_arb_cleanup,
534 },
525 .regops = { 535 .regops = {
526 .exec_regops = vgpu_exec_regops, 536 .exec_regops = vgpu_exec_regops,
527 .get_global_whitelist_ranges = 537 .get_global_whitelist_ranges =
@@ -627,6 +637,7 @@ static const struct gpu_ops vgpu_gv11b_ops = {
627int vgpu_gv11b_init_hal(struct gk20a *g) 637int vgpu_gv11b_init_hal(struct gk20a *g)
628{ 638{
629 struct gpu_ops *gops = &g->ops; 639 struct gpu_ops *gops = &g->ops;
640 struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
630 641
631 gops->ltc = vgpu_gv11b_ops.ltc; 642 gops->ltc = vgpu_gv11b_ops.ltc;
632 gops->ce2 = vgpu_gv11b_ops.ce2; 643 gops->ce2 = vgpu_gv11b_ops.ce2;
@@ -641,6 +652,7 @@ int vgpu_gv11b_init_hal(struct gk20a *g)
641#endif 652#endif
642 gops->therm = vgpu_gv11b_ops.therm; 653 gops->therm = vgpu_gv11b_ops.therm;
643 gops->pmu = vgpu_gv11b_ops.pmu; 654 gops->pmu = vgpu_gv11b_ops.pmu;
655 gops->clk_arb = vgpu_gv11b_ops.clk_arb;
644 gops->regops = vgpu_gv11b_ops.regops; 656 gops->regops = vgpu_gv11b_ops.regops;
645 gops->mc = vgpu_gv11b_ops.mc; 657 gops->mc = vgpu_gv11b_ops.mc;
646 gops->debug = vgpu_gv11b_ops.debug; 658 gops->debug = vgpu_gv11b_ops.debug;
@@ -661,6 +673,10 @@ int vgpu_gv11b_init_hal(struct gk20a *g)
661 gops->get_litter_value = vgpu_gv11b_ops.get_litter_value; 673 gops->get_litter_value = vgpu_gv11b_ops.get_litter_value;
662 gops->semaphore_wakeup = gk20a_channel_semaphore_wakeup; 674 gops->semaphore_wakeup = gk20a_channel_semaphore_wakeup;
663 675
676 if (priv->constants.can_set_clkrate) {
677 gops->clk.support_clk_freq_controller = true;
678 }
679
664 g->name = "gv11b"; 680 g->name = "gv11b";
665 681
666 return 0; 682 return 0;