diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 15 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index e40f296e..4dfddf5d 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -3196,10 +3196,10 @@ static int gr_gk20a_init_gr_config(struct gk20a *g, struct gr_gk20a *gr) | |||
3196 | sizeof(u32)); | 3196 | sizeof(u32)); |
3197 | 3197 | ||
3198 | if (gr->gpc_tpc_mask == NULL) | 3198 | if (gr->gpc_tpc_mask == NULL) |
3199 | gr->gpc_tpc_mask = nvgpu_kzalloc(g, gr->gpc_count * | 3199 | gr->gpc_tpc_mask = nvgpu_kzalloc(g, gr->max_gpc_count * |
3200 | sizeof(u32)); | 3200 | sizeof(u32)); |
3201 | else | 3201 | else |
3202 | memset(gr->gpc_tpc_mask, 0, gr->gpc_count * | 3202 | memset(gr->gpc_tpc_mask, 0, gr->max_gpc_count * |
3203 | sizeof(u32)); | 3203 | sizeof(u32)); |
3204 | 3204 | ||
3205 | if (gr->gpc_zcb_count == NULL) | 3205 | if (gr->gpc_zcb_count == NULL) |
@@ -3228,6 +3228,13 @@ static int gr_gk20a_init_gr_config(struct gk20a *g, struct gr_gk20a *gr) | |||
3228 | !gr->gpc_ppc_count || !gr->gpc_skip_mask) | 3228 | !gr->gpc_ppc_count || !gr->gpc_skip_mask) |
3229 | goto clean_up; | 3229 | goto clean_up; |
3230 | 3230 | ||
3231 | for (gpc_index = 0; gpc_index < gr->max_gpc_count; gpc_index++) { | ||
3232 | if (g->ops.gr.get_gpc_tpc_mask) { | ||
3233 | gr->gpc_tpc_mask[gpc_index] = | ||
3234 | g->ops.gr.get_gpc_tpc_mask(g, gpc_index); | ||
3235 | } | ||
3236 | } | ||
3237 | |||
3231 | gr->ppc_count = 0; | 3238 | gr->ppc_count = 0; |
3232 | gr->tpc_count = 0; | 3239 | gr->tpc_count = 0; |
3233 | gr->zcb_count = 0; | 3240 | gr->zcb_count = 0; |
@@ -3243,10 +3250,6 @@ static int gr_gk20a_init_gr_config(struct gk20a *g, struct gr_gk20a *gr) | |||
3243 | gr_gpc0_fs_gpc_num_available_zculls_v(tmp); | 3250 | gr_gpc0_fs_gpc_num_available_zculls_v(tmp); |
3244 | gr->zcb_count += gr->gpc_zcb_count[gpc_index]; | 3251 | gr->zcb_count += gr->gpc_zcb_count[gpc_index]; |
3245 | 3252 | ||
3246 | if (g->ops.gr.get_gpc_tpc_mask) | ||
3247 | gr->gpc_tpc_mask[gpc_index] = | ||
3248 | g->ops.gr.get_gpc_tpc_mask(g, gpc_index); | ||
3249 | |||
3250 | for (pes_index = 0; pes_index < gr->pe_count_per_gpc; pes_index++) { | 3253 | for (pes_index = 0; pes_index < gr->pe_count_per_gpc; pes_index++) { |
3251 | if (!gr->pes_tpc_count[pes_index]) { | 3254 | if (!gr->pes_tpc_count[pes_index]) { |
3252 | gr->pes_tpc_count[pes_index] = | 3255 | gr->pes_tpc_count[pes_index] = |
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index f7de17ad..e87d5822 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | |||
@@ -515,7 +515,7 @@ static int gk20a_ctrl_get_tpc_masks(struct gk20a *g, | |||
515 | { | 515 | { |
516 | struct gr_gk20a *gr = &g->gr; | 516 | struct gr_gk20a *gr = &g->gr; |
517 | int err = 0; | 517 | int err = 0; |
518 | const u32 gpc_tpc_mask_size = sizeof(u32) * gr->gpc_count; | 518 | const u32 gpc_tpc_mask_size = sizeof(u32) * gr->max_gpc_count; |
519 | 519 | ||
520 | if (args->mask_buf_size > 0) { | 520 | if (args->mask_buf_size > 0) { |
521 | size_t write_size = gpc_tpc_mask_size; | 521 | size_t write_size = gpc_tpc_mask_size; |