summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv100
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gv100')
-rw-r--r--drivers/gpu/nvgpu/gv100/gr_gv100.c11
1 files changed, 8 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
374static u32 gr_gv100_get_active_fpba_mask(struct gk20a *g, u32 num_fbpas) 375static 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)) {