diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/Makefile | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/fb/fb_gv11b.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/ltc.c | 17 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/posix/stubs.c | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/ltc.c | 45 |
5 files changed, 55 insertions, 18 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 6b327bce..823a997e 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile | |||
@@ -69,7 +69,8 @@ nvgpu-y += \ | |||
69 | os/linux/os_sched.o \ | 69 | os/linux/os_sched.o \ |
70 | os/linux/nvlink.o \ | 70 | os/linux/nvlink.o \ |
71 | os/linux/dt.o \ | 71 | os/linux/dt.o \ |
72 | os/linux/ecc_sysfs.o | 72 | os/linux/ecc_sysfs.o \ |
73 | os/linux/ltc.o | ||
73 | 74 | ||
74 | nvgpu-$(CONFIG_GK20A_VIDMEM) += \ | 75 | nvgpu-$(CONFIG_GK20A_VIDMEM) += \ |
75 | os/linux/dmabuf_vidmem.o | 76 | os/linux/dmabuf_vidmem.o |
diff --git a/drivers/gpu/nvgpu/common/fb/fb_gv11b.c b/drivers/gpu/nvgpu/common/fb/fb_gv11b.c index 664b2dd1..6973e04d 100644 --- a/drivers/gpu/nvgpu/common/fb/fb_gv11b.c +++ b/drivers/gpu/nvgpu/common/fb/fb_gv11b.c | |||
@@ -102,6 +102,8 @@ void gv11b_fb_init_cbc(struct gk20a *g, struct gr_gk20a *gr) | |||
102 | else | 102 | else |
103 | compbit_store_iova = nvgpu_mem_get_addr(g, | 103 | compbit_store_iova = nvgpu_mem_get_addr(g, |
104 | &gr->compbit_store.mem); | 104 | &gr->compbit_store.mem); |
105 | /* must be aligned to 64 KB */ | ||
106 | compbit_store_iova = roundup(compbit_store_iova, (u64)SZ_64K); | ||
105 | 107 | ||
106 | compbit_base_post_divide64 = compbit_store_iova >> | 108 | compbit_base_post_divide64 = compbit_store_iova >> |
107 | fb_mmu_cbc_base_address_alignment_shift_v(); | 109 | fb_mmu_cbc_base_address_alignment_shift_v(); |
diff --git a/drivers/gpu/nvgpu/common/ltc.c b/drivers/gpu/nvgpu/common/ltc.c index dec4a80c..1beb1974 100644 --- a/drivers/gpu/nvgpu/common/ltc.c +++ b/drivers/gpu/nvgpu/common/ltc.c | |||
@@ -52,20 +52,3 @@ void nvgpu_ltc_sync_enabled(struct gk20a *g) | |||
52 | } | 52 | } |
53 | nvgpu_spinlock_release(&g->ltc_enabled_lock); | 53 | nvgpu_spinlock_release(&g->ltc_enabled_lock); |
54 | } | 54 | } |
55 | |||
56 | int nvgpu_ltc_alloc_cbc(struct gk20a *g, size_t compbit_backing_size) | ||
57 | { | ||
58 | struct gr_gk20a *gr = &g->gr; | ||
59 | unsigned long flags = 0; | ||
60 | |||
61 | if (nvgpu_mem_is_valid(&gr->compbit_store.mem)) | ||
62 | return 0; | ||
63 | |||
64 | if (!nvgpu_iommuable(g)) | ||
65 | flags = NVGPU_DMA_FORCE_CONTIGUOUS; | ||
66 | |||
67 | return nvgpu_dma_alloc_flags_sys(g, | ||
68 | flags, | ||
69 | compbit_backing_size, | ||
70 | &gr->compbit_store.mem); | ||
71 | } | ||
diff --git a/drivers/gpu/nvgpu/common/posix/stubs.c b/drivers/gpu/nvgpu/common/posix/stubs.c index 0fa80bff..1e50930a 100644 --- a/drivers/gpu/nvgpu/common/posix/stubs.c +++ b/drivers/gpu/nvgpu/common/posix/stubs.c | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <nvgpu/ecc.h> | 28 | #include <nvgpu/ecc.h> |
29 | #include <nvgpu/ltc.h> | ||
29 | 30 | ||
30 | #include "gk20a/dbg_gpu_gk20a.h" | 31 | #include "gk20a/dbg_gpu_gk20a.h" |
31 | 32 | ||
@@ -41,3 +42,8 @@ int nvgpu_ecc_sysfs_init(struct gk20a *g) | |||
41 | void nvgpu_ecc_sysfs_remove(struct gk20a *g) | 42 | void nvgpu_ecc_sysfs_remove(struct gk20a *g) |
42 | { | 43 | { |
43 | } | 44 | } |
45 | |||
46 | int nvgpu_ltc_alloc_cbc(struct gk20a *g, size_t compbit_backing_size) | ||
47 | { | ||
48 | return 0; | ||
49 | } | ||
diff --git a/drivers/gpu/nvgpu/os/linux/ltc.c b/drivers/gpu/nvgpu/os/linux/ltc.c new file mode 100644 index 00000000..1a58bc4e --- /dev/null +++ b/drivers/gpu/nvgpu/os/linux/ltc.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | * DEALINGS IN THE SOFTWARE. | ||
21 | */ | ||
22 | |||
23 | #include <nvgpu/ltc.h> | ||
24 | #include <nvgpu/dma.h> | ||
25 | #include <nvgpu/nvgpu_mem.h> | ||
26 | |||
27 | #include "gk20a/gk20a.h" | ||
28 | #include "gk20a/gr_gk20a.h" | ||
29 | |||
30 | int nvgpu_ltc_alloc_cbc(struct gk20a *g, size_t compbit_backing_size) | ||
31 | { | ||
32 | struct gr_gk20a *gr = &g->gr; | ||
33 | unsigned long flags = 0; | ||
34 | |||
35 | if (nvgpu_mem_is_valid(&gr->compbit_store.mem)) | ||
36 | return 0; | ||
37 | |||
38 | if (!nvgpu_iommuable(g)) | ||
39 | flags = NVGPU_DMA_FORCE_CONTIGUOUS; | ||
40 | |||
41 | return nvgpu_dma_alloc_flags_sys(g, | ||
42 | flags, | ||
43 | compbit_backing_size, | ||
44 | &gr->compbit_store.mem); | ||
45 | } | ||