summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv100/gr_gv100.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gv100/gr_gv100.c')
-rw-r--r--drivers/gpu/nvgpu/gv100/gr_gv100.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gv100/gr_gv100.c b/drivers/gpu/nvgpu/gv100/gr_gv100.c
index 430c7cd0..f90fd075 100644
--- a/drivers/gpu/nvgpu/gv100/gr_gv100.c
+++ b/drivers/gpu/nvgpu/gv100/gr_gv100.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GV100 GPU GR 2 * GV100 GPU GR
3 * 3 *
4 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"), 7 * copy of this software and associated documentation files (the "Software"),
@@ -199,14 +199,14 @@ void gr_gv100_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index)
199{ 199{
200} 200}
201 201
202void gr_gv100_init_sm_id_table(struct gk20a *g) 202int gr_gv100_init_sm_id_table(struct gk20a *g)
203{ 203{
204 u32 gpc, tpc, sm, pes, gtpc; 204 u32 gpc, tpc, sm, pes, gtpc;
205 u32 sm_id = 0; 205 u32 sm_id = 0;
206 u32 sm_per_tpc = nvgpu_get_litter_value(g, GPU_LIT_NUM_SM_PER_TPC); 206 u32 sm_per_tpc = nvgpu_get_litter_value(g, GPU_LIT_NUM_SM_PER_TPC);
207 u32 num_sm = sm_per_tpc * g->gr.tpc_count; 207 u32 num_sm = sm_per_tpc * g->gr.tpc_count;
208 int perf, maxperf; 208 int perf, maxperf;
209 int err; 209 int err = 0;
210 unsigned long *gpc_tpc_mask; 210 unsigned long *gpc_tpc_mask;
211 u32 *tpc_table, *gpc_table; 211 u32 *tpc_table, *gpc_table;
212 212
@@ -217,6 +217,7 @@ void gr_gv100_init_sm_id_table(struct gk20a *g)
217 217
218 if (!gpc_table || !tpc_table || !gpc_tpc_mask) { 218 if (!gpc_table || !tpc_table || !gpc_tpc_mask) {
219 nvgpu_err(g, "Error allocating memory for sm tables"); 219 nvgpu_err(g, "Error allocating memory for sm tables");
220 err = -ENOMEM;
220 goto exit_build_table; 221 goto exit_build_table;
221 } 222 }
222 223
@@ -273,6 +274,7 @@ exit_build_table:
273 nvgpu_kfree(g, gpc_table); 274 nvgpu_kfree(g, gpc_table);
274 nvgpu_kfree(g, tpc_table); 275 nvgpu_kfree(g, tpc_table);
275 nvgpu_kfree(g, gpc_tpc_mask); 276 nvgpu_kfree(g, gpc_tpc_mask);
277 return err;
276} 278}
277 279
278void gr_gv100_load_tpc_mask(struct gk20a *g) 280void gr_gv100_load_tpc_mask(struct gk20a *g)