diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-05-24 08:07:04 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-02 09:53:35 -0400 |
commit | 6090a8a7ee347f92d806f104d3a0082208f5df64 (patch) | |
tree | 74b0d7057ea1b112d7de41f1bbce5e212f1525de /drivers/gpu/nvgpu/include | |
parent | be7f22db8bc5bff131432a4f6d127ecc8ce5096d (diff) |
gpu: nvgpu: move debugfs code to linux module
Since all debugfs code is Linux specific, remove
it from common code and move it to Linux module
Debugfs code is now divided into below
module specific files :
common/linux/debug.c
common/linux/debug_cde.c
common/linux/debug_ce.c
common/linux/debug_fifo.c
common/linux/debug_gr.c
common/linux/debug_mm.c
common/linux/debug_allocator.c
common/linux/debug_kmem.c
common/linux/debug_pmu.c
common/linux/debug_sched.c
Add corresponding header files for above modules too
And compile all of above files only if CONFIG_DEBUG_FS is set
Some more details of the changes made
- Move and rename gk20a/debug_gk20a.c to common/linux/debug.c
- Move and rename gk20a/debug_gk20a.h to include/nvgpu/debug.h
- Remove gm20b/debug_gm20b.c and gm20b/debug_gm20b.h and call
gk20a_init_debug_ops() directly from gm20b_init_hal()
- Update all debug APIs to receive struct gk20a as parameter
instead of receiving struct device pointer
- Update API gk20a_dmabuf_get_state() to receive struct gk20a
pointer instead of struct device
- Include <nvgpu/debug.h> explicitly in all files where debug
operations are used
- Remove "gk20a/platform_gk20a.h" include from HAL files
which no longer need this include
- Add new API gk20a_debug_deinit() to deinitialize debugfs
and call it from gk20a_remove()
- Move API gk20a_debug_dump_all_channel_status_ramfc() to
gk20a/fifo_gk20a.c
Jira NVGPU-62
Change-Id: I076975d3d7f669bdbe9212fa33d98529377feeb6
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1488902
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
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 | /** |