summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-07-27 15:58:03 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-04 12:23:56 -0400
commitb8efd9d04537d6129e2ce8b067417e46b0e7436f (patch)
tree1a40179a893e10c0fdcdd56797599bcdf6b55206 /drivers/gpu/nvgpu/gk20a/gk20a.c
parentc16797e35c2926bf34a61d5d8f37d5675ec23b1b (diff)
gpu: nvgpu: Make LTC disabling common code
Refactor the sync_debugfs LTC HAL op so that the logic to enable or disable LTC goes to common code nvgpu_ltc_sync_enabled() and the LTC HAL set_enabled only performs the hardware register access. Create a new common function nvgpu_init_ltc_support() to initialize the LTC software variable, and move hardware initialization of LTC to be called from it. JIRA NVGPU-62 Change-Id: Ib1cf4f5b83ca3dac08407464ed56a732e0a33923 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1528262 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 6350bcf5..7d577cda 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -26,6 +26,7 @@
26#include <nvgpu/enabled.h> 26#include <nvgpu/enabled.h>
27#include <nvgpu/pmu.h> 27#include <nvgpu/pmu.h>
28#include <nvgpu/gmmu.h> 28#include <nvgpu/gmmu.h>
29#include <nvgpu/ltc.h>
29 30
30#include <trace/events/gk20a.h> 31#include <trace/events/gk20a.h>
31 32
@@ -216,8 +217,11 @@ int gk20a_finalize_poweron(struct gk20a *g)
216 goto done; 217 goto done;
217 } 218 }
218 219
219 if (g->ops.ltc.init_fs_state) 220 err = nvgpu_init_ltc_support(g);
220 g->ops.ltc.init_fs_state(g); 221 if (err) {
222 nvgpu_err(g, "failed to init ltc");
223 goto done;
224 }
221 225
222 err = gk20a_init_mm_support(g); 226 err = gk20a_init_mm_support(g);
223 if (err) { 227 if (err) {