summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2017-12-30 16:04:19 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-10 18:57:20 -0500
commit6b90684ceec6c32aed7491a059b3972b1f1be5f4 (patch)
tree0bc0fa73de0e352d8da8f360cac780c903c60d95 /drivers/gpu/nvgpu/gk20a/gr_gk20a.c
parent5fb7c7d8f97bbec0d01f4f26aaf7757790c8b407 (diff)
gpu: nvgpu: vgpu: get virtual SMs mapping
On gv11b we can have multiple SMs per TPC. Add sm_per_tpc in vgpu constants to properly dimension the virtual SM to TPC/GPC mapping in virtualization case. Use TEGRA_VGPU_CMD_GET_SMS_MAPPING to query current mapping. Bug 2039676 Change-Id: I817be18f9a28cfb9bd8af207d7d6341a2ec3994b Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1631203 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 11054087..0f6bebe7 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Graphics 2 * GK20A Graphics
3 * 3 *
4 * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-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"),
@@ -1137,7 +1137,7 @@ static inline u32 count_bits(u32 mask)
1137 return count; 1137 return count;
1138} 1138}
1139 1139
1140void gr_gk20a_init_sm_id_table(struct gk20a *g) 1140int gr_gk20a_init_sm_id_table(struct gk20a *g)
1141{ 1141{
1142 u32 gpc, tpc; 1142 u32 gpc, tpc;
1143 u32 sm_id = 0; 1143 u32 sm_id = 0;
@@ -1156,6 +1156,7 @@ void gr_gk20a_init_sm_id_table(struct gk20a *g)
1156 } 1156 }
1157 } 1157 }
1158 g->gr.no_of_sm = sm_id; 1158 g->gr.no_of_sm = sm_id;
1159 return 0;
1159} 1160}
1160 1161
1161/* 1162/*
@@ -1178,11 +1179,15 @@ int gr_gk20a_init_fs_state(struct gk20a *g)
1178 u32 tpc_per_gpc; 1179 u32 tpc_per_gpc;
1179 u32 fuse_tpc_mask; 1180 u32 fuse_tpc_mask;
1180 u32 reg_index; 1181 u32 reg_index;
1182 int err;
1181 1183
1182 gk20a_dbg_fn(""); 1184 gk20a_dbg_fn("");
1183 1185
1184 if (g->ops.gr.init_sm_id_table) { 1186 if (g->ops.gr.init_sm_id_table) {
1185 g->ops.gr.init_sm_id_table(g); 1187 err = g->ops.gr.init_sm_id_table(g);
1188 if (err)
1189 return err;
1190
1186 /* Is table empty ? */ 1191 /* Is table empty ? */
1187 if (g->gr.no_of_sm == 0) 1192 if (g->gr.no_of_sm == 0)
1188 return -EINVAL; 1193 return -EINVAL;