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/include/nvgpu/vgpu/tegra_vgpu.h | 2 +- drivers/gpu/nvgpu/include/nvgpu/vgpu/vgpu.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h b/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h index f7a58c87..5ee50b18 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h @@ -519,6 +519,7 @@ struct tegra_vgpu_constants_params { u16 gpc_tpc_mask[TEGRA_VGPU_MAX_GPC_COUNT]; u32 hwpm_ctx_size; u8 force_preempt_mode; + u8 can_set_clkrate; u32 default_timeslice_us; u32 preempt_ctx_size; u32 channel_base; @@ -578,7 +579,6 @@ struct tegra_vgpu_perfbuf_mgt_params { struct tegra_vgpu_get_gpu_freq_table_params { u32 num_freqs; - u32 freqs[TEGRA_VGPU_GPU_FREQ_TABLE_SIZE]; /* in kHz */ }; struct tegra_vgpu_vsms_mapping_params { diff --git a/drivers/gpu/nvgpu/include/nvgpu/vgpu/vgpu.h b/drivers/gpu/nvgpu/include/nvgpu/vgpu/vgpu.h index 762bc229..15ab879e 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vgpu/vgpu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vgpu/vgpu.h @@ -26,6 +26,7 @@ #include #include #include +#include #include struct device; @@ -45,6 +46,9 @@ struct vgpu_priv_data { struct tegra_vgpu_constants_params constants; struct vgpu_ecc_stat *ecc_stats; int ecc_stats_count; + u32 num_freqs; + unsigned long *freqs; + struct nvgpu_mutex vgpu_clk_get_freq_lock; }; struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g); -- cgit v1.2.2