From 152eeae163e6e2115af2dd194df95217dd37b6bf Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Thu, 26 Apr 2018 16:45:07 -0700 Subject: gpu: nvgpu: vgpu: call nvgpu_init_ltc_support vgpu needs to call nvgpu_init_ltc_support to floor sweep and set ltc_count. And set gops.ltc.set_enabled to null as guest is not allowed to change ltc settings. Jira VQRM-2345 Change-Id: I83517d631aa947db4a0a4c312f0cecda9ba03973 Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1703626 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/vgpu/vgpu_linux.c | 7 +++++++ drivers/gpu/nvgpu/common/ltc.c | 3 +++ drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c | 2 +- drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu_linux.c b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu_linux.c index c5572603..90fbc079 100644 --- a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu_linux.c +++ b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu_linux.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "vgpu_linux.h" #include "vgpu/fecs_trace_vgpu.h" @@ -177,6 +178,12 @@ int vgpu_pm_finalize_poweron(struct device *dev) if (g->ops.ltc.init_fs_state) g->ops.ltc.init_fs_state(g); + err = nvgpu_init_ltc_support(g); + if (err) { + nvgpu_err(g, "failed to init ltc"); + goto done; + } + err = vgpu_init_mm_support(g); if (err) { nvgpu_err(g, "failed to init gk20a mm"); diff --git a/drivers/gpu/nvgpu/common/ltc.c b/drivers/gpu/nvgpu/common/ltc.c index 024c2e49..dec4a80c 100644 --- a/drivers/gpu/nvgpu/common/ltc.c +++ b/drivers/gpu/nvgpu/common/ltc.c @@ -42,6 +42,9 @@ int nvgpu_init_ltc_support(struct gk20a *g) void nvgpu_ltc_sync_enabled(struct gk20a *g) { + if (!g->ops.ltc.set_enabled) + return; + nvgpu_spinlock_acquire(&g->ltc_enabled_lock); if (g->mm.ltc_enabled_current != g->mm.ltc_enabled_target) { g->ops.ltc.set_enabled(g, g->mm.ltc_enabled_target); diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c index 708c52a1..7810ab42 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c @@ -86,7 +86,7 @@ static const struct gpu_ops vgpu_gp10b_ops = { .isr = gp10b_ltc_isr, .cbc_fix_config = gm20b_ltc_cbc_fix_config, .flush = gm20b_flush_ltc, - .set_enabled = gp10b_ltc_set_enabled, + .set_enabled = NULL, }, .ce2 = { .isr_stall = gp10b_ce_isr, diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index 9fe76573..72db457b 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c @@ -104,7 +104,7 @@ static const struct gpu_ops vgpu_gv11b_ops = { .cbc_ctrl = NULL, .isr = gv11b_ltc_isr, .flush = gm20b_flush_ltc, - .set_enabled = gp10b_ltc_set_enabled, + .set_enabled = NULL, }, .ce2 = { .isr_stall = gv11b_ce_isr, -- cgit v1.2.2