summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-01-27 11:38:55 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-07 03:10:41 -0500
commitd6ff5ef649ead7cf7caded5c7742efd7ad569a8a (patch)
tree72a130658e7992b5f79e78f77e50e297d1e057c0 /drivers
parent707ea45e0f1d7a07885597777496b186dd5fb6f0 (diff)
gpu: nvgpu: Disable trace_printk use by default
trace_printk() does an extra stringify operation before calling do_trace_printk(). The string ends up unused. This has an impact to kernel even if we never end up using trace_printk(). Disable use of trace_printk() and introduce a Kconfig option for re-enabling it. Change-Id: I2e1014f5231f2089d7dc3cb2539e3eb5f4d58361 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1295298 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/Kconfig.nvgpu8
-rw-r--r--drivers/gpu/nvgpu/gk20a/debug_gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h14
-rw-r--r--drivers/gpu/nvgpu/gp10b/cde_gp10b.c3
5 files changed, 18 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/Kconfig.nvgpu b/drivers/gpu/nvgpu/Kconfig.nvgpu
index 8baf6897..d15a9fd0 100644
--- a/drivers/gpu/nvgpu/Kconfig.nvgpu
+++ b/drivers/gpu/nvgpu/Kconfig.nvgpu
@@ -111,6 +111,14 @@ config GK20A_PCI
111 help 111 help
112 Enable support for GPUs on PCIe bus. 112 Enable support for GPUs on PCIe bus.
113 113
114config GK20A_TRACE_PRINTK
115 bool "Support trace_printk debugging"
116 depends on CONFIG_FTRACE_PRINTK
117 default n
118 help
119 Enable nvgpu debug facility to redirect debug spew to ftrace. This
120 affects kernel memory use, so should not be enabled by default.
121
114config GK20A_VIDMEM 122config GK20A_VIDMEM
115 bool "Support separate video memory on nvgpu" 123 bool "Support separate video memory on nvgpu"
116 depends on GK20A 124 depends on GK20A
diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
index 6341a962..7c7d7ae6 100644
--- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
@@ -417,9 +417,10 @@ void gk20a_debug_init(struct device *dev, const char *debugfs_symlink)
417 debugfs_create_bool("disable_syncpoints", S_IRUGO|S_IWUSR, 417 debugfs_create_bool("disable_syncpoints", S_IRUGO|S_IWUSR,
418 platform->debugfs, &platform->disable_syncpoints); 418 platform->debugfs, &platform->disable_syncpoints);
419 419
420#if defined(GK20A_DEBUG)
421 debugfs_create_u32("dbg_mask", S_IRUGO|S_IWUSR, 420 debugfs_create_u32("dbg_mask", S_IRUGO|S_IWUSR,
422 platform->debugfs, &gk20a_dbg_mask); 421 platform->debugfs, &gk20a_dbg_mask);
422
423#ifdef CONFIG_GK20A_TRACE_PRINTK
423 debugfs_create_u32("dbg_ftrace", S_IRUGO|S_IWUSR, 424 debugfs_create_u32("dbg_ftrace", S_IRUGO|S_IWUSR,
424 platform->debugfs, &gk20a_dbg_ftrace); 425 platform->debugfs, &gk20a_dbg_ftrace);
425#endif 426#endif
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 6b026ee2..583e77b4 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -89,8 +89,8 @@
89 89
90#define GK20A_NUM_CDEVS 7 90#define GK20A_NUM_CDEVS 7
91 91
92#if defined(GK20A_DEBUG)
93u32 gk20a_dbg_mask = GK20A_DEFAULT_DBG_MASK; 92u32 gk20a_dbg_mask = GK20A_DEFAULT_DBG_MASK;
93#ifdef CONFIG_GK20A_TRACE_PRINTK
94u32 gk20a_dbg_ftrace; 94u32 gk20a_dbg_ftrace;
95#endif 95#endif
96 96
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 69528c1f..b27b36d3 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -1108,12 +1108,10 @@ struct gk20a_cyclestate_buffer_elem {
1108 1108
1109#ifdef CONFIG_DEBUG_FS 1109#ifdef CONFIG_DEBUG_FS
1110 /* debug info, default is compiled-in but effectively disabled (0 mask) */ 1110 /* debug info, default is compiled-in but effectively disabled (0 mask) */
1111 #define GK20A_DEBUG
1112 /*e.g: echo 1 > /d/gk20a.0/dbg_mask */ 1111 /*e.g: echo 1 > /d/gk20a.0/dbg_mask */
1113 #define GK20A_DEFAULT_DBG_MASK 0 1112 #define GK20A_DEFAULT_DBG_MASK 0
1114#else 1113#else
1115 /* manually enable and turn it on the mask */ 1114 /* manually enable and turn it on the mask */
1116 /*#define NVGPU_DEBUG*/
1117 #define GK20A_DEFAULT_DBG_MASK (dbg_info) 1115 #define GK20A_DEFAULT_DBG_MASK (dbg_info)
1118#endif 1116#endif
1119 1117
@@ -1141,8 +1139,8 @@ enum gk20a_dbg_categories {
1141 gpu_dbg_mem = BIT(31), /* memory accesses, very verbose */ 1139 gpu_dbg_mem = BIT(31), /* memory accesses, very verbose */
1142}; 1140};
1143 1141
1144#if defined(GK20A_DEBUG)
1145extern u32 gk20a_dbg_mask; 1142extern u32 gk20a_dbg_mask;
1143#ifdef CONFIG_GK20A_TRACE_PRINTK
1146extern u32 gk20a_dbg_ftrace; 1144extern u32 gk20a_dbg_ftrace;
1147#define gk20a_dbg(dbg_mask, format, arg...) \ 1145#define gk20a_dbg(dbg_mask, format, arg...) \
1148do { \ 1146do { \
@@ -1154,14 +1152,14 @@ do { \
1154 __func__, ##arg); \ 1152 __func__, ##arg); \
1155 } \ 1153 } \
1156} while (0) 1154} while (0)
1157 1155#else
1158#else /* GK20A_DEBUG */
1159#define gk20a_dbg(dbg_mask, format, arg...) \ 1156#define gk20a_dbg(dbg_mask, format, arg...) \
1160do { \ 1157do { \
1161 if (0) \ 1158 if (unlikely((dbg_mask) & gk20a_dbg_mask)) { \
1162 pr_info("gk20a %s: " format "\n", __func__, ##arg);\ 1159 pr_info("gk20a %s: " format "\n", \
1160 __func__, ##arg); \
1161 } \
1163} while (0) 1162} while (0)
1164
1165#endif 1163#endif
1166 1164
1167#define gk20a_err(d, fmt, arg...) \ 1165#define gk20a_err(d, fmt, arg...) \
diff --git a/drivers/gpu/nvgpu/gp10b/cde_gp10b.c b/drivers/gpu/nvgpu/gp10b/cde_gp10b.c
index 4a16abd1..56700211 100644
--- a/drivers/gpu/nvgpu/gp10b/cde_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/cde_gp10b.c
@@ -129,14 +129,13 @@ static int gp10b_populate_scatter_buffer(struct gk20a *g,
129 if ((page & 7) != 0) 129 if ((page & 7) != 0)
130 scatter_buffer[page >> 3] = d; 130 scatter_buffer[page >> 3] = d;
131 131
132#if defined(GK20A_DEBUG)
133 if (unlikely(gpu_dbg_cde & gk20a_dbg_mask)) { 132 if (unlikely(gpu_dbg_cde & gk20a_dbg_mask)) {
134 gk20a_dbg(gpu_dbg_cde, "scatterBuffer content:"); 133 gk20a_dbg(gpu_dbg_cde, "scatterBuffer content:");
135 for (i=0; i < page>>3; i++) { 134 for (i=0; i < page>>3; i++) {
136 gk20a_dbg(gpu_dbg_cde, " %x", scatter_buffer[i]); 135 gk20a_dbg(gpu_dbg_cde, " %x", scatter_buffer[i]);
137 } 136 }
138 } 137 }
139#endif 138
140 return 0; 139 return 0;
141} 140}
142 141