diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-07-27 15:58:03 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-04 12:23:56 -0400 |
commit | b8efd9d04537d6129e2ce8b067417e46b0e7436f (patch) | |
tree | 1a40179a893e10c0fdcdd56797599bcdf6b55206 /drivers/gpu/nvgpu/gk20a | |
parent | c16797e35c2926bf34a61d5d8f37d5675ec23b1b (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')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ltc_gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 10 |
5 files changed, 13 insertions, 20 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 87923537..62b312b2 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <nvgpu/cond.h> | 34 | #include <nvgpu/cond.h> |
35 | #include <nvgpu/enabled.h> | 35 | #include <nvgpu/enabled.h> |
36 | #include <nvgpu/debug.h> | 36 | #include <nvgpu/debug.h> |
37 | #include <nvgpu/ltc.h> | ||
37 | 38 | ||
38 | #include "gk20a.h" | 39 | #include "gk20a.h" |
39 | #include "ctxsw_trace_gk20a.h" | 40 | #include "ctxsw_trace_gk20a.h" |
@@ -2490,11 +2491,8 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
2490 | if (profile) | 2491 | if (profile) |
2491 | profile->timestamp[PROFILE_ENTRY] = sched_clock(); | 2492 | profile->timestamp[PROFILE_ENTRY] = sched_clock(); |
2492 | 2493 | ||
2493 | #ifdef CONFIG_DEBUG_FS | ||
2494 | /* update debug settings */ | 2494 | /* update debug settings */ |
2495 | if (g->ops.ltc.sync_debugfs) | 2495 | nvgpu_ltc_sync_enabled(g); |
2496 | g->ops.ltc.sync_debugfs(g); | ||
2497 | #endif | ||
2498 | 2496 | ||
2499 | gk20a_dbg_info("channel %d", c->chid); | 2497 | gk20a_dbg_info("channel %d", c->chid); |
2500 | 2498 | ||
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) { |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 8d9318b2..f7b714f2 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -144,9 +144,7 @@ struct gpu_ops { | |||
144 | struct zbc_entry *s_val, | 144 | struct zbc_entry *s_val, |
145 | u32 index); | 145 | u32 index); |
146 | void (*init_cbc)(struct gk20a *g, struct gr_gk20a *gr); | 146 | void (*init_cbc)(struct gk20a *g, struct gr_gk20a *gr); |
147 | #ifdef CONFIG_DEBUG_FS | 147 | void (*set_enabled)(struct gk20a *g, bool enabled); |
148 | void (*sync_debugfs)(struct gk20a *g); | ||
149 | #endif | ||
150 | void (*init_fs_state)(struct gk20a *g); | 148 | void (*init_fs_state)(struct gk20a *g); |
151 | void (*isr)(struct gk20a *g); | 149 | void (*isr)(struct gk20a *g); |
152 | u32 (*cbc_fix_config)(struct gk20a *g, int base); | 150 | u32 (*cbc_fix_config)(struct gk20a *g, int base); |
@@ -1147,8 +1145,9 @@ struct gk20a { | |||
1147 | 1145 | ||
1148 | u32 emc3d_ratio; | 1146 | u32 emc3d_ratio; |
1149 | 1147 | ||
1148 | struct nvgpu_spinlock ltc_enabled_lock; | ||
1149 | |||
1150 | #ifdef CONFIG_DEBUG_FS | 1150 | #ifdef CONFIG_DEBUG_FS |
1151 | struct nvgpu_spinlock debugfs_lock; | ||
1152 | struct dentry *debugfs_ltc_enabled; | 1151 | struct dentry *debugfs_ltc_enabled; |
1153 | struct dentry *debugfs_timeouts_enabled; | 1152 | struct dentry *debugfs_timeouts_enabled; |
1154 | struct dentry *debugfs_gr_idle_timeout_default; | 1153 | struct dentry *debugfs_gr_idle_timeout_default; |
diff --git a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c index a543a0d3..1b834a47 100644 --- a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c | |||
@@ -21,8 +21,6 @@ | |||
21 | #include "gk20a.h" | 21 | #include "gk20a.h" |
22 | #include "gr_gk20a.h" | 22 | #include "gr_gk20a.h" |
23 | 23 | ||
24 | /* Non HW reg dependent stuff: */ | ||
25 | |||
26 | int gk20a_ltc_alloc_phys_cbc(struct gk20a *g, size_t compbit_backing_size) | 24 | int gk20a_ltc_alloc_phys_cbc(struct gk20a *g, size_t compbit_backing_size) |
27 | { | 25 | { |
28 | struct gr_gk20a *gr = &g->gr; | 26 | struct gr_gk20a *gr = &g->gr; |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index 2f35df71..c56b28bb 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |||
@@ -245,14 +245,8 @@ struct mm_gk20a { | |||
245 | bool sw_ready; | 245 | bool sw_ready; |
246 | int physical_bits; | 246 | int physical_bits; |
247 | bool use_full_comp_tag_line; | 247 | bool use_full_comp_tag_line; |
248 | #ifdef CONFIG_DEBUG_FS | 248 | bool ltc_enabled_current; |
249 | u32 ltc_enabled; | 249 | bool ltc_enabled_target; |
250 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) | ||
251 | u32 ltc_enabled_debug; | ||
252 | #else | ||
253 | bool ltc_enabled_debug; | ||
254 | #endif | ||
255 | #endif | ||
256 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) | 250 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) |
257 | u32 bypass_smmu; | 251 | u32 bypass_smmu; |
258 | u32 disable_bigpage; | 252 | u32 disable_bigpage; |