diff options
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/dma.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/dmabuf.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c (renamed from drivers/gpu/nvgpu/os/linux/vidmem.c) | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.h | 78 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/ioctl_dbg.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/nvgpu_mem.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/vm.c | 2 |
8 files changed, 85 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/dma.c b/drivers/gpu/nvgpu/os/linux/dma.c index 6f17e284..86a17a7e 100644 --- a/drivers/gpu/nvgpu/os/linux/dma.c +++ b/drivers/gpu/nvgpu/os/linux/dma.c | |||
@@ -27,12 +27,12 @@ | |||
27 | #include <nvgpu/vidmem.h> | 27 | #include <nvgpu/vidmem.h> |
28 | 28 | ||
29 | #include <nvgpu/linux/dma.h> | 29 | #include <nvgpu/linux/dma.h> |
30 | #include <nvgpu/linux/vidmem.h> | ||
31 | 30 | ||
32 | #include "gk20a/gk20a.h" | 31 | #include "gk20a/gk20a.h" |
33 | 32 | ||
34 | #include "platform_gk20a.h" | 33 | #include "platform_gk20a.h" |
35 | #include "os_linux.h" | 34 | #include "os_linux.h" |
35 | #include "dmabuf_vidmem.h" | ||
36 | 36 | ||
37 | #ifdef __DMA_ATTRS_LONGS | 37 | #ifdef __DMA_ATTRS_LONGS |
38 | #define NVGPU_DEFINE_DMA_ATTRS(x) \ | 38 | #define NVGPU_DEFINE_DMA_ATTRS(x) \ |
diff --git a/drivers/gpu/nvgpu/os/linux/dmabuf.c b/drivers/gpu/nvgpu/os/linux/dmabuf.c index 129739f0..6f07e88a 100644 --- a/drivers/gpu/nvgpu/os/linux/dmabuf.c +++ b/drivers/gpu/nvgpu/os/linux/dmabuf.c | |||
@@ -22,13 +22,13 @@ | |||
22 | #include <nvgpu/enabled.h> | 22 | #include <nvgpu/enabled.h> |
23 | 23 | ||
24 | #include <nvgpu/linux/vm.h> | 24 | #include <nvgpu/linux/vm.h> |
25 | #include <nvgpu/linux/vidmem.h> | ||
26 | 25 | ||
27 | #include "gk20a/gk20a.h" | 26 | #include "gk20a/gk20a.h" |
28 | 27 | ||
29 | #include "platform_gk20a.h" | 28 | #include "platform_gk20a.h" |
30 | #include "dmabuf.h" | 29 | #include "dmabuf.h" |
31 | #include "os_linux.h" | 30 | #include "os_linux.h" |
31 | #include "dmabuf_vidmem.h" | ||
32 | 32 | ||
33 | static void gk20a_mm_delete_priv(void *_priv) | 33 | static void gk20a_mm_delete_priv(void *_priv) |
34 | { | 34 | { |
diff --git a/drivers/gpu/nvgpu/os/linux/vidmem.c b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c index df1a905d..572c2b0f 100644 --- a/drivers/gpu/nvgpu/os/linux/vidmem.c +++ b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c | |||
@@ -30,10 +30,10 @@ | |||
30 | 30 | ||
31 | #include <nvgpu/linux/vm.h> | 31 | #include <nvgpu/linux/vm.h> |
32 | #include <nvgpu/linux/dma.h> | 32 | #include <nvgpu/linux/dma.h> |
33 | #include <nvgpu/linux/vidmem.h> | ||
34 | 33 | ||
35 | #include "gk20a/gk20a.h" | 34 | #include "gk20a/gk20a.h" |
36 | #include "gk20a/mm_gk20a.h" | 35 | #include "gk20a/mm_gk20a.h" |
36 | #include "dmabuf_vidmem.h" | ||
37 | 37 | ||
38 | bool nvgpu_addr_is_vidmem_page_alloc(u64 addr) | 38 | bool nvgpu_addr_is_vidmem_page_alloc(u64 addr) |
39 | { | 39 | { |
diff --git a/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.h b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.h new file mode 100644 index 00000000..977fd78b --- /dev/null +++ b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.h | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017-2018, 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_LINUX_DMABUF_VIDMEM_H__ | ||
18 | #define __NVGPU_LINUX_DMABUF_VIDMEM_H__ | ||
19 | |||
20 | #include <nvgpu/types.h> | ||
21 | |||
22 | struct dma_buf; | ||
23 | |||
24 | struct gk20a; | ||
25 | struct scatterlist; | ||
26 | |||
27 | #ifdef CONFIG_GK20A_VIDMEM | ||
28 | |||
29 | struct gk20a *nvgpu_vidmem_buf_owner(struct dma_buf *dmabuf); | ||
30 | int nvgpu_vidmem_export_linux(struct gk20a *g, size_t bytes); | ||
31 | |||
32 | void nvgpu_vidmem_set_page_alloc(struct scatterlist *sgl, u64 addr); | ||
33 | struct nvgpu_page_alloc *nvgpu_vidmem_get_page_alloc(struct scatterlist *sgl); | ||
34 | |||
35 | int nvgpu_vidmem_buf_access_memory(struct gk20a *g, struct dma_buf *dmabuf, | ||
36 | void *buffer, u64 offset, u64 size, u32 cmd); | ||
37 | |||
38 | #else /* !CONFIG_GK20A_VIDMEM */ | ||
39 | |||
40 | static inline struct gk20a *nvgpu_vidmem_buf_owner(struct dma_buf *dmabuf) | ||
41 | { | ||
42 | return NULL; | ||
43 | } | ||
44 | |||
45 | static inline int nvgpu_vidmem_export_linux(struct gk20a *g, size_t bytes) | ||
46 | { | ||
47 | return -ENOSYS; | ||
48 | } | ||
49 | |||
50 | static inline void nvgpu_vidmem_set_page_alloc(struct scatterlist *sgl, | ||
51 | u64 addr) | ||
52 | { | ||
53 | } | ||
54 | |||
55 | static inline struct nvgpu_page_alloc *nvgpu_vidmem_get_page_alloc( | ||
56 | struct scatterlist *sgl) | ||
57 | { | ||
58 | return NULL; | ||
59 | } | ||
60 | |||
61 | static inline int nvgpu_vidmem_buf_access_memory(struct gk20a *g, | ||
62 | struct dma_buf *dmabuf, | ||
63 | void *buffer, u64 offset, | ||
64 | u64 size, u32 cmd) | ||
65 | { | ||
66 | return -ENOSYS; | ||
67 | } | ||
68 | |||
69 | #endif | ||
70 | |||
71 | |||
72 | struct nvgpu_vidmem_linux { | ||
73 | struct dma_buf *dmabuf; | ||
74 | void *dmabuf_priv; | ||
75 | void (*dmabuf_priv_delete)(void *); | ||
76 | }; | ||
77 | |||
78 | #endif | ||
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index f9ad8082..17f1e923 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | |||
@@ -30,8 +30,6 @@ | |||
30 | #include <nvgpu/enabled.h> | 30 | #include <nvgpu/enabled.h> |
31 | #include <nvgpu/sizes.h> | 31 | #include <nvgpu/sizes.h> |
32 | 32 | ||
33 | #include <nvgpu/linux/vidmem.h> | ||
34 | |||
35 | #include "ioctl_ctrl.h" | 33 | #include "ioctl_ctrl.h" |
36 | #include "ioctl_dbg.h" | 34 | #include "ioctl_dbg.h" |
37 | #include "ioctl_as.h" | 35 | #include "ioctl_as.h" |
@@ -44,6 +42,7 @@ | |||
44 | #include "os_linux.h" | 42 | #include "os_linux.h" |
45 | #include "dmabuf.h" | 43 | #include "dmabuf.h" |
46 | #include "channel.h" | 44 | #include "channel.h" |
45 | #include "dmabuf_vidmem.h" | ||
47 | 46 | ||
48 | #define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \ | 47 | #define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \ |
49 | (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) | 48 | (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) |
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c index 3156837b..9c7608e9 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <nvgpu/atomic.h> | 30 | #include <nvgpu/atomic.h> |
31 | #include <nvgpu/cond.h> | 31 | #include <nvgpu/cond.h> |
32 | 32 | ||
33 | #include <nvgpu/linux/vidmem.h> | ||
34 | #include <nvgpu/linux/vm.h> | 33 | #include <nvgpu/linux/vm.h> |
35 | 34 | ||
36 | #include "gk20a/gk20a.h" | 35 | #include "gk20a/gk20a.h" |
@@ -40,6 +39,7 @@ | |||
40 | #include "os_linux.h" | 39 | #include "os_linux.h" |
41 | #include "platform_gk20a.h" | 40 | #include "platform_gk20a.h" |
42 | #include "ioctl_dbg.h" | 41 | #include "ioctl_dbg.h" |
42 | #include "dmabuf_vidmem.h" | ||
43 | 43 | ||
44 | struct dbg_session_gk20a_linux { | 44 | struct dbg_session_gk20a_linux { |
45 | struct device *dev; | 45 | struct device *dev; |
diff --git a/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c b/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c index aa8fcd84..4fc95db9 100644 --- a/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c +++ b/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c | |||
@@ -25,12 +25,12 @@ | |||
25 | #include <nvgpu/vidmem.h> | 25 | #include <nvgpu/vidmem.h> |
26 | 26 | ||
27 | #include <nvgpu/linux/dma.h> | 27 | #include <nvgpu/linux/dma.h> |
28 | #include <nvgpu/linux/vidmem.h> | ||
29 | 28 | ||
30 | #include <linux/vmalloc.h> | 29 | #include <linux/vmalloc.h> |
31 | #include <linux/dma-mapping.h> | 30 | #include <linux/dma-mapping.h> |
32 | 31 | ||
33 | #include "os_linux.h" | 32 | #include "os_linux.h" |
33 | #include "dmabuf_vidmem.h" | ||
34 | 34 | ||
35 | #include "gk20a/gk20a.h" | 35 | #include "gk20a/gk20a.h" |
36 | #include "gk20a/mm_gk20a.h" | 36 | #include "gk20a/mm_gk20a.h" |
diff --git a/drivers/gpu/nvgpu/os/linux/vm.c b/drivers/gpu/nvgpu/os/linux/vm.c index eb9ca8fd..2b5ed103 100644 --- a/drivers/gpu/nvgpu/os/linux/vm.c +++ b/drivers/gpu/nvgpu/os/linux/vm.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <nvgpu/vidmem.h> | 27 | #include <nvgpu/vidmem.h> |
28 | 28 | ||
29 | #include <nvgpu/linux/vm.h> | 29 | #include <nvgpu/linux/vm.h> |
30 | #include <nvgpu/linux/vidmem.h> | ||
31 | #include <nvgpu/linux/nvgpu_mem.h> | 30 | #include <nvgpu/linux/nvgpu_mem.h> |
32 | 31 | ||
33 | #include "gk20a/gk20a.h" | 32 | #include "gk20a/gk20a.h" |
@@ -36,6 +35,7 @@ | |||
36 | #include "platform_gk20a.h" | 35 | #include "platform_gk20a.h" |
37 | #include "os_linux.h" | 36 | #include "os_linux.h" |
38 | #include "dmabuf.h" | 37 | #include "dmabuf.h" |
38 | #include "dmabuf_vidmem.h" | ||
39 | 39 | ||
40 | static u32 nvgpu_vm_translate_linux_flags(struct gk20a *g, u32 flags) | 40 | static u32 nvgpu_vm_translate_linux_flags(struct gk20a *g, u32 flags) |
41 | { | 41 | { |