diff options
author | seshendra Gadagottu <sgadagottu@nvidia.com> | 2018-06-14 15:41:03 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-06-25 13:54:56 -0400 |
commit | a012527dbde6308bc158d17cace96d2a2e9fdcfd (patch) | |
tree | 51004fc8133c4599829effe501b18dba3a92d910 | |
parent | cd6e821cf66837a2c3479e928414007064b9c496 (diff) |
gpu: nvgpu: gv11b: fix fb flush issue
membar.sys does synchronization with the whole system (GPU and CPU),
membar.gl does synchronization within the GPU.
In gv11b, fb flush is generating membar.gl instead of membar.sys, which
is an issue. To fix this issue. following WAR is used:
1. Use bar1 engine id and bind it to a particular pdb,
2. Then instead of a fb_flush, issue a tlb invalidate of the bar1 pdb.
Now allocation of vm for bar1 instance block and bar1 binding is done
without check for bar1 support. Only bar1 register mapping is done
based on bar1 support enabled.
Bug 2112790
Change-Id: I76f43f1178a68f10823d48bc9da55d2bd686dd52
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1750257
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/mm.c | 15 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/mm_gv11b.c | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | 3 |
4 files changed, 15 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/mm.c b/drivers/gpu/nvgpu/common/mm/mm.c index c9b2b493..30e7351c 100644 --- a/drivers/gpu/nvgpu/common/mm/mm.c +++ b/drivers/gpu/nvgpu/common/mm/mm.c | |||
@@ -159,10 +159,8 @@ static void nvgpu_remove_mm_support(struct mm_gk20a *mm) | |||
159 | if (g->ops.mm.remove_bar2_vm) | 159 | if (g->ops.mm.remove_bar2_vm) |
160 | g->ops.mm.remove_bar2_vm(g); | 160 | g->ops.mm.remove_bar2_vm(g); |
161 | 161 | ||
162 | if (g->ops.mm.is_bar1_supported(g)) { | 162 | nvgpu_free_inst_block(g, &mm->bar1.inst_block); |
163 | nvgpu_free_inst_block(g, &mm->bar1.inst_block); | 163 | nvgpu_vm_put(mm->bar1.vm); |
164 | nvgpu_vm_put(mm->bar1.vm); | ||
165 | } | ||
166 | 164 | ||
167 | nvgpu_free_inst_block(g, &mm->pmu.inst_block); | 165 | nvgpu_free_inst_block(g, &mm->pmu.inst_block); |
168 | nvgpu_free_inst_block(g, &mm->hwpm.inst_block); | 166 | nvgpu_free_inst_block(g, &mm->hwpm.inst_block); |
@@ -377,11 +375,10 @@ static int nvgpu_init_mm_setup_sw(struct gk20a *g) | |||
377 | if (err) | 375 | if (err) |
378 | return err; | 376 | return err; |
379 | 377 | ||
380 | if (g->ops.mm.is_bar1_supported(g)) { | 378 | err = nvgpu_init_bar1_vm(mm); |
381 | err = nvgpu_init_bar1_vm(mm); | 379 | if (err) |
382 | if (err) | 380 | return err; |
383 | return err; | 381 | |
384 | } | ||
385 | if (g->ops.mm.init_bar2_vm) { | 382 | if (g->ops.mm.init_bar2_vm) { |
386 | err = g->ops.mm.init_bar2_vm(g); | 383 | err = g->ops.mm.init_bar2_vm(g); |
387 | if (err) | 384 | if (err) |
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 1a7f0874..87775a3f 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include "common/bus/bus_gk20a.h" | 25 | #include "common/bus/bus_gk20a.h" |
26 | #include "common/bus/bus_gp10b.h" | 26 | #include "common/bus/bus_gp10b.h" |
27 | #include "common/bus/bus_gm20b.h" | ||
27 | #include "common/clock_gating/gv11b_gating_reglist.h" | 28 | #include "common/clock_gating/gv11b_gating_reglist.h" |
28 | #include "common/ptimer/ptimer_gk20a.h" | 29 | #include "common/ptimer/ptimer_gk20a.h" |
29 | 30 | ||
@@ -745,7 +746,7 @@ static const struct gpu_ops gv11b_ops = { | |||
745 | .bus = { | 746 | .bus = { |
746 | .init_hw = gk20a_bus_init_hw, | 747 | .init_hw = gk20a_bus_init_hw, |
747 | .isr = gk20a_bus_isr, | 748 | .isr = gk20a_bus_isr, |
748 | .bar1_bind = NULL, | 749 | .bar1_bind = gm20b_bus_bar1_bind, |
749 | .bar2_bind = gp10b_bus_bar2_bind, | 750 | .bar2_bind = gp10b_bus_bar2_bind, |
750 | .set_bar0_window = gk20a_bus_set_bar0_window, | 751 | .set_bar0_window = gk20a_bus_set_bar0_window, |
751 | }, | 752 | }, |
diff --git a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c index e1d90829..0cf08d4a 100644 --- a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c | |||
@@ -249,7 +249,11 @@ void gv11b_mm_l2_flush(struct gk20a *g, bool invalidate) | |||
249 | 249 | ||
250 | g->ops.mm.fb_flush(g); | 250 | g->ops.mm.fb_flush(g); |
251 | gk20a_mm_l2_flush(g, invalidate); | 251 | gk20a_mm_l2_flush(g, invalidate); |
252 | g->ops.mm.fb_flush(g); | 252 | if (g->ops.bus.bar1_bind) |
253 | g->ops.fb.tlb_invalidate(g, | ||
254 | g->mm.bar1.vm->pdb.mem); | ||
255 | else | ||
256 | g->ops.mm.fb_flush(g); | ||
253 | } | 257 | } |
254 | 258 | ||
255 | /* | 259 | /* |
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index fd408e3a..2b65c992 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | |||
@@ -21,6 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include "common/bus/bus_gk20a.h" | 23 | #include "common/bus/bus_gk20a.h" |
24 | #include "common/bus/bus_gm20b.h" | ||
24 | #include "common/clock_gating/gv11b_gating_reglist.h" | 25 | #include "common/clock_gating/gv11b_gating_reglist.h" |
25 | 26 | ||
26 | #include <gk20a/gk20a.h> | 27 | #include <gk20a/gk20a.h> |
@@ -597,7 +598,7 @@ static const struct gpu_ops vgpu_gv11b_ops = { | |||
597 | .bus = { | 598 | .bus = { |
598 | .init_hw = gk20a_bus_init_hw, | 599 | .init_hw = gk20a_bus_init_hw, |
599 | .isr = gk20a_bus_isr, | 600 | .isr = gk20a_bus_isr, |
600 | .bar1_bind = NULL, | 601 | .bar1_bind = gm20b_bus_bar1_bind, |
601 | .bar2_bind = NULL, | 602 | .bar2_bind = NULL, |
602 | .set_bar0_window = gk20a_bus_set_bar0_window, | 603 | .set_bar0_window = gk20a_bus_set_bar0_window, |
603 | }, | 604 | }, |