From 16ad9f537979c5f3717fc5781b1c2fad22a76f96 Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Tue, 26 Jun 2018 15:41:12 +0530 Subject: gpu: nvgpu: move gp106 specific clk_arbiter code into HAL Currently, clock arbiter code is extensively using dgpu specific implementation. This patch restructures the clk_arbiter code and moves gp106 specific code into HAL. Following changes are made in this patch 1) clk_domain_get_f_points is now invoked via HAL for gp106 i.e. g->ops.clk.clk_domain_get_f_points. 2) moved nvgpu_clk_arb_change_vf_point and other related static functions to clk_arb_gp106.c. 3) Instead of only checking if get_arbiter_clk_domain is empty, a check for support_clk_freq_controller is also added. This is to enable the clk_arbiter based on support from both the OS and the chips. Bug 2061372 Change-Id: I65b0a4e02145a86fbbfb420ed591b1fa3c86f6dc Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/1774279 Reviewed-by: svc-misra-checker GVS: Gerrit_Virtual_Submit Reviewed-by: Deepak Nibade Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp106/hal_gp106.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/gpu/nvgpu/gp106/hal_gp106.c') diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 78a3ea63..167bfaac 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -675,6 +675,7 @@ static const struct gpu_ops gp106_ops = { .get_crystal_clk_hz = gp106_crystal_clk_hz, .measure_freq = gp106_clk_measure_freq, .suspend_clk_support = gp106_suspend_clk_support, + .clk_domain_get_f_points = gp106_clk_domain_get_f_points, .mclk_init = gp106_mclk_init, .mclk_change = gp106_mclk_change, .mclk_deinit = gp106_mclk_deinit, @@ -684,6 +685,9 @@ static const struct gpu_ops gp106_ops = { .get_arbiter_clk_range = gp106_get_arbiter_clk_range, .get_arbiter_clk_default = gp106_get_arbiter_clk_default, .get_current_pstate = nvgpu_clk_arb_get_current_pstate, + .arbiter_clk_init = gp106_init_clk_arbiter, + .clk_arb_run_arbiter_cb = gp106_clk_arb_run_arbiter_cb, + .clk_arb_cleanup = gp106_clk_arb_cleanup, }, .regops = { .exec_regops = exec_regops_gk20a, @@ -849,6 +853,7 @@ int gp106_init_hal(struct gk20a *g) gops->clk.mclk_init = gp106_ops.clk.mclk_init; gops->clk.mclk_change = gp106_ops.clk.mclk_change; gops->clk.mclk_deinit = gp106_ops.clk.mclk_deinit; + gops->clk.clk_domain_get_f_points = gp106_ops.clk.clk_domain_get_f_points; gops->clk_arb = gp106_ops.clk_arb; gops->regops = gp106_ops.regops; -- cgit v1.2.2