diff options
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/allocator.h | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/debug.h | 55 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/linux/kmem.h | 6 |
3 files changed, 57 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h index 3579b0fb..567c4422 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h | |||
@@ -256,11 +256,13 @@ static inline struct gk20a *nvgpu_alloc_to_gpu(struct nvgpu_allocator *a) | |||
256 | return a->g; | 256 | return a->g; |
257 | } | 257 | } |
258 | 258 | ||
259 | #ifdef CONFIG_DEBUG_FS | ||
259 | /* | 260 | /* |
260 | * Common functionality for the internals of the allocators. | 261 | * Common functionality for the internals of the allocators. |
261 | */ | 262 | */ |
262 | void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a); | 263 | void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a); |
263 | void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a); | 264 | void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a); |
265 | #endif | ||
264 | 266 | ||
265 | int __nvgpu_alloc_common_init(struct nvgpu_allocator *a, struct gk20a *g, | 267 | int __nvgpu_alloc_common_init(struct nvgpu_allocator *a, struct gk20a *g, |
266 | const char *name, void *priv, bool dbg, | 268 | const char *name, void *priv, bool dbg, |
@@ -281,11 +283,6 @@ static inline void nvgpu_alloc_disable_dbg(struct nvgpu_allocator *a) | |||
281 | */ | 283 | */ |
282 | extern u32 nvgpu_alloc_tracing_on; | 284 | extern u32 nvgpu_alloc_tracing_on; |
283 | 285 | ||
284 | #ifdef CONFIG_DEBUG_FS | ||
285 | struct device; | ||
286 | void nvgpu_alloc_debugfs_init(struct device *dev); | ||
287 | #endif | ||
288 | |||
289 | #define nvgpu_alloc_trace_func() \ | 286 | #define nvgpu_alloc_trace_func() \ |
290 | do { \ | 287 | do { \ |
291 | if (nvgpu_alloc_tracing_on) \ | 288 | if (nvgpu_alloc_tracing_on) \ |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/debug.h b/drivers/gpu/nvgpu/include/nvgpu/debug.h new file mode 100644 index 00000000..70a03978 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/debug.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * GK20A Debug functionality | ||
3 | * | ||
4 | * Copyright (C) 2011-2017 NVIDIA CORPORATION. All rights reserved. | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #ifndef __NVGPU_DEBUG_H__ | ||
18 | #define __NVGPU_DEBUG_H__ | ||
19 | |||
20 | struct gk20a; | ||
21 | struct gpu_ops; | ||
22 | |||
23 | struct gk20a_debug_output { | ||
24 | void (*fn)(void *ctx, const char *str, size_t len); | ||
25 | void *ctx; | ||
26 | char buf[256]; | ||
27 | }; | ||
28 | |||
29 | #ifdef CONFIG_DEBUG_FS | ||
30 | extern unsigned int gk20a_debug_trace_cmdbuf; | ||
31 | |||
32 | void gk20a_debug_output(struct gk20a_debug_output *o, | ||
33 | const char *fmt, ...); | ||
34 | |||
35 | void gk20a_debug_dump(struct gk20a *g); | ||
36 | void gk20a_debug_show_dump(struct gk20a *g, struct gk20a_debug_output *o); | ||
37 | int gk20a_gr_debug_dump(struct gk20a *g); | ||
38 | void gk20a_init_debug_ops(struct gpu_ops *gops); | ||
39 | |||
40 | void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink); | ||
41 | void gk20a_debug_deinit(struct gk20a *g); | ||
42 | #else | ||
43 | static inline void gk20a_debug_output(struct gk20a_debug_output *o, | ||
44 | const char *fmt, ...) {} | ||
45 | |||
46 | static inline void gk20a_debug_dump(struct gk20a *g) {} | ||
47 | static inline void gk20a_debug_show_dump(struct gk20a *g, struct gk20a_debug_output *o) {} | ||
48 | static inline int gk20a_gr_debug_dump(struct gk20a *g) { return 0;} | ||
49 | static inline void gk20a_init_debug_ops(struct gpu_ops *gops) {} | ||
50 | |||
51 | static inline void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink) {} | ||
52 | static inline void gk20a_debug_deinit(struct gk20a *g) {} | ||
53 | #endif | ||
54 | |||
55 | #endif /* __NVGPU_DEBUG_H__ */ | ||
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/kmem.h b/drivers/gpu/nvgpu/include/nvgpu/linux/kmem.h index dc198a04..611854f2 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/kmem.h +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/kmem.h | |||
@@ -31,12 +31,6 @@ void *__nvgpu_track_kcalloc(struct gk20a *g, size_t n, size_t size, | |||
31 | unsigned long ip); | 31 | unsigned long ip); |
32 | void __nvgpu_track_vfree(struct gk20a *g, void *addr); | 32 | void __nvgpu_track_vfree(struct gk20a *g, void *addr); |
33 | void __nvgpu_track_kfree(struct gk20a *g, void *addr); | 33 | void __nvgpu_track_kfree(struct gk20a *g, void *addr); |
34 | |||
35 | void nvgpu_kmem_debugfs_init(struct device *dev); | ||
36 | #else | ||
37 | static inline void nvgpu_kmem_debugfs_init(struct device *dev) | ||
38 | { | ||
39 | } | ||
40 | #endif | 34 | #endif |
41 | 35 | ||
42 | /** | 36 | /** |