diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 13 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 3d93ccde..edf1d548 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -130,6 +130,7 @@ struct gpu_ops { | |||
130 | struct gk20a_ctxsw_ucode_segments *segments, | 130 | struct gk20a_ctxsw_ucode_segments *segments, |
131 | u32 reg_offset); | 131 | u32 reg_offset); |
132 | int (*load_ctxsw_ucode)(struct gk20a *g); | 132 | int (*load_ctxsw_ucode)(struct gk20a *g); |
133 | u32 (*get_gpc_tpc_mask)(struct gk20a *g, u32 gpc_index); | ||
133 | } gr; | 134 | } gr; |
134 | const char *name; | 135 | const char *name; |
135 | struct { | 136 | struct { |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 8d35dd80..3298a383 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -1347,6 +1347,12 @@ static int gr_gk20a_setup_alpha_beta_tables(struct gk20a *g, | |||
1347 | return 0; | 1347 | return 0; |
1348 | } | 1348 | } |
1349 | 1349 | ||
1350 | static u32 gr_gk20a_get_gpc_tpc_mask(struct gk20a *g, u32 gpc_index) | ||
1351 | { | ||
1352 | /* One TPC for gk20a */ | ||
1353 | return 0x1; | ||
1354 | } | ||
1355 | |||
1350 | static int gr_gk20a_ctx_state_floorsweep(struct gk20a *g) | 1356 | static int gr_gk20a_ctx_state_floorsweep(struct gk20a *g) |
1351 | { | 1357 | { |
1352 | struct gr_gk20a *gr = &g->gr; | 1358 | struct gr_gk20a *gr = &g->gr; |
@@ -3071,6 +3077,7 @@ static int gr_gk20a_init_gr_config(struct gk20a *g, struct gr_gk20a *gr) | |||
3071 | } | 3077 | } |
3072 | 3078 | ||
3073 | gr->gpc_tpc_count = kzalloc(gr->gpc_count * sizeof(u32), GFP_KERNEL); | 3079 | gr->gpc_tpc_count = kzalloc(gr->gpc_count * sizeof(u32), GFP_KERNEL); |
3080 | gr->gpc_tpc_mask = kzalloc(gr->gpc_count * sizeof(u32), GFP_KERNEL); | ||
3074 | gr->gpc_zcb_count = kzalloc(gr->gpc_count * sizeof(u32), GFP_KERNEL); | 3081 | gr->gpc_zcb_count = kzalloc(gr->gpc_count * sizeof(u32), GFP_KERNEL); |
3075 | gr->gpc_ppc_count = kzalloc(gr->gpc_count * sizeof(u32), GFP_KERNEL); | 3082 | gr->gpc_ppc_count = kzalloc(gr->gpc_count * sizeof(u32), GFP_KERNEL); |
3076 | gr->pes_tpc_count[0] = kzalloc(gr->gpc_count * sizeof(u32), GFP_KERNEL); | 3083 | gr->pes_tpc_count[0] = kzalloc(gr->gpc_count * sizeof(u32), GFP_KERNEL); |
@@ -3100,6 +3107,11 @@ static int gr_gk20a_init_gr_config(struct gk20a *g, struct gr_gk20a *gr) | |||
3100 | 3107 | ||
3101 | gr->gpc_ppc_count[gpc_index] = gr->pe_count_per_gpc; | 3108 | gr->gpc_ppc_count[gpc_index] = gr->pe_count_per_gpc; |
3102 | gr->ppc_count += gr->gpc_ppc_count[gpc_index]; | 3109 | gr->ppc_count += gr->gpc_ppc_count[gpc_index]; |
3110 | |||
3111 | if (g->ops.gr.get_gpc_tpc_mask) | ||
3112 | gr->gpc_tpc_mask[gpc_index] = | ||
3113 | g->ops.gr.get_gpc_tpc_mask(g, gpc_index); | ||
3114 | |||
3103 | for (pes_index = 0; pes_index < gr->pe_count_per_gpc; pes_index++) { | 3115 | for (pes_index = 0; pes_index < gr->pe_count_per_gpc; pes_index++) { |
3104 | 3116 | ||
3105 | tmp = gk20a_readl(g, | 3117 | tmp = gk20a_readl(g, |
@@ -6995,4 +7007,5 @@ void gk20a_init_gr_ops(struct gpu_ops *gops) | |||
6995 | gops->gr.setup_alpha_beta_tables = gr_gk20a_setup_alpha_beta_tables; | 7007 | gops->gr.setup_alpha_beta_tables = gr_gk20a_setup_alpha_beta_tables; |
6996 | gops->gr.falcon_load_ucode = gr_gk20a_load_ctxsw_ucode_segments; | 7008 | gops->gr.falcon_load_ucode = gr_gk20a_load_ctxsw_ucode_segments; |
6997 | gops->gr.load_ctxsw_ucode = gr_gk20a_load_ctxsw_ucode; | 7009 | gops->gr.load_ctxsw_ucode = gr_gk20a_load_ctxsw_ucode; |
7010 | gops->gr.get_gpc_tpc_mask = gr_gk20a_get_gpc_tpc_mask; | ||
6998 | } | 7011 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index d4f7bc70..f60afd58 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h | |||
@@ -227,6 +227,7 @@ struct gr_gk20a { | |||
227 | u32 *gpc_ppc_count; | 227 | u32 *gpc_ppc_count; |
228 | u32 tpc_count; | 228 | u32 tpc_count; |
229 | u32 *gpc_tpc_count; | 229 | u32 *gpc_tpc_count; |
230 | u32 *gpc_tpc_mask; | ||
230 | u32 zcb_count; | 231 | u32 zcb_count; |
231 | u32 *gpc_zcb_count; | 232 | u32 *gpc_zcb_count; |
232 | u32 *pes_tpc_count[2]; | 233 | u32 *pes_tpc_count[2]; |