diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gv100/gr_gv100.c | 11 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/hw/gv100/hw_top_gv100.h | 8 |
2 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gv100/gr_gv100.c b/drivers/gpu/nvgpu/gv100/gr_gv100.c index 2180fa1c..680bcba3 100644 --- a/drivers/gpu/nvgpu/gv100/gr_gv100.c +++ b/drivers/gpu/nvgpu/gv100/gr_gv100.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <nvgpu/hw/gv100/hw_fb_gv100.h> | 37 | #include <nvgpu/hw/gv100/hw_fb_gv100.h> |
38 | #include <nvgpu/hw/gv100/hw_proj_gv100.h> | 38 | #include <nvgpu/hw/gv100/hw_proj_gv100.h> |
39 | #include <nvgpu/hw/gv100/hw_fuse_gv100.h> | 39 | #include <nvgpu/hw/gv100/hw_fuse_gv100.h> |
40 | #include <nvgpu/hw/gv100/hw_top_gv100.h> | ||
40 | 41 | ||
41 | 42 | ||
42 | /* | 43 | /* |
@@ -371,9 +372,13 @@ u32 gr_gv100_get_patch_slots(struct gk20a *g) | |||
371 | return size; | 372 | return size; |
372 | } | 373 | } |
373 | 374 | ||
374 | static u32 gr_gv100_get_active_fpba_mask(struct gk20a *g, u32 num_fbpas) | 375 | static u32 gr_gv100_get_active_fpba_mask(struct gk20a *g) |
375 | { | 376 | { |
376 | u32 active_fbpa_mask; | 377 | u32 active_fbpa_mask; |
378 | u32 num_fbpas, val; | ||
379 | |||
380 | val = nvgpu_readl(g, top_num_fbpas_r()); | ||
381 | num_fbpas = top_num_fbpas_value_v(val); | ||
377 | 382 | ||
378 | /* | 383 | /* |
379 | * Read active fbpa mask from fuse | 384 | * Read active fbpa mask from fuse |
@@ -404,7 +409,7 @@ int gr_gv100_add_ctxsw_reg_pm_fbpa(struct gk20a *g, | |||
404 | if ((cnt + (regs->count * num_fbpas)) > max_cnt) | 409 | if ((cnt + (regs->count * num_fbpas)) > max_cnt) |
405 | return -EINVAL; | 410 | return -EINVAL; |
406 | 411 | ||
407 | active_fbpa_mask = gr_gv100_get_active_fpba_mask(g, num_fbpas); | 412 | active_fbpa_mask = gr_gv100_get_active_fpba_mask(g); |
408 | 413 | ||
409 | for (idx = 0; idx < regs->count; idx++) { | 414 | for (idx = 0; idx < regs->count; idx++) { |
410 | for (fbpa_id = 0; fbpa_id < num_fbpas; fbpa_id++) { | 415 | for (fbpa_id = 0; fbpa_id < num_fbpas; fbpa_id++) { |
@@ -439,7 +444,7 @@ void gr_gv100_split_fbpa_broadcast_addr(struct gk20a *g, u32 addr, | |||
439 | u32 active_fbpa_mask; | 444 | u32 active_fbpa_mask; |
440 | u32 fbpa_id; | 445 | u32 fbpa_id; |
441 | 446 | ||
442 | active_fbpa_mask = gr_gv100_get_active_fpba_mask(g, num_fbpas); | 447 | active_fbpa_mask = gr_gv100_get_active_fpba_mask(g); |
443 | 448 | ||
444 | for (fbpa_id = 0; fbpa_id < num_fbpas; fbpa_id++) { | 449 | for (fbpa_id = 0; fbpa_id < num_fbpas; fbpa_id++) { |
445 | if (active_fbpa_mask & BIT(fbpa_id)) { | 450 | if (active_fbpa_mask & BIT(fbpa_id)) { |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gv100/hw_top_gv100.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gv100/hw_top_gv100.h index ff9c046c..506a8181 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gv100/hw_top_gv100.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gv100/hw_top_gv100.h | |||
@@ -80,6 +80,14 @@ static inline u32 top_num_fbps_value_v(u32 r) | |||
80 | { | 80 | { |
81 | return (r >> 0U) & 0x1fU; | 81 | return (r >> 0U) & 0x1fU; |
82 | } | 82 | } |
83 | static inline u32 top_num_fbpas_r(void) | ||
84 | { | ||
85 | return 0x0002243cU; | ||
86 | } | ||
87 | static inline u32 top_num_fbpas_value_v(u32 r) | ||
88 | { | ||
89 | return (r >> 0U) & 0x1fU; | ||
90 | } | ||
83 | static inline u32 top_ltc_per_fbp_r(void) | 91 | static inline u32 top_ltc_per_fbp_r(void) |
84 | { | 92 | { |
85 | return 0x00022450U; | 93 | return 0x00022450U; |