summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-11-07 13:08:16 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-09 22:18:21 -0500
commit870e76fbc7076a41e711ad9d5569a74373a4697a (patch)
treedf5d7be18cc89a1c27d4ece631bffec2b2928c2e /drivers
parentdc5f6bcee0281c5fa63c977519d732218f519ea0 (diff)
gpu: nvgpu: Move sm_arch to nvgpu_gpu_params
Move sm_arch_* fields to nvgpu_gpu_params to make them available from common code without accessing Linux specific GPU characteristics. JIRA NVGPU-259 Change-Id: Ieffb2ddde81b27af53dfedb9fe3972d20757cc35 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1593686 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/common/linux/ioctl_ctrl.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h5
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c8
-rw-r--r--drivers/gpu/nvgpu/vgpu/gr_vgpu.c6
4 files changed, 16 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
index 0481eacf..cff889fb 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
@@ -226,6 +226,10 @@ gk20a_ctrl_ioctl_gpu_characteristics(
226 g->ops.mm.get_mmu_levels(g, pgpu->big_page_size)[0].lo_bit[0]; 226 g->ops.mm.get_mmu_levels(g, pgpu->big_page_size)[0].lo_bit[0];
227 pgpu->available_big_page_sizes = nvgpu_mm_get_available_big_page_sizes(g); 227 pgpu->available_big_page_sizes = nvgpu_mm_get_available_big_page_sizes(g);
228 228
229 pgpu->sm_arch_sm_version = g->params.sm_arch_sm_version;
230 pgpu->sm_arch_spa_version = g->params.sm_arch_spa_version;
231 pgpu->sm_arch_warp_count = g->params.sm_arch_warp_count;
232
229 if (request->gpu_characteristics_buf_size > 0) { 233 if (request->gpu_characteristics_buf_size > 0) {
230 size_t write_size = sizeof(*pgpu); 234 size_t write_size = sizeof(*pgpu);
231 235
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index ff83fd18..2dbe8b02 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -1075,6 +1075,11 @@ struct nvgpu_gpu_params {
1075 u32 gpu_impl; 1075 u32 gpu_impl;
1076 /* GPU revision ID */ 1076 /* GPU revision ID */
1077 u32 gpu_rev; 1077 u32 gpu_rev;
1078 /* sm version */
1079 u32 sm_arch_sm_version;
1080 /* sm instruction set */
1081 u32 sm_arch_spa_version;
1082 u32 sm_arch_warp_count;
1078}; 1083};
1079 1084
1080struct gk20a { 1085struct gk20a {
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index afe60b98..61f608f4 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -841,11 +841,11 @@ void gr_gm20b_detect_sm_arch(struct gk20a *g)
841{ 841{
842 u32 v = gk20a_readl(g, gr_gpc0_tpc0_sm_arch_r()); 842 u32 v = gk20a_readl(g, gr_gpc0_tpc0_sm_arch_r());
843 843
844 g->gpu_characteristics.sm_arch_spa_version = 844 g->params.sm_arch_spa_version =
845 gr_gpc0_tpc0_sm_arch_spa_version_v(v); 845 gr_gpc0_tpc0_sm_arch_spa_version_v(v);
846 g->gpu_characteristics.sm_arch_sm_version = 846 g->params.sm_arch_sm_version =
847 gr_gpc0_tpc0_sm_arch_sm_version_v(v); 847 gr_gpc0_tpc0_sm_arch_sm_version_v(v);
848 g->gpu_characteristics.sm_arch_warp_count = 848 g->params.sm_arch_warp_count =
849 gr_gpc0_tpc0_sm_arch_warp_count_v(v); 849 gr_gpc0_tpc0_sm_arch_warp_count_v(v);
850} 850}
851 851
@@ -1154,7 +1154,7 @@ void gr_gm20b_bpt_reg_info(struct gk20a *g, struct nvgpu_warpstate *w_state)
1154 1154
1155 /* for maxwell & kepler */ 1155 /* for maxwell & kepler */
1156 u32 numSmPerTpc = 1; 1156 u32 numSmPerTpc = 1;
1157 u32 numWarpPerTpc = g->gpu_characteristics.sm_arch_warp_count * numSmPerTpc; 1157 u32 numWarpPerTpc = g->params.sm_arch_warp_count * numSmPerTpc;
1158 1158
1159 for (sm_id = 0; sm_id < gr->no_of_sm; sm_id++) { 1159 for (sm_id = 0; sm_id < gr->no_of_sm; sm_id++) {
1160 gpc = g->gr.sm_to_cluster[sm_id].gpc_index; 1160 gpc = g->gr.sm_to_cluster[sm_id].gpc_index;
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
index fca02831..730f4b22 100644
--- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
@@ -37,11 +37,11 @@ void vgpu_gr_detect_sm_arch(struct gk20a *g)
37 37
38 gk20a_dbg_fn(""); 38 gk20a_dbg_fn("");
39 39
40 g->gpu_characteristics.sm_arch_sm_version = 40 g->params.sm_arch_sm_version =
41 priv->constants.sm_arch_sm_version; 41 priv->constants.sm_arch_sm_version;
42 g->gpu_characteristics.sm_arch_spa_version = 42 g->params.sm_arch_spa_version =
43 priv->constants.sm_arch_spa_version; 43 priv->constants.sm_arch_spa_version;
44 g->gpu_characteristics.sm_arch_warp_count = 44 g->params.sm_arch_warp_count =
45 priv->constants.sm_arch_warp_count; 45 priv->constants.sm_arch_warp_count;
46} 46}
47 47