summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
authorSri Krishna chowdary <schowdary@nvidia.com>2016-05-24 01:32:46 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-05-24 13:52:56 -0400
commite82c840119503ec519eddacb4aa377660d67a3ab (patch)
tree673142873b5ceab930f34ddde112173d7a63b786 /drivers/gpu/nvgpu/gk20a/gr_gk20a.c
parentd16da3baec15b470c6cb1e1c58eadea60b8ffe83 (diff)
gpu: nvgpu: fix compilation issues
compiling kernel with clang pointed out below issues in nvgpu. Fixing them. gr_gk20a.c:1185:12: error: stack frame size of 3152 bytes in function 'gr_gk20a_setup_alpha_beta_tables' cde_gk20a.c:1376:22: error: duplicate 'const' declaration cde_gk20a.c:1377:22: error: duplicate 'const' declaration cde_gk20a.c:1378:22: error: duplicate 'const' declaration ctxsw_trace_gk20a.c:71:19: error: unused function 'ring_space' platform_gk20a_tegra.c:55:19: error: unused function 'pmc_read' platform_gk20a_tegra.c:60:20: error: unused function 'pmc_write' bug 1745660 Change-Id: I8cd4383cb898307bbeb162ca00b3e20d04de2c90 Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com> Reviewed-on: http://git-master/r/1150486 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 60247da8..a5caf048 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -1203,15 +1203,18 @@ static int gr_gk20a_setup_alpha_beta_tables(struct gk20a *g,
1203 u32 reg_offset; 1203 u32 reg_offset;
1204 bool assign_alpha; 1204 bool assign_alpha;
1205 1205
1206 u32 map_alpha[gr_pd_alpha_ratio_table__size_1_v()]; 1206 u32 *map_alpha;
1207 u32 map_beta[gr_pd_alpha_ratio_table__size_1_v()]; 1207 u32 *map_beta;
1208 u32 map_reg_used[gr_pd_alpha_ratio_table__size_1_v()]; 1208 u32 *map_reg_used;
1209 1209
1210 gk20a_dbg_fn(""); 1210 gk20a_dbg_fn("");
1211 1211
1212 memset(map_alpha, 0, gr_pd_alpha_ratio_table__size_1_v() * sizeof(u32)); 1212 map_alpha = kzalloc(3 * gr_pd_alpha_ratio_table__size_1_v() *
1213 memset(map_beta, 0, gr_pd_alpha_ratio_table__size_1_v() * sizeof(u32)); 1213 sizeof(u32), GFP_KERNEL);
1214 memset(map_reg_used, 0, gr_pd_alpha_ratio_table__size_1_v() * sizeof(u32)); 1214 if (!map_alpha)
1215 return -ENOMEM;
1216 map_beta = map_alpha + gr_pd_alpha_ratio_table__size_1_v();
1217 map_reg_used = map_beta + gr_pd_alpha_ratio_table__size_1_v();
1215 1218
1216 for (row = 0; row < rows; ++row) { 1219 for (row = 0; row < rows; ++row) {
1217 alpha_target = max_t(u32, gr->tpc_count * row / rows, 1); 1220 alpha_target = max_t(u32, gr->tpc_count * row / rows, 1);
@@ -1277,6 +1280,7 @@ static int gr_gk20a_setup_alpha_beta_tables(struct gk20a *g,
1277 } 1280 }
1278 } 1281 }
1279 1282
1283 kfree(map_alpha);
1280 return 0; 1284 return 0;
1281} 1285}
1282 1286