summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
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/include
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/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h2
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vgpu/vgpu.h4
2 files changed, 5 insertions, 1 deletions
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 {
519 u16 gpc_tpc_mask[TEGRA_VGPU_MAX_GPC_COUNT]; 519 u16 gpc_tpc_mask[TEGRA_VGPU_MAX_GPC_COUNT];
520 u32 hwpm_ctx_size; 520 u32 hwpm_ctx_size;
521 u8 force_preempt_mode; 521 u8 force_preempt_mode;
522 u8 can_set_clkrate;
522 u32 default_timeslice_us; 523 u32 default_timeslice_us;
523 u32 preempt_ctx_size; 524 u32 preempt_ctx_size;
524 u32 channel_base; 525 u32 channel_base;
@@ -578,7 +579,6 @@ struct tegra_vgpu_perfbuf_mgt_params {
578 579
579struct tegra_vgpu_get_gpu_freq_table_params { 580struct tegra_vgpu_get_gpu_freq_table_params {
580 u32 num_freqs; 581 u32 num_freqs;
581 u32 freqs[TEGRA_VGPU_GPU_FREQ_TABLE_SIZE]; /* in kHz */
582}; 582};
583 583
584struct tegra_vgpu_vsms_mapping_params { 584struct 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 @@
26#include <nvgpu/types.h> 26#include <nvgpu/types.h>
27#include <nvgpu/thread.h> 27#include <nvgpu/thread.h>
28#include <nvgpu/log.h> 28#include <nvgpu/log.h>
29#include <nvgpu/lock.h>
29#include <nvgpu/vgpu/tegra_vgpu.h> 30#include <nvgpu/vgpu/tegra_vgpu.h>
30 31
31struct device; 32struct device;
@@ -45,6 +46,9 @@ struct vgpu_priv_data {
45 struct tegra_vgpu_constants_params constants; 46 struct tegra_vgpu_constants_params constants;
46 struct vgpu_ecc_stat *ecc_stats; 47 struct vgpu_ecc_stat *ecc_stats;
47 int ecc_stats_count; 48 int ecc_stats_count;
49 u32 num_freqs;
50 unsigned long *freqs;
51 struct nvgpu_mutex vgpu_clk_get_freq_lock;
48}; 52};
49 53
50struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g); 54struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g);