summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2017-02-22 13:04:31 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-02-27 13:03:23 -0500
commit207e2ac7d12e62df476f4828136a4c15e156f8a6 (patch)
tree62e6d87e22261441242210b7e3cf072f0b3bcee3
parent53e718a739b4c6d6e3a1f4993a4722f28a40cff3 (diff)
gpu: nvgpu: gv11b: reading max veid number
To get maximum number of subctx, sw should read NV_PGRAPH_PRI_FE_CHIP_DEF_INFO_MAX_VEID_COUNT instead of LITTER_NUM_SUBCTX. JIRA GV11B-72 Change-Id: I4d675ba49d8a600da77e7b60da449d9e5ba48971 Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: http://git-master/r/1309591 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Seema Khowala <seemaj@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.c6
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.h3
-rw-r--r--drivers/gpu/nvgpu/gv11b/hal_gv11b.c3
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h12
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_proj_gv11b.h6
5 files changed, 17 insertions, 13 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
index c5390fe4..a67b1476 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
@@ -1657,8 +1657,10 @@ static void gv11b_write_bundle_veid_state(struct gk20a *g, u32 index)
1657 struct av_list_gk20a *sw_veid_bundle_init = 1657 struct av_list_gk20a *sw_veid_bundle_init =
1658 &g->gr.ctx_vars.sw_veid_bundle_init; 1658 &g->gr.ctx_vars.sw_veid_bundle_init;
1659 u32 j; 1659 u32 j;
1660 u32 num_subctx = nvgpu_get_litter_value(g, GPU_LIT_NUM_SUBCTX); 1660 u32 data = gk20a_readl(g, gr_pri_fe_chip_def_info_r());
1661 u32 err = 0; 1661 u32 num_subctx, err = 0;
1662
1663 num_subctx = gr_pri_fe_chip_def_info_max_veid_count_v(data);
1662 1664
1663 for (j = 0; j < num_subctx; j++) { 1665 for (j = 0; j < num_subctx; j++) {
1664 1666
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
index b2549edd..7467fea8 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
@@ -35,9 +35,6 @@ enum {
35 VOLTA_DMA_COPY_A = 0xC3B5, 35 VOLTA_DMA_COPY_A = 0xC3B5,
36}; 36};
37 37
38/* use magic number 99 for subctx litter value */
39#define GPU_LIT_NUM_SUBCTX 99
40
41#define NVC397_SET_SHADER_EXCEPTIONS 0x1528 38#define NVC397_SET_SHADER_EXCEPTIONS 0x1528
42#define NVC397_SET_CIRCULAR_BUFFER_SIZE 0x1280 39#define NVC397_SET_CIRCULAR_BUFFER_SIZE 0x1280
43#define NVC397_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc 40#define NVC397_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
index 8b10245e..133a1e8d 100644
--- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
@@ -167,9 +167,6 @@ static int gv11b_get_litter_value(struct gk20a *g, int value)
167 case GPU_LIT_FBPA_STRIDE: 167 case GPU_LIT_FBPA_STRIDE:
168 ret = proj_fbpa_stride_v(); 168 ret = proj_fbpa_stride_v();
169 break; 169 break;
170 case GPU_LIT_NUM_SUBCTX:
171 ret = proj_litter_num_subctx_v();
172 break;
173 default: 170 default:
174 break; 171 break;
175 } 172 }
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h
index 656597ba..592a7899 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h
@@ -462,6 +462,18 @@ static inline u32 gr_pri_fe_go_idle_info_r(void)
462{ 462{
463 return 0x00404194; 463 return 0x00404194;
464} 464}
465static inline u32 gr_pri_fe_chip_def_info_r(void)
466{
467 return 0x00404030;
468}
469static inline u32 gr_pri_fe_chip_def_info_max_veid_count_v(u32 r)
470{
471 return (r >> 0) & 0xfff;
472}
473static inline u32 gr_pri_fe_chip_def_info_max_veid_count_init_v(void)
474{
475 return 0x00000040;
476}
465static inline u32 gr_pri_gpc0_tpc0_tex_m_tex_subunits_status_r(void) 477static inline u32 gr_pri_gpc0_tpc0_tex_m_tex_subunits_status_r(void)
466{ 478{
467 return 0x00504238; 479 return 0x00504238;
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_proj_gv11b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_proj_gv11b.h
index 4e30447c..98acee4c 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_proj_gv11b.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_proj_gv11b.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -114,10 +114,6 @@ static inline u32 proj_host_num_pbdma_v(void)
114{ 114{
115 return 0x00000003; 115 return 0x00000003;
116} 116}
117static inline u32 proj_litter_num_subctx_v(void)
118{
119 return 0x00000040;
120}
121static inline u32 proj_scal_litter_num_tpc_per_gpc_v(void) 117static inline u32 proj_scal_litter_num_tpc_per_gpc_v(void)
122{ 118{
123 return 0x00000004; 119 return 0x00000004;