diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/mm_gv11b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/mm_gv11b.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c index 9d1e0f25..cc8dafa3 100644 --- a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c | |||
@@ -23,6 +23,8 @@ | |||
23 | 23 | ||
24 | #include <nvgpu/hw/gv11b/hw_fb_gv11b.h> | 24 | #include <nvgpu/hw/gv11b/hw_fb_gv11b.h> |
25 | 25 | ||
26 | #define NVGPU_L3_ALLOC_BIT 36 | ||
27 | |||
26 | static bool gv11b_mm_is_bar1_supported(struct gk20a *g) | 28 | static bool gv11b_mm_is_bar1_supported(struct gk20a *g) |
27 | { | 29 | { |
28 | return false; | 30 | return false; |
@@ -61,6 +63,20 @@ void gv11b_mm_l2_flush(struct gk20a *g, bool invalidate) | |||
61 | g->ops.mm.fb_flush(g); | 63 | g->ops.mm.fb_flush(g); |
62 | } | 64 | } |
63 | 65 | ||
66 | /* | ||
67 | * On Volta the GPU determines whether to do L3 allocation for a mapping by | ||
68 | * checking bit 36 of the phsyical address. So if a mapping should allocte lines | ||
69 | * in the L3 this bit must be set. | ||
70 | */ | ||
71 | u64 gv11b_gpu_phys_addr(struct gk20a *g, | ||
72 | struct nvgpu_gmmu_attrs *attrs, u64 phys) | ||
73 | { | ||
74 | if (attrs->t19x_attrs.l3_alloc) | ||
75 | return phys | NVGPU_L3_ALLOC_BIT; | ||
76 | |||
77 | return phys; | ||
78 | } | ||
79 | |||
64 | void gv11b_init_mm(struct gpu_ops *gops) | 80 | void gv11b_init_mm(struct gpu_ops *gops) |
65 | { | 81 | { |
66 | gp10b_init_mm(gops); | 82 | gp10b_init_mm(gops); |
@@ -69,4 +85,5 @@ void gv11b_init_mm(struct gpu_ops *gops) | |||
69 | gops->mm.init_mm_setup_hw = gk20a_init_mm_setup_hw; | 85 | gops->mm.init_mm_setup_hw = gk20a_init_mm_setup_hw; |
70 | gops->mm.mmu_fault_pending = gv11b_mm_mmu_fault_pending; | 86 | gops->mm.mmu_fault_pending = gv11b_mm_mmu_fault_pending; |
71 | gops->mm.l2_flush = gv11b_mm_l2_flush; | 87 | gops->mm.l2_flush = gv11b_mm_l2_flush; |
88 | gops->mm.gpu_phys_addr = gv11b_gpu_phys_addr; | ||
72 | } | 89 | } |