diff options
author | Richard Zhao <rizhao@nvidia.com> | 2018-06-20 20:27:02 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-06-21 16:58:07 -0400 |
commit | c3b5b48c0fbecfb874d0fa4aa52286849bb36a5b (patch) | |
tree | 453ae0733cbdf1611a39d04ff50d533fbad31603 /drivers/gpu/nvgpu/gp10b/ltc_gp10b.c | |
parent | e4e2c1882865163ad53eeaf96acf83802ffbec71 (diff) |
gpu: nvgpu: move slices_per_ltc & cacheline_size init to floorsweeping
It was initialized at .init_comptags, but we may also need them without
comptags.
Jira NVGPUT-63
Change-Id: Ie818c3ecf890fc84323b9662a32d666a6d2b3936
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1756373
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/ltc_gp10b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/ltc_gp10b.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c index f74ca8f3..b0938f75 100644 --- a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c | |||
@@ -70,10 +70,6 @@ int gp10b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) | |||
70 | gk20a_readl(g, ltc_ltcs_ltss_cbc_param_r()); | 70 | gk20a_readl(g, ltc_ltcs_ltss_cbc_param_r()); |
71 | u32 comptags_per_cacheline = | 71 | u32 comptags_per_cacheline = |
72 | ltc_ltcs_ltss_cbc_param_comptags_per_cache_line_v(cbc_param); | 72 | ltc_ltcs_ltss_cbc_param_comptags_per_cache_line_v(cbc_param); |
73 | u32 cacheline_size = | ||
74 | 512U << ltc_ltcs_ltss_cbc_param_cache_line_size_v(cbc_param); | ||
75 | u32 slices_per_ltc = | ||
76 | ltc_ltcs_ltss_cbc_param_slices_per_ltc_v(cbc_param); | ||
77 | u32 cbc_param2 = | 73 | u32 cbc_param2 = |
78 | gk20a_readl(g, ltc_ltcs_ltss_cbc_param2_r()); | 74 | gk20a_readl(g, ltc_ltcs_ltss_cbc_param2_r()); |
79 | u32 gobs_per_comptagline_per_slice = | 75 | u32 gobs_per_comptagline_per_slice = |
@@ -89,7 +85,7 @@ int gp10b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) | |||
89 | return 0; | 85 | return 0; |
90 | 86 | ||
91 | /* Already initialized */ | 87 | /* Already initialized */ |
92 | if (gr->cacheline_size) | 88 | if (gr->max_comptag_lines) |
93 | return 0; | 89 | return 0; |
94 | 90 | ||
95 | if (max_comptag_lines > hw_max_comptag_lines) | 91 | if (max_comptag_lines > hw_max_comptag_lines) |
@@ -97,10 +93,10 @@ int gp10b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) | |||
97 | 93 | ||
98 | compbit_backing_size = | 94 | compbit_backing_size = |
99 | roundup(max_comptag_lines * gobs_per_comptagline_per_slice, | 95 | roundup(max_comptag_lines * gobs_per_comptagline_per_slice, |
100 | cacheline_size); | 96 | gr->cacheline_size); |
101 | compbit_backing_size = | 97 | compbit_backing_size = roundup( |
102 | roundup(compbit_backing_size * slices_per_ltc * g->ltc_count, | 98 | compbit_backing_size * gr->slices_per_ltc * g->ltc_count, |
103 | g->ops.fb.compressible_page_size(g)); | 99 | g->ops.fb.compressible_page_size(g)); |
104 | 100 | ||
105 | /* aligned to 2KB * ltc_count */ | 101 | /* aligned to 2KB * ltc_count */ |
106 | compbit_backing_size += | 102 | compbit_backing_size += |
@@ -126,8 +122,6 @@ int gp10b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) | |||
126 | 122 | ||
127 | gr->max_comptag_lines = max_comptag_lines; | 123 | gr->max_comptag_lines = max_comptag_lines; |
128 | gr->comptags_per_cacheline = comptags_per_cacheline; | 124 | gr->comptags_per_cacheline = comptags_per_cacheline; |
129 | gr->slices_per_ltc = slices_per_ltc; | ||
130 | gr->cacheline_size = cacheline_size; | ||
131 | gr->gobs_per_comptagline_per_slice = gobs_per_comptagline_per_slice; | 125 | gr->gobs_per_comptagline_per_slice = gobs_per_comptagline_per_slice; |
132 | 126 | ||
133 | return 0; | 127 | return 0; |