summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/allocator.h7
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/debug.h55
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/kmem.h6
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 */
262void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a); 263void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a);
263void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a); 264void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a);
265#endif
264 266
265int __nvgpu_alloc_common_init(struct nvgpu_allocator *a, struct gk20a *g, 267int __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 */
282extern u32 nvgpu_alloc_tracing_on; 284extern u32 nvgpu_alloc_tracing_on;
283 285
284#ifdef CONFIG_DEBUG_FS
285struct device;
286void 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
20struct gk20a;
21struct gpu_ops;
22
23struct 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
30extern unsigned int gk20a_debug_trace_cmdbuf;
31
32void gk20a_debug_output(struct gk20a_debug_output *o,
33 const char *fmt, ...);
34
35void gk20a_debug_dump(struct gk20a *g);
36void gk20a_debug_show_dump(struct gk20a *g, struct gk20a_debug_output *o);
37int gk20a_gr_debug_dump(struct gk20a *g);
38void gk20a_init_debug_ops(struct gpu_ops *gops);
39
40void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink);
41void gk20a_debug_deinit(struct gk20a *g);
42#else
43static inline void gk20a_debug_output(struct gk20a_debug_output *o,
44 const char *fmt, ...) {}
45
46static inline void gk20a_debug_dump(struct gk20a *g) {}
47static inline void gk20a_debug_show_dump(struct gk20a *g, struct gk20a_debug_output *o) {}
48static inline int gk20a_gr_debug_dump(struct gk20a *g) { return 0;}
49static inline void gk20a_init_debug_ops(struct gpu_ops *gops) {}
50
51static inline void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink) {}
52static 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);
32void __nvgpu_track_vfree(struct gk20a *g, void *addr); 32void __nvgpu_track_vfree(struct gk20a *g, void *addr);
33void __nvgpu_track_kfree(struct gk20a *g, void *addr); 33void __nvgpu_track_kfree(struct gk20a *g, void *addr);
34
35void nvgpu_kmem_debugfs_init(struct device *dev);
36#else
37static inline void nvgpu_kmem_debugfs_init(struct device *dev)
38{
39}
40#endif 34#endif
41 35
42/** 36/**