summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-04-21 15:42:57 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-04-24 14:05:17 -0400
commitb3e1ce04b963e91b9b425b3c35cc4eff11db7543 (patch)
tree73c45d0acfe3ce25298ba1dc8dfa4777e02c861a /drivers
parentb88c9ad793cb9822f359b8c498afe872c412959c (diff)
gpu: nvgpu: Put debugfs dependencies inside #ifdef
Put all debugfs dependencies inside #ifdef CONFIG_DEBUG_FS. This includes some functions in allocators that were used only for debugging. Remove include of linux/debugfs.h on files that do not deal with debugfs. linux/debugfs.h implicitly included linux/fs.h, which we relied on. Add explicit include of linux/fs.h for all files where this is the case. Change-Id: I16feffae6b0e3a2edf366075cdc01ade86be06f9 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1467897 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_as.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/kmem.c2
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c4
-rw-r--r--drivers/gpu/nvgpu/common/linux/pci.c2
-rw-r--r--drivers/gpu/nvgpu/common/mm/bitmap_allocator.c4
-rw-r--r--drivers/gpu/nvgpu/common/mm/buddy_allocator.c4
-rw-r--r--drivers/gpu/nvgpu/common/mm/lockless_allocator.c6
-rw-r--r--drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c2
-rw-r--r--drivers/gpu/nvgpu/common/mm/page_allocator.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/ce2_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/clk_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h4
-rw-r--r--drivers/gpu/nvgpu/gk20a/debug_gk20a.c5
-rw-r--r--drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/fence_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h9
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_scale.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/sched_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/sched_gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/therm_gk20a.c11
-rw-r--r--drivers/gpu/nvgpu/gm206/bios_gm206.c4
-rw-r--r--drivers/gpu/nvgpu/gm20b/acr_gm20b.c3
-rw-r--r--drivers/gpu/nvgpu/gm20b/clk_gm20b.c2
-rw-r--r--drivers/gpu/nvgpu/gp106/acr_gp106.c2
-rw-r--r--drivers/gpu/nvgpu/gp106/clk_gp106.c3
-rw-r--r--drivers/gpu/nvgpu/gp106/therm_gp106.c2
-rw-r--r--drivers/gpu/nvgpu/gp106/xve_gp106.c4
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/allocator.h5
-rw-r--r--drivers/gpu/nvgpu/pmgr/pmgr.c5
33 files changed, 89 insertions, 22 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_as.c b/drivers/gpu/nvgpu/common/linux/ioctl_as.c
index d9316c7f..6a9d3811 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_as.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_as.c
@@ -15,6 +15,7 @@
15 15
16#include <linux/cdev.h> 16#include <linux/cdev.h>
17#include <linux/uaccess.h> 17#include <linux/uaccess.h>
18#include <linux/fs.h>
18 19
19#include <nvgpu/log2.h> 20#include <nvgpu/log2.h>
20 21
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
index 0546658d..97e911b9 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
@@ -18,6 +18,7 @@
18#include <linux/cdev.h> 18#include <linux/cdev.h>
19#include <linux/file.h> 19#include <linux/file.h>
20#include <linux/anon_inodes.h> 20#include <linux/anon_inodes.h>
21#include <linux/fs.h>
21#include <uapi/linux/nvgpu.h> 22#include <uapi/linux/nvgpu.h>
22 23
23#include <nvgpu/bitops.h> 24#include <nvgpu/bitops.h>
diff --git a/drivers/gpu/nvgpu/common/linux/kmem.c b/drivers/gpu/nvgpu/common/linux/kmem.c
index 4fe68830..f38a5e78 100644
--- a/drivers/gpu/nvgpu/common/linux/kmem.c
+++ b/drivers/gpu/nvgpu/common/linux/kmem.c
@@ -479,6 +479,7 @@ static void print_histogram(struct nvgpu_mem_alloc_tracker *tracker,
479 } 479 }
480} 480}
481 481
482#ifdef CONFIG_DEBUG_FS
482/** 483/**
483 * nvgpu_kmem_print_stats - Print kmem tracking stats. 484 * nvgpu_kmem_print_stats - Print kmem tracking stats.
484 * 485 *
@@ -515,7 +516,6 @@ void nvgpu_kmem_print_stats(struct nvgpu_mem_alloc_tracker *tracker,
515 unlock_tracker(tracker); 516 unlock_tracker(tracker);
516} 517}
517 518
518#if defined(CONFIG_DEBUG_FS)
519static int __kmem_tracking_show(struct seq_file *s, void *unused) 519static int __kmem_tracking_show(struct seq_file *s, void *unused)
520{ 520{
521 struct nvgpu_mem_alloc_tracker *tracker = s->private; 521 struct nvgpu_mem_alloc_tracker *tracker = s->private;
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index 79d6bd5f..ebc25a26 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -615,9 +615,9 @@ static int gk20a_pm_unrailgate(struct device *dev)
615{ 615{
616 struct gk20a_platform *platform = dev_get_drvdata(dev); 616 struct gk20a_platform *platform = dev_get_drvdata(dev);
617 int ret = 0; 617 int ret = 0;
618#ifdef CONFIG_DEBUG_FS
618 struct gk20a *g = get_gk20a(dev); 619 struct gk20a *g = get_gk20a(dev);
619 620
620#ifdef CONFIG_DEBUG_FS
621 g->pstats.last_rail_ungate_start = jiffies; 621 g->pstats.last_rail_ungate_start = jiffies;
622 if (g->pstats.railgating_cycle_count >= 1) 622 if (g->pstats.railgating_cycle_count >= 1)
623 g->pstats.total_rail_gate_time_ms = 623 g->pstats.total_rail_gate_time_ms =
@@ -974,8 +974,10 @@ static int __exit gk20a_remove(struct platform_device *pdev)
974 974
975 gk20a_user_deinit(dev, &nvgpu_class); 975 gk20a_user_deinit(dev, &nvgpu_class);
976 976
977#ifdef CONFIG_DEBUG_FS
977 debugfs_remove_recursive(platform->debugfs); 978 debugfs_remove_recursive(platform->debugfs);
978 debugfs_remove_recursive(platform->debugfs_alias); 979 debugfs_remove_recursive(platform->debugfs_alias);
980#endif
979 981
980 gk20a_remove_sysfs(dev); 982 gk20a_remove_sysfs(dev);
981 983
diff --git a/drivers/gpu/nvgpu/common/linux/pci.c b/drivers/gpu/nvgpu/common/linux/pci.c
index 0bad2b67..b4e6cb7c 100644
--- a/drivers/gpu/nvgpu/common/linux/pci.c
+++ b/drivers/gpu/nvgpu/common/linux/pci.c
@@ -463,8 +463,10 @@ static void nvgpu_pci_remove(struct pci_dev *pdev)
463 gk20a_user_deinit(g->dev, &nvgpu_pci_class); 463 gk20a_user_deinit(g->dev, &nvgpu_pci_class);
464 gk20a_dbg(gpu_dbg_shutdown, "User de-init done.\b"); 464 gk20a_dbg(gpu_dbg_shutdown, "User de-init done.\b");
465 465
466#ifdef CONFIG_DEBUG_FS
466 debugfs_remove_recursive(platform->debugfs); 467 debugfs_remove_recursive(platform->debugfs);
467 debugfs_remove_recursive(platform->debugfs_alias); 468 debugfs_remove_recursive(platform->debugfs_alias);
469#endif
468 470
469 gk20a_remove_sysfs(g->dev); 471 gk20a_remove_sysfs(g->dev);
470 472
diff --git a/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c b/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c
index 4b44bd7e..40ee199a 100644
--- a/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c
+++ b/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c
@@ -310,6 +310,7 @@ static void nvgpu_bitmap_alloc_destroy(struct nvgpu_allocator *__a)
310 nvgpu_kfree(nvgpu_alloc_to_gpu(__a), a); 310 nvgpu_kfree(nvgpu_alloc_to_gpu(__a), a);
311} 311}
312 312
313#ifdef CONFIG_DEBUG_FS
313static void nvgpu_bitmap_print_stats(struct nvgpu_allocator *__a, 314static void nvgpu_bitmap_print_stats(struct nvgpu_allocator *__a,
314 struct seq_file *s, int lock) 315 struct seq_file *s, int lock)
315{ 316{
@@ -329,6 +330,7 @@ static void nvgpu_bitmap_print_stats(struct nvgpu_allocator *__a,
329 __alloc_pstat(s, __a, " Outstanding = 0x%llx\n", 330 __alloc_pstat(s, __a, " Outstanding = 0x%llx\n",
330 a->bytes_alloced - a->bytes_freed); 331 a->bytes_alloced - a->bytes_freed);
331} 332}
333#endif
332 334
333static const struct nvgpu_allocator_ops bitmap_ops = { 335static const struct nvgpu_allocator_ops bitmap_ops = {
334 .alloc = nvgpu_bitmap_alloc, 336 .alloc = nvgpu_bitmap_alloc,
@@ -344,7 +346,9 @@ static const struct nvgpu_allocator_ops bitmap_ops = {
344 346
345 .fini = nvgpu_bitmap_alloc_destroy, 347 .fini = nvgpu_bitmap_alloc_destroy,
346 348
349#ifdef CONFIG_DEBUG_FS
347 .print_stats = nvgpu_bitmap_print_stats, 350 .print_stats = nvgpu_bitmap_print_stats,
351#endif
348}; 352};
349 353
350 354
diff --git a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c
index 44e8edb2..34bc51df 100644
--- a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c
+++ b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c
@@ -1086,6 +1086,7 @@ static u64 nvgpu_buddy_alloc_space(struct nvgpu_allocator *a)
1086 return space; 1086 return space;
1087} 1087}
1088 1088
1089#ifdef CONFIG_DEBUG_FS
1089/* 1090/*
1090 * Print the buddy allocator top level stats. If you pass @s as NULL then the 1091 * Print the buddy allocator top level stats. If you pass @s as NULL then the
1091 * stats are printed to the kernel log. This lets this code be used for 1092 * stats are printed to the kernel log. This lets this code be used for
@@ -1163,6 +1164,7 @@ static void nvgpu_buddy_print_stats(struct nvgpu_allocator *__a,
1163 if (lock) 1164 if (lock)
1164 alloc_unlock(__a); 1165 alloc_unlock(__a);
1165} 1166}
1167#endif
1166 1168
1167static const struct nvgpu_allocator_ops buddy_ops = { 1169static const struct nvgpu_allocator_ops buddy_ops = {
1168 .alloc = nvgpu_buddy_balloc, 1170 .alloc = nvgpu_buddy_balloc,
@@ -1182,7 +1184,9 @@ static const struct nvgpu_allocator_ops buddy_ops = {
1182 1184
1183 .fini = nvgpu_buddy_allocator_destroy, 1185 .fini = nvgpu_buddy_allocator_destroy,
1184 1186
1187#ifdef CONFIG_DEBUG_FS
1185 .print_stats = nvgpu_buddy_print_stats, 1188 .print_stats = nvgpu_buddy_print_stats,
1189#endif
1186}; 1190};
1187 1191
1188/* 1192/*
diff --git a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c
index dc72d8bf..d8043c0b 100644
--- a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c
+++ b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -106,6 +106,7 @@ static void nvgpu_lockless_alloc_destroy(struct nvgpu_allocator *a)
106 nvgpu_kfree(nvgpu_alloc_to_gpu(a), pa); 106 nvgpu_kfree(nvgpu_alloc_to_gpu(a), pa);
107} 107}
108 108
109#ifdef CONFIG_DEBUG_FS
109static void nvgpu_lockless_print_stats(struct nvgpu_allocator *a, 110static void nvgpu_lockless_print_stats(struct nvgpu_allocator *a,
110 struct seq_file *s, int lock) 111 struct seq_file *s, int lock)
111{ 112{
@@ -122,6 +123,7 @@ static void nvgpu_lockless_print_stats(struct nvgpu_allocator *a,
122 __alloc_pstat(s, a, " Number free = %d\n", 123 __alloc_pstat(s, a, " Number free = %d\n",
123 pa->nr_nodes - atomic_read(&pa->nr_allocs)); 124 pa->nr_nodes - atomic_read(&pa->nr_allocs));
124} 125}
126#endif
125 127
126static const struct nvgpu_allocator_ops pool_ops = { 128static const struct nvgpu_allocator_ops pool_ops = {
127 .alloc = nvgpu_lockless_alloc, 129 .alloc = nvgpu_lockless_alloc,
@@ -134,7 +136,9 @@ static const struct nvgpu_allocator_ops pool_ops = {
134 136
135 .fini = nvgpu_lockless_alloc_destroy, 137 .fini = nvgpu_lockless_alloc_destroy,
136 138
139#ifdef CONFIG_DEBUG_FS
137 .print_stats = nvgpu_lockless_print_stats, 140 .print_stats = nvgpu_lockless_print_stats,
141#endif
138}; 142};
139 143
140int nvgpu_lockless_allocator_init(struct gk20a *g, struct nvgpu_allocator *__a, 144int nvgpu_lockless_allocator_init(struct gk20a *g, struct nvgpu_allocator *__a,
diff --git a/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c b/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c
index b84855b5..115a0904 100644
--- a/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c
+++ b/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c
@@ -150,13 +150,13 @@ int __nvgpu_alloc_common_init(struct nvgpu_allocator *a, struct gk20a *g,
150 return 0; 150 return 0;
151} 151}
152 152
153#ifdef CONFIG_DEBUG_FS
153void nvgpu_alloc_print_stats(struct nvgpu_allocator *__a, 154void nvgpu_alloc_print_stats(struct nvgpu_allocator *__a,
154 struct seq_file *s, int lock) 155 struct seq_file *s, int lock)
155{ 156{
156 __a->ops->print_stats(__a, s, lock); 157 __a->ops->print_stats(__a, s, lock);
157} 158}
158 159
159#ifdef CONFIG_DEBUG_FS
160static int __alloc_show(struct seq_file *s, void *unused) 160static int __alloc_show(struct seq_file *s, void *unused)
161{ 161{
162 struct nvgpu_allocator *a = s->private; 162 struct nvgpu_allocator *a = s->private;
diff --git a/drivers/gpu/nvgpu/common/mm/page_allocator.c b/drivers/gpu/nvgpu/common/mm/page_allocator.c
index 6fbdbedd..2ffff63d 100644
--- a/drivers/gpu/nvgpu/common/mm/page_allocator.c
+++ b/drivers/gpu/nvgpu/common/mm/page_allocator.c
@@ -742,6 +742,7 @@ static void nvgpu_page_allocator_destroy(struct nvgpu_allocator *__a)
742 alloc_unlock(__a); 742 alloc_unlock(__a);
743} 743}
744 744
745#ifdef CONFIG_DEBUG_FS
745static void nvgpu_page_print_stats(struct nvgpu_allocator *__a, 746static void nvgpu_page_print_stats(struct nvgpu_allocator *__a,
746 struct seq_file *s, int lock) 747 struct seq_file *s, int lock)
747{ 748{
@@ -788,6 +789,7 @@ static void nvgpu_page_print_stats(struct nvgpu_allocator *__a,
788 if (lock) 789 if (lock)
789 alloc_unlock(__a); 790 alloc_unlock(__a);
790} 791}
792#endif
791 793
792static const struct nvgpu_allocator_ops page_ops = { 794static const struct nvgpu_allocator_ops page_ops = {
793 .alloc = nvgpu_page_alloc, 795 .alloc = nvgpu_page_alloc,
@@ -807,7 +809,9 @@ static const struct nvgpu_allocator_ops page_ops = {
807 809
808 .fini = nvgpu_page_allocator_destroy, 810 .fini = nvgpu_page_allocator_destroy,
809 811
812#ifdef CONFIG_DEBUG_FS
810 .print_stats = nvgpu_page_print_stats, 813 .print_stats = nvgpu_page_print_stats,
814#endif
811}; 815};
812 816
813/* 817/*
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
index 391f6612..f0927692 100644
--- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
@@ -18,7 +18,9 @@
18 18
19#include <linux/dma-mapping.h> 19#include <linux/dma-mapping.h>
20#include <linux/fs.h> 20#include <linux/fs.h>
21#ifdef CONFIG_DEBUG_FS
21#include <linux/debugfs.h> 22#include <linux/debugfs.h>
23#endif
22#include <linux/dma-buf.h> 24#include <linux/dma-buf.h>
23 25
24#include <trace/events/gk20a.h> 26#include <trace/events/gk20a.h>
@@ -1662,6 +1664,7 @@ int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd,
1662 return 0; 1664 return 0;
1663} 1665}
1664 1666
1667#ifdef CONFIG_DEBUG_FS
1665static ssize_t gk20a_cde_reload_write(struct file *file, 1668static ssize_t gk20a_cde_reload_write(struct file *file,
1666 const char __user *userbuf, size_t count, loff_t *ppos) 1669 const char __user *userbuf, size_t count, loff_t *ppos)
1667{ 1670{
@@ -1694,3 +1697,4 @@ void gk20a_cde_debugfs_init(struct device *dev)
1694 debugfs_create_file("reload_cde_firmware", S_IWUSR, platform->debugfs, 1697 debugfs_create_file("reload_cde_firmware", S_IWUSR, platform->debugfs,
1695 g, &gk20a_cde_reload_fops); 1698 g, &gk20a_cde_reload_fops);
1696} 1699}
1700#endif
diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
index 523ba4f6..ed5a8b4e 100644
--- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
@@ -11,13 +11,11 @@
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details. 13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18 */ 14 */
19 15
16#ifdef CONFIG_DEBUG_FS
20#include <linux/debugfs.h> 17#include <linux/debugfs.h>
18#endif
21 19
22#include <nvgpu/kmem.h> 20#include <nvgpu/kmem.h>
23#include <nvgpu/dma.h> 21#include <nvgpu/dma.h>
diff --git a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c
index b69f74b2..e904be49 100644
--- a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c
@@ -18,7 +18,9 @@
18 18
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/module.h> 20#include <linux/module.h>
21#ifdef CONFIG_DEBUG_FS
21#include <linux/debugfs.h> 22#include <linux/debugfs.h>
23#endif
22#include <linux/clk/tegra.h> 24#include <linux/clk/tegra.h>
23 25
24#include "gk20a.h" 26#include "gk20a.h"
diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
index 94f07701..f3b54355 100644
--- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
@@ -15,7 +15,6 @@
15#include <linux/kthread.h> 15#include <linux/kthread.h>
16#include <linux/wait.h> 16#include <linux/wait.h>
17#include <linux/ktime.h> 17#include <linux/ktime.h>
18#include <linux/debugfs.h>
19#include <linux/uaccess.h> 18#include <linux/uaccess.h>
20#include <linux/poll.h> 19#include <linux/poll.h>
21#include <trace/events/gk20a.h> 20#include <trace/events/gk20a.h>
diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h
index bb79331c..2f84b0dc 100644
--- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -24,7 +24,7 @@ struct channel_ctx_gk20a;
24struct gk20a_ctxsw_dev; 24struct gk20a_ctxsw_dev;
25struct gk20a_fecs_trace; 25struct gk20a_fecs_trace;
26struct tsg_gk20a; 26struct tsg_gk20a;
27 27struct poll_table_struct;
28 28
29int gk20a_ctxsw_dev_release(struct inode *inode, struct file *filp); 29int gk20a_ctxsw_dev_release(struct inode *inode, struct file *filp);
30int gk20a_ctxsw_dev_open(struct inode *inode, struct file *filp); 30int gk20a_ctxsw_dev_open(struct inode *inode, struct file *filp);
diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
index 1a9ffe77..d577c625 100644
--- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
@@ -12,9 +12,12 @@
12 * 12 *
13 */ 13 */
14 14
15#ifdef CONFIG_DEBUG_FS
15#include <linux/debugfs.h> 16#include <linux/debugfs.h>
17#endif
16#include <linux/seq_file.h> 18#include <linux/seq_file.h>
17#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/fs.h>
18 21
19#include <nvgpu/log.h> 22#include <nvgpu/log.h>
20#include <nvgpu/kmem.h> 23#include <nvgpu/kmem.h>
@@ -298,8 +301,8 @@ int gk20a_railgating_debugfs_init(struct device *dev)
298 301
299void gk20a_debug_init(struct device *dev, const char *debugfs_symlink) 302void gk20a_debug_init(struct device *dev, const char *debugfs_symlink)
300{ 303{
301 struct gk20a_platform *platform = dev_get_drvdata(dev);
302#ifdef CONFIG_DEBUG_FS 304#ifdef CONFIG_DEBUG_FS
305 struct gk20a_platform *platform = dev_get_drvdata(dev);
303 struct gk20a *g = platform->g; 306 struct gk20a *g = platform->g;
304 307
305 platform->debugfs = debugfs_create_dir(dev_name(dev), NULL); 308 platform->debugfs = debugfs_create_dir(dev_name(dev), NULL);
diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
index 7d509a4a..9e78c843 100644
--- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
@@ -13,7 +13,9 @@
13 13
14#include <asm/barrier.h> 14#include <asm/barrier.h>
15#include <linux/kthread.h> 15#include <linux/kthread.h>
16#ifdef CONFIG_DEBUG_FS
16#include <linux/debugfs.h> 17#include <linux/debugfs.h>
18#endif
17 19
18#include <nvgpu/kmem.h> 20#include <nvgpu/kmem.h>
19#include <nvgpu/dma.h> 21#include <nvgpu/dma.h>
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
index c886101c..92698745 100644
--- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
@@ -16,6 +16,7 @@
16#include <linux/gk20a.h> 16#include <linux/gk20a.h>
17#include <linux/file.h> 17#include <linux/file.h>
18#include <linux/version.h> 18#include <linux/version.h>
19#include <linux/fs.h>
19 20
20#include <nvgpu/semaphore.h> 21#include <nvgpu/semaphore.h>
21#include <nvgpu/kmem.h> 22#include <nvgpu/kmem.h>
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index a1700ebf..7c8b4eae 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -35,6 +35,9 @@ struct dbg_profiler_object_data;
35#include <linux/irqreturn.h> 35#include <linux/irqreturn.h>
36#include <linux/version.h> 36#include <linux/version.h>
37#include <linux/cdev.h> 37#include <linux/cdev.h>
38#ifdef CONFIG_DEBUG_FS
39#include <linux/debugfs.h>
40#endif
38 41
39#include "../../../arch/arm/mach-tegra/iomap.h" 42#include "../../../arch/arm/mach-tegra/iomap.h"
40 43
@@ -150,7 +153,9 @@ struct gpu_ops {
150 struct zbc_entry *s_val, 153 struct zbc_entry *s_val,
151 u32 index); 154 u32 index);
152 void (*init_cbc)(struct gk20a *g, struct gr_gk20a *gr); 155 void (*init_cbc)(struct gk20a *g, struct gr_gk20a *gr);
156#ifdef CONFIG_DEBUG_FS
153 void (*sync_debugfs)(struct gk20a *g); 157 void (*sync_debugfs)(struct gk20a *g);
158#endif
154 void (*init_fs_state)(struct gk20a *g); 159 void (*init_fs_state)(struct gk20a *g);
155 void (*isr)(struct gk20a *g); 160 void (*isr)(struct gk20a *g);
156 u32 (*cbc_fix_config)(struct gk20a *g, int base); 161 u32 (*cbc_fix_config)(struct gk20a *g, int base);
@@ -669,7 +674,9 @@ struct gpu_ops {
669 struct { 674 struct {
670 int (*init_therm_setup_hw)(struct gk20a *g); 675 int (*init_therm_setup_hw)(struct gk20a *g);
671 int (*elcg_init_idle_filters)(struct gk20a *g); 676 int (*elcg_init_idle_filters)(struct gk20a *g);
677#ifdef CONFIG_DEBUG_FS
672 void (*therm_debugfs_init)(struct gk20a *g); 678 void (*therm_debugfs_init)(struct gk20a *g);
679#endif
673 int (*get_internal_sensor_curr_temp)(struct gk20a *g, u32 *temp_f24_8); 680 int (*get_internal_sensor_curr_temp)(struct gk20a *g, u32 *temp_f24_8);
674 void (*get_internal_sensor_limits)(s32 *max_24_8, 681 void (*get_internal_sensor_limits)(s32 *max_24_8,
675 s32 *min_24_8); 682 s32 *min_24_8);
@@ -1140,7 +1147,9 @@ struct gk20a {
1140 u32 tpc_fs_mask_user; 1147 u32 tpc_fs_mask_user;
1141 1148
1142 struct nvgpu_bios bios; 1149 struct nvgpu_bios bios;
1150#ifdef CONFIG_DEBUG_FS
1143 struct debugfs_blob_wrapper bios_blob; 1151 struct debugfs_blob_wrapper bios_blob;
1152#endif
1144 1153
1145 struct nvgpu_clk_arb *clk_arb; 1154 struct nvgpu_clk_arb *clk_arb;
1146 1155
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
index 06c73b90..8c7a9d80 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
@@ -17,7 +17,6 @@
17 */ 17 */
18 18
19#include <linux/devfreq.h> 19#include <linux/devfreq.h>
20#include <linux/debugfs.h>
21#include <linux/export.h> 20#include <linux/export.h>
22#include <soc/tegra/chip-id.h> 21#include <soc/tegra/chip-id.h>
23#include <linux/pm_qos.h> 22#include <linux/pm_qos.h>
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
index 229d5b4f..98513511 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
@@ -17,7 +17,9 @@
17 */ 17 */
18 18
19#include <linux/module.h> 19#include <linux/module.h>
20#ifdef CONFIG_DEBUG_FS
20#include <linux/debugfs.h> 21#include <linux/debugfs.h>
22#endif
21#include <linux/uaccess.h> 23#include <linux/uaccess.h>
22 24
23#include <nvgpu/nvgpu_common.h> 25#include <nvgpu/nvgpu_common.h>
diff --git a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c
index ff038b62..54091014 100644
--- a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c
@@ -13,7 +13,9 @@
13 13
14#include <asm/barrier.h> 14#include <asm/barrier.h>
15#include <linux/wait.h> 15#include <linux/wait.h>
16#ifdef CONFIG_DEBUG_FS
16#include <linux/debugfs.h> 17#include <linux/debugfs.h>
18#endif
17#include <linux/uaccess.h> 19#include <linux/uaccess.h>
18#include <linux/poll.h> 20#include <linux/poll.h>
19#include <uapi/linux/nvgpu.h> 21#include <uapi/linux/nvgpu.h>
diff --git a/drivers/gpu/nvgpu/gk20a/sched_gk20a.h b/drivers/gpu/nvgpu/gk20a/sched_gk20a.h
index 1f983678..4f6d1510 100644
--- a/drivers/gpu/nvgpu/gk20a/sched_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/sched_gk20a.h
@@ -17,6 +17,7 @@
17struct gk20a; 17struct gk20a;
18struct gpu_ops; 18struct gpu_ops;
19struct tsg_gk20a; 19struct tsg_gk20a;
20struct poll_table_struct;
20 21
21struct gk20a_sched_ctrl { 22struct gk20a_sched_ctrl {
22 struct gk20a *g; 23 struct gk20a *g;
diff --git a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
index 0d2f1281..b700c735 100644
--- a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
@@ -1,9 +1,7 @@
1/* 1/*
2 * drivers/video/tegra/host/gk20a/therm_gk20a.c
3 *
4 * GK20A Therm 2 * GK20A Therm
5 * 3 *
6 * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved.
7 * 5 *
8 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -14,9 +12,8 @@
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details. 13 * more details.
16 * 14 *
17 * You should have received a copy of the GNU General Public License along with 15 * You should have received a copy of the GNU General Public License
18 * this program; if not, write to the Free Software Foundation, Inc., 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20 */ 17 */
21 18
22#include "gk20a.h" 19#include "gk20a.h"
@@ -105,8 +102,10 @@ int gk20a_init_therm_support(struct gk20a *g)
105 if (err) 102 if (err)
106 return err; 103 return err;
107 104
105#ifdef CONFIG_DEBUG_FS
108 if (g->ops.therm.therm_debugfs_init) 106 if (g->ops.therm.therm_debugfs_init)
109 g->ops.therm.therm_debugfs_init(g); 107 g->ops.therm.therm_debugfs_init(g);
108#endif
110 109
111 return err; 110 return err;
112} 111}
diff --git a/drivers/gpu/nvgpu/gm206/bios_gm206.c b/drivers/gpu/nvgpu/gm206/bios_gm206.c
index 6db37d72..058df3c4 100644
--- a/drivers/gpu/nvgpu/gm206/bios_gm206.c
+++ b/drivers/gpu/nvgpu/gm206/bios_gm206.c
@@ -256,7 +256,9 @@ int gm206_bios_init(struct gk20a *g)
256{ 256{
257 unsigned int i; 257 unsigned int i;
258 struct gk20a_platform *platform = dev_get_drvdata(g->dev); 258 struct gk20a_platform *platform = dev_get_drvdata(g->dev);
259#ifdef CONFIG_DEBUG_FS
259 struct dentry *d; 260 struct dentry *d;
261#endif
260 struct nvgpu_firmware *bios_fw; 262 struct nvgpu_firmware *bios_fw;
261 int err; 263 int err;
262 struct pci_dev *pdev = to_pci_dev(g->dev); 264 struct pci_dev *pdev = to_pci_dev(g->dev);
@@ -317,6 +319,7 @@ int gm206_bios_init(struct gk20a *g)
317 (g->pci_device_id == 0x1c75) && 319 (g->pci_device_id == 0x1c75) &&
318 (g->gpu_characteristics.vbios_version == 0x86065300); 320 (g->gpu_characteristics.vbios_version == 0x86065300);
319 321
322#ifdef CONFIG_DEBUG_FS
320 g->bios_blob.data = g->bios.data; 323 g->bios_blob.data = g->bios.data;
321 g->bios_blob.size = g->bios.size; 324 g->bios_blob.size = g->bios.size;
322 325
@@ -324,6 +327,7 @@ int gm206_bios_init(struct gk20a *g)
324 &g->bios_blob); 327 &g->bios_blob);
325 if (!d) 328 if (!d)
326 nvgpu_err(g, "No debugfs?"); 329 nvgpu_err(g, "No debugfs?");
330#endif
327 331
328 gk20a_dbg_fn("done"); 332 gk20a_dbg_fn("done");
329 333
diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
index 7f0edbb2..fafe8734 100644
--- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
@@ -11,8 +11,11 @@
11 * more details. 11 * more details.
12 */ 12 */
13 13
14#ifdef CONFIG_DEBUG_FS
14#include <linux/debugfs.h> 15#include <linux/debugfs.h>
16#endif
15 17
18#include <nvgpu/types.h>
16#include <linux/platform/tegra/mc.h> 19#include <linux/platform/tegra/mc.h>
17 20
18#include <nvgpu/dma.h> 21#include <nvgpu/dma.h>
diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
index aaea080a..8156fa00 100644
--- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
@@ -18,8 +18,10 @@
18 18
19#include <linux/version.h> 19#include <linux/version.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#ifdef CONFIG_DEBUG_FS
21#include <linux/debugfs.h> 22#include <linux/debugfs.h>
22#include <linux/uaccess.h> 23#include <linux/uaccess.h>
24#endif
23#include <linux/clk/tegra.h> 25#include <linux/clk/tegra.h>
24#include <soc/tegra/fuse.h> 26#include <soc/tegra/fuse.h>
25#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) 27#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c
index c4045cb6..5570489e 100644
--- a/drivers/gpu/nvgpu/gp106/acr_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c
@@ -11,7 +11,9 @@
11 * more details. 11 * more details.
12 */ 12 */
13 13
14#ifdef CONFIG_DEBUG_FS
14#include <linux/debugfs.h> 15#include <linux/debugfs.h>
16#endif
15 17
16#include <nvgpu/nvgpu_common.h> 18#include <nvgpu/nvgpu_common.h>
17#include <nvgpu/kmem.h> 19#include <nvgpu/kmem.h>
diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c
index fb9406e5..e4348e73 100644
--- a/drivers/gpu/nvgpu/gp106/clk_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c
@@ -16,8 +16,9 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
18 18
19#ifdef CONFIG_DEBUG_FS
19#include <linux/debugfs.h> 20#include <linux/debugfs.h>
20#include <linux/uaccess.h> 21#endif
21 22
22#include <nvgpu/kmem.h> 23#include <nvgpu/kmem.h>
23 24
diff --git a/drivers/gpu/nvgpu/gp106/therm_gp106.c b/drivers/gpu/nvgpu/gp106/therm_gp106.c
index 761d1b89..4f616d8e 100644
--- a/drivers/gpu/nvgpu/gp106/therm_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/therm_gp106.c
@@ -12,7 +12,9 @@
12 */ 12 */
13 13
14#include "therm_gp106.h" 14#include "therm_gp106.h"
15#ifdef CONFIG_DEBUG_FS
15#include <linux/debugfs.h> 16#include <linux/debugfs.h>
17#endif
16#include "therm/thrmpmu.h" 18#include "therm/thrmpmu.h"
17 19
18#include <nvgpu/hw/gp106/hw_therm_gp106.h> 20#include <nvgpu/hw/gp106/hw_therm_gp106.h>
diff --git a/drivers/gpu/nvgpu/gp106/xve_gp106.c b/drivers/gpu/nvgpu/gp106/xve_gp106.c
index a5834174..4d00b20b 100644
--- a/drivers/gpu/nvgpu/gp106/xve_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/xve_gp106.c
@@ -14,8 +14,10 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17#ifdef CONFIG_DEBUG_FS
17#include <linux/debugfs.h> 18#include <linux/debugfs.h>
18#include <linux/uaccess.h> 19#include <linux/uaccess.h>
20#endif
19 21
20#include "gk20a/gk20a.h" 22#include "gk20a/gk20a.h"
21#include "gm206/bios_gm206.h" 23#include "gm206/bios_gm206.h"
@@ -498,6 +500,7 @@ static void xve_available_speeds_gp106(struct gk20a *g, u32 *speed_mask)
498 *speed_mask = GPU_XVE_SPEED_2P5 | GPU_XVE_SPEED_5P0; 500 *speed_mask = GPU_XVE_SPEED_2P5 | GPU_XVE_SPEED_5P0;
499} 501}
500 502
503#ifdef CONFIG_DEBUG_FS
501static ssize_t xve_link_speed_write(struct file *filp, 504static ssize_t xve_link_speed_write(struct file *filp,
502 const char __user *buff, 505 const char __user *buff,
503 size_t len, loff_t *off) 506 size_t len, loff_t *off)
@@ -621,6 +624,7 @@ static const struct file_operations xve_link_control_status_fops = {
621 .llseek = seq_lseek, 624 .llseek = seq_lseek,
622 .release = single_release, 625 .release = single_release,
623}; 626};
627#endif
624 628
625static int xve_sw_init_gp106(struct device *dev) 629static int xve_sw_init_gp106(struct device *dev)
626{ 630{
diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h
index 61914d8c..b605b059 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/allocator.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h
@@ -17,7 +17,6 @@
17#ifndef NVGPU_ALLOCATOR_H 17#ifndef NVGPU_ALLOCATOR_H
18#define NVGPU_ALLOCATOR_H 18#define NVGPU_ALLOCATOR_H
19 19
20#include <linux/debugfs.h>
21#include <linux/seq_file.h> 20#include <linux/seq_file.h>
22#include <linux/platform_device.h> 21#include <linux/platform_device.h>
23 22
@@ -74,9 +73,11 @@ struct nvgpu_allocator_ops {
74 /* Destructor. */ 73 /* Destructor. */
75 void (*fini)(struct nvgpu_allocator *allocator); 74 void (*fini)(struct nvgpu_allocator *allocator);
76 75
76#ifdef CONFIG_DEBUG_FS
77 /* Debugging. */ 77 /* Debugging. */
78 void (*print_stats)(struct nvgpu_allocator *allocator, 78 void (*print_stats)(struct nvgpu_allocator *allocator,
79 struct seq_file *s, int lock); 79 struct seq_file *s, int lock);
80#endif
80}; 81};
81 82
82struct nvgpu_allocator { 83struct nvgpu_allocator {
@@ -246,8 +247,10 @@ u64 nvgpu_alloc_space(struct nvgpu_allocator *a);
246 247
247void nvgpu_alloc_destroy(struct nvgpu_allocator *allocator); 248void nvgpu_alloc_destroy(struct nvgpu_allocator *allocator);
248 249
250#ifdef CONFIG_DEBUG_FS
249void nvgpu_alloc_print_stats(struct nvgpu_allocator *a, 251void nvgpu_alloc_print_stats(struct nvgpu_allocator *a,
250 struct seq_file *s, int lock); 252 struct seq_file *s, int lock);
253#endif
251 254
252static inline struct gk20a *nvgpu_alloc_to_gpu(struct nvgpu_allocator *a) 255static inline struct gk20a *nvgpu_alloc_to_gpu(struct nvgpu_allocator *a)
253{ 256{
diff --git a/drivers/gpu/nvgpu/pmgr/pmgr.c b/drivers/gpu/nvgpu/pmgr/pmgr.c
index c41a3a22..f4fe984c 100644
--- a/drivers/gpu/nvgpu/pmgr/pmgr.c
+++ b/drivers/gpu/nvgpu/pmgr/pmgr.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -14,7 +14,10 @@
14#include "gk20a/gk20a.h" 14#include "gk20a/gk20a.h"
15#include "pwrdev.h" 15#include "pwrdev.h"
16#include "pmgrpmu.h" 16#include "pmgrpmu.h"
17
18#ifdef CONFIG_DEBUG_FS
17#include <linux/debugfs.h> 19#include <linux/debugfs.h>
20#endif
18 21
19int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val) 22int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val)
20{ 23{