mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
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>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <nvgpu/defaults.h>
|
||||
#include <nvgpu/ltc.h>
|
||||
#include <nvgpu/channel.h>
|
||||
#include <nvgpu/clk_arb.h>
|
||||
|
||||
#include "vgpu_linux.h"
|
||||
#include "vgpu/fecs_trace_vgpu.h"
|
||||
@@ -72,12 +73,19 @@ static void vgpu_remove_support(struct gk20a *g)
|
||||
static void vgpu_init_vars(struct gk20a *g, struct gk20a_platform *platform)
|
||||
{
|
||||
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
||||
struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
|
||||
|
||||
nvgpu_mutex_init(&g->power_lock);
|
||||
nvgpu_mutex_init(&g->ctxsw_disable_lock);
|
||||
nvgpu_mutex_init(&g->clk_arb_enable_lock);
|
||||
|
||||
nvgpu_mutex_init(&priv->vgpu_clk_get_freq_lock);
|
||||
|
||||
l->regs_saved = l->regs;
|
||||
l->bar1_saved = l->bar1;
|
||||
|
||||
nvgpu_atomic_set(&g->clk_arb_global_nr, 0);
|
||||
|
||||
g->aggressive_sync_destroy = platform->aggressive_sync_destroy;
|
||||
g->aggressive_sync_destroy_thresh = platform->aggressive_sync_destroy_thresh;
|
||||
__nvgpu_set_enabled(g, NVGPU_HAS_SYNCPOINTS, platform->has_syncpoints);
|
||||
@@ -206,6 +214,12 @@ int vgpu_pm_finalize_poweron(struct device *dev)
|
||||
goto done;
|
||||
}
|
||||
|
||||
err = nvgpu_clk_arb_init_arbiter(g);
|
||||
if (err) {
|
||||
nvgpu_err(g, "failed to init clk arb");
|
||||
goto done;
|
||||
}
|
||||
|
||||
err = g->ops.chip_init_gpu_characteristics(g);
|
||||
if (err) {
|
||||
nvgpu_err(g, "failed to init gk20a gpu characteristics");
|
||||
|
||||
Reference in New Issue
Block a user