diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/Makefile | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/gmmu_t19x.c | 25 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/mm_gv11b.c | 17 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/gmmu_t19x.h | 28 |
4 files changed, 71 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 33391a80..6fdabe62 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile | |||
@@ -1,6 +1,7 @@ | |||
1 | nvgpu-t19x := ../../../../nvgpu-t19x/drivers/gpu/nvgpu | 1 | nvgpu-t19x := ../../../../nvgpu-t19x/drivers/gpu/nvgpu |
2 | 2 | ||
3 | nvgpu-y += \ | 3 | nvgpu-y += \ |
4 | $(nvgpu-t19x)/common/mm/gmmu_t19x.o \ | ||
4 | $(nvgpu-t19x)/common/linux/ioctl_tsg_t19x.o \ | 5 | $(nvgpu-t19x)/common/linux/ioctl_tsg_t19x.o \ |
5 | $(nvgpu-t19x)/gv11b/gv11b.o \ | 6 | $(nvgpu-t19x)/gv11b/gv11b.o \ |
6 | $(nvgpu-t19x)/gv11b/bus_gv11b.o \ | 7 | $(nvgpu-t19x)/gv11b/bus_gv11b.o \ |
diff --git a/drivers/gpu/nvgpu/common/mm/gmmu_t19x.c b/drivers/gpu/nvgpu/common/mm/gmmu_t19x.c new file mode 100644 index 00000000..05abec1b --- /dev/null +++ b/drivers/gpu/nvgpu/common/mm/gmmu_t19x.c | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #include <uapi/linux/nvgpu.h> | ||
18 | |||
19 | #include <nvgpu/gmmu.h> | ||
20 | |||
21 | void nvgpu_gmmu_add_t19x_attrs(struct nvgpu_gmmu_attrs *attrs, u32 flags) | ||
22 | { | ||
23 | attrs->t19x_attrs.l3_alloc = (bool)(flags & | ||
24 | NVGPU_AS_MAP_BUFFER_FLAGS_L3_ALLOC); | ||
25 | } | ||
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 | } |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/gmmu_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/gmmu_t19x.h new file mode 100644 index 00000000..8e1a4846 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/gmmu_t19x.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef __NVGPU_GMMU_T19X_H__ | ||
18 | #define __NVGPU_GMMU_T19X_H__ | ||
19 | |||
20 | struct nvgpu_gmmu_attrs; | ||
21 | |||
22 | struct nvgpu_gmmu_attrs_t19x { | ||
23 | bool l3_alloc; | ||
24 | }; | ||
25 | |||
26 | void nvgpu_gmmu_add_t19x_attrs(struct nvgpu_gmmu_attrs *attrs, u32 flags); | ||
27 | |||
28 | #endif | ||