summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/mm_gv11b.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-07-03 07:10:44 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-07 10:05:39 -0400
commitafa31cdd8cc6bb04faeed30b2cc30f5e6be888b5 (patch)
tree6cc8c7c48bb86c77dc2b1bc6a59af0ca1cabbb7f /drivers/gpu/nvgpu/gv11b/mm_gv11b.c
parentcca0510e477944e8781184592a95debd7742262d (diff)
gpu: nvgpu: add support for L3 cache allocation of buffers
Add gv11b implementation of gpu_phys_addr() that checks the t19x GMMU attributes struct to determine if L3 allocation should be enabled. If L3 alloc is enabled then a special physical address bit is set. Add flag NVGPU_AS_MAP_BUFFER_FLAGS_L3_ALLOC to struct nvgpu_as_map_buffer_ex_args so that User space can add a hint to allocate buffer in L3 cache Jira GPUT19X-10 Bug 200279508 Change-Id: I1bb9876a670b252980922aa50e3e69b802be137f Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master/r/1512602 GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/mm_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/mm_gv11b.c17
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
26static bool gv11b_mm_is_bar1_supported(struct gk20a *g) 28static 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 */
71u64 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
64void gv11b_init_mm(struct gpu_ops *gops) 80void 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}