diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-09-07 18:27:55 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-18 19:00:37 -0400 |
commit | b3446bc0b6fca6cb992667f80a95f8503b6a652a (patch) | |
tree | 9882c36bfaef83da9d0a6eefec5e8c3564b93cea /drivers/gpu/nvgpu/common/linux | |
parent | bee9c830c7898ceebf8c396b40598350229a7203 (diff) |
gpu: nvgpu: Move dma_buf usage from mm_gk20a.c
Move most of the dma_buf usage present in the mm_gk20a.c code
out to Linux specific code and some commom/mm code. There's
two primary groups of code:
1. dma_buf priv field code (for holding comptag data)
2. Comptag usage that relies on dma_buf pointers
For (1) the dma_buf code was simply moved to common/linux/dmabuf.c
since most of this code is clearly Linux specific.
The comptag code was a bit more complicated since there is two
parts to the comptag code. Firstly there's the code that manages
the comptag memory. This is essentially a simple allocator. This
was moved to common/mm/comptags.c since it can be shared across
all chips. The second set of code is moved to
common/linux/comptags.c since it is the interface between dma_bufs
and the comptag memory.
Two other fixes were done as well:
- Add struct gk20a to the comptag allocator init so that
the proper nvgpu_vzalloc() function could be used.
- Add necessary includes to common/linux/vm_priv.h.
JIRA NVGPU-30
JIRA NVGPU-138
Change-Id: I96c57f2763e5ebe18a2f2ee4b33e0e1a2597848c
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1566628
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/cde.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/comptags.c | 70 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/dmabuf.c | 247 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/dmabuf.h | 73 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/vm.c | 29 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/vm_priv.h | 5 |
6 files changed, 392 insertions, 33 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/cde.c b/drivers/gpu/nvgpu/common/linux/cde.c index c3a9b770..577d86e8 100644 --- a/drivers/gpu/nvgpu/common/linux/cde.c +++ b/drivers/gpu/nvgpu/common/linux/cde.c | |||
@@ -39,6 +39,7 @@ | |||
39 | 39 | ||
40 | #include "cde.h" | 40 | #include "cde.h" |
41 | #include "os_linux.h" | 41 | #include "os_linux.h" |
42 | #include "dmabuf.h" | ||
42 | 43 | ||
43 | #include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h> | 44 | #include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h> |
44 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> | 45 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> |
diff --git a/drivers/gpu/nvgpu/common/linux/comptags.c b/drivers/gpu/nvgpu/common/linux/comptags.c new file mode 100644 index 00000000..517429d8 --- /dev/null +++ b/drivers/gpu/nvgpu/common/linux/comptags.c | |||
@@ -0,0 +1,70 @@ | |||
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 <linux/dma-buf.h> | ||
18 | |||
19 | #include <nvgpu/comptags.h> | ||
20 | |||
21 | #include "dmabuf.h" | ||
22 | |||
23 | void gk20a_get_comptags(struct device *dev, struct dma_buf *dmabuf, | ||
24 | struct gk20a_comptags *comptags) | ||
25 | { | ||
26 | struct gk20a_dmabuf_priv *priv = dma_buf_get_drvdata(dmabuf, dev); | ||
27 | |||
28 | if (!comptags) | ||
29 | return; | ||
30 | |||
31 | if (!priv) { | ||
32 | memset(comptags, 0, sizeof(*comptags)); | ||
33 | return; | ||
34 | } | ||
35 | |||
36 | *comptags = priv->comptags; | ||
37 | } | ||
38 | |||
39 | int gk20a_alloc_comptags(struct gk20a *g, | ||
40 | struct device *dev, | ||
41 | struct dma_buf *dmabuf, | ||
42 | struct gk20a_comptag_allocator *allocator, | ||
43 | u32 lines) | ||
44 | { | ||
45 | struct gk20a_dmabuf_priv *priv = dma_buf_get_drvdata(dmabuf, dev); | ||
46 | u32 ctaglines_allocsize; | ||
47 | u32 offset; | ||
48 | int err; | ||
49 | |||
50 | if (!priv) | ||
51 | return -ENOSYS; | ||
52 | |||
53 | if (!lines) | ||
54 | return -EINVAL; | ||
55 | |||
56 | ctaglines_allocsize = lines; | ||
57 | |||
58 | /* store the allocator so we can use it when we free the ctags */ | ||
59 | priv->comptag_allocator = allocator; | ||
60 | err = gk20a_comptaglines_alloc(allocator, &offset, | ||
61 | ctaglines_allocsize); | ||
62 | if (err) | ||
63 | return err; | ||
64 | |||
65 | priv->comptags.offset = offset; | ||
66 | priv->comptags.lines = lines; | ||
67 | priv->comptags.allocated_lines = ctaglines_allocsize; | ||
68 | |||
69 | return 0; | ||
70 | } | ||
diff --git a/drivers/gpu/nvgpu/common/linux/dmabuf.c b/drivers/gpu/nvgpu/common/linux/dmabuf.c new file mode 100644 index 00000000..0b07b255 --- /dev/null +++ b/drivers/gpu/nvgpu/common/linux/dmabuf.c | |||
@@ -0,0 +1,247 @@ | |||
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 <linux/device.h> | ||
18 | #include <linux/dma-buf.h> | ||
19 | #include <linux/scatterlist.h> | ||
20 | |||
21 | #include <nvgpu/comptags.h> | ||
22 | #include <nvgpu/enabled.h> | ||
23 | |||
24 | #include <nvgpu/linux/vidmem.h> | ||
25 | |||
26 | #include "gk20a/gk20a.h" | ||
27 | #include "gk20a/platform_gk20a.h" | ||
28 | |||
29 | #include "dmabuf.h" | ||
30 | #include "vm_priv.h" | ||
31 | #include "os_linux.h" | ||
32 | |||
33 | static void gk20a_mm_delete_priv(void *_priv) | ||
34 | { | ||
35 | struct gk20a_buffer_state *s, *s_tmp; | ||
36 | struct gk20a_dmabuf_priv *priv = _priv; | ||
37 | struct gk20a *g; | ||
38 | |||
39 | if (!priv) | ||
40 | return; | ||
41 | |||
42 | g = priv->g; | ||
43 | |||
44 | if (priv->comptags.lines) { | ||
45 | BUG_ON(!priv->comptag_allocator); | ||
46 | gk20a_comptaglines_free(priv->comptag_allocator, | ||
47 | priv->comptags.offset, | ||
48 | priv->comptags.allocated_lines); | ||
49 | } | ||
50 | |||
51 | /* Free buffer states */ | ||
52 | nvgpu_list_for_each_entry_safe(s, s_tmp, &priv->states, | ||
53 | gk20a_buffer_state, list) { | ||
54 | gk20a_fence_put(s->fence); | ||
55 | nvgpu_list_del(&s->list); | ||
56 | nvgpu_kfree(g, s); | ||
57 | } | ||
58 | |||
59 | nvgpu_kfree(g, priv); | ||
60 | } | ||
61 | |||
62 | enum nvgpu_aperture gk20a_dmabuf_aperture(struct gk20a *g, | ||
63 | struct dma_buf *dmabuf) | ||
64 | { | ||
65 | struct gk20a *buf_owner = nvgpu_vidmem_buf_owner(dmabuf); | ||
66 | bool unified_memory = nvgpu_is_enabled(g, NVGPU_MM_UNIFIED_MEMORY); | ||
67 | |||
68 | if (buf_owner == NULL) { | ||
69 | /* Not nvgpu-allocated, assume system memory */ | ||
70 | return APERTURE_SYSMEM; | ||
71 | } else if (WARN_ON(buf_owner == g && unified_memory)) { | ||
72 | /* Looks like our video memory, but this gpu doesn't support | ||
73 | * it. Warn about a bug and bail out */ | ||
74 | nvgpu_warn(g, | ||
75 | "dmabuf is our vidmem but we don't have local vidmem"); | ||
76 | return APERTURE_INVALID; | ||
77 | } else if (buf_owner != g) { | ||
78 | /* Someone else's vidmem */ | ||
79 | return APERTURE_INVALID; | ||
80 | } else { | ||
81 | /* Yay, buf_owner == g */ | ||
82 | return APERTURE_VIDMEM; | ||
83 | } | ||
84 | } | ||
85 | |||
86 | struct sg_table *gk20a_mm_pin(struct device *dev, struct dma_buf *dmabuf) | ||
87 | { | ||
88 | struct gk20a_dmabuf_priv *priv; | ||
89 | |||
90 | priv = dma_buf_get_drvdata(dmabuf, dev); | ||
91 | if (WARN_ON(!priv)) | ||
92 | return ERR_PTR(-EINVAL); | ||
93 | |||
94 | nvgpu_mutex_acquire(&priv->lock); | ||
95 | |||
96 | if (priv->pin_count == 0) { | ||
97 | priv->attach = dma_buf_attach(dmabuf, dev); | ||
98 | if (IS_ERR(priv->attach)) { | ||
99 | nvgpu_mutex_release(&priv->lock); | ||
100 | return (struct sg_table *)priv->attach; | ||
101 | } | ||
102 | |||
103 | priv->sgt = dma_buf_map_attachment(priv->attach, | ||
104 | DMA_BIDIRECTIONAL); | ||
105 | if (IS_ERR(priv->sgt)) { | ||
106 | dma_buf_detach(dmabuf, priv->attach); | ||
107 | nvgpu_mutex_release(&priv->lock); | ||
108 | return priv->sgt; | ||
109 | } | ||
110 | } | ||
111 | |||
112 | priv->pin_count++; | ||
113 | nvgpu_mutex_release(&priv->lock); | ||
114 | return priv->sgt; | ||
115 | } | ||
116 | |||
117 | void gk20a_mm_unpin(struct device *dev, struct dma_buf *dmabuf, | ||
118 | struct sg_table *sgt) | ||
119 | { | ||
120 | struct gk20a_dmabuf_priv *priv = dma_buf_get_drvdata(dmabuf, dev); | ||
121 | dma_addr_t dma_addr; | ||
122 | |||
123 | if (IS_ERR(priv) || !priv) | ||
124 | return; | ||
125 | |||
126 | nvgpu_mutex_acquire(&priv->lock); | ||
127 | WARN_ON(priv->sgt != sgt); | ||
128 | priv->pin_count--; | ||
129 | WARN_ON(priv->pin_count < 0); | ||
130 | dma_addr = sg_dma_address(priv->sgt->sgl); | ||
131 | if (priv->pin_count == 0) { | ||
132 | dma_buf_unmap_attachment(priv->attach, priv->sgt, | ||
133 | DMA_BIDIRECTIONAL); | ||
134 | dma_buf_detach(dmabuf, priv->attach); | ||
135 | } | ||
136 | nvgpu_mutex_release(&priv->lock); | ||
137 | } | ||
138 | |||
139 | int gk20a_dmabuf_alloc_drvdata(struct dma_buf *dmabuf, struct device *dev) | ||
140 | { | ||
141 | struct gk20a *g = gk20a_get_platform(dev)->g; | ||
142 | struct gk20a_dmabuf_priv *priv; | ||
143 | static u64 priv_count = 0; | ||
144 | |||
145 | priv = dma_buf_get_drvdata(dmabuf, dev); | ||
146 | if (likely(priv)) | ||
147 | return 0; | ||
148 | |||
149 | nvgpu_mutex_acquire(&g->mm.priv_lock); | ||
150 | priv = dma_buf_get_drvdata(dmabuf, dev); | ||
151 | if (priv) | ||
152 | goto priv_exist_or_err; | ||
153 | |||
154 | priv = nvgpu_kzalloc(g, sizeof(*priv)); | ||
155 | if (!priv) { | ||
156 | priv = ERR_PTR(-ENOMEM); | ||
157 | goto priv_exist_or_err; | ||
158 | } | ||
159 | |||
160 | nvgpu_mutex_init(&priv->lock); | ||
161 | nvgpu_init_list_node(&priv->states); | ||
162 | priv->buffer_id = ++priv_count; | ||
163 | priv->g = g; | ||
164 | dma_buf_set_drvdata(dmabuf, dev, priv, gk20a_mm_delete_priv); | ||
165 | |||
166 | priv_exist_or_err: | ||
167 | nvgpu_mutex_release(&g->mm.priv_lock); | ||
168 | if (IS_ERR(priv)) | ||
169 | return -ENOMEM; | ||
170 | |||
171 | return 0; | ||
172 | } | ||
173 | |||
174 | int gk20a_dmabuf_get_state(struct dma_buf *dmabuf, struct gk20a *g, | ||
175 | u64 offset, struct gk20a_buffer_state **state) | ||
176 | { | ||
177 | int err = 0; | ||
178 | struct gk20a_dmabuf_priv *priv; | ||
179 | struct gk20a_buffer_state *s; | ||
180 | struct device *dev = dev_from_gk20a(g); | ||
181 | |||
182 | if (WARN_ON(offset >= (u64)dmabuf->size)) | ||
183 | return -EINVAL; | ||
184 | |||
185 | err = gk20a_dmabuf_alloc_drvdata(dmabuf, dev); | ||
186 | if (err) | ||
187 | return err; | ||
188 | |||
189 | priv = dma_buf_get_drvdata(dmabuf, dev); | ||
190 | if (WARN_ON(!priv)) | ||
191 | return -ENOSYS; | ||
192 | |||
193 | nvgpu_mutex_acquire(&priv->lock); | ||
194 | |||
195 | nvgpu_list_for_each_entry(s, &priv->states, gk20a_buffer_state, list) | ||
196 | if (s->offset == offset) | ||
197 | goto out; | ||
198 | |||
199 | /* State not found, create state. */ | ||
200 | s = nvgpu_kzalloc(g, sizeof(*s)); | ||
201 | if (!s) { | ||
202 | err = -ENOMEM; | ||
203 | goto out; | ||
204 | } | ||
205 | |||
206 | s->offset = offset; | ||
207 | nvgpu_init_list_node(&s->list); | ||
208 | nvgpu_mutex_init(&s->lock); | ||
209 | nvgpu_list_add_tail(&s->list, &priv->states); | ||
210 | |||
211 | out: | ||
212 | nvgpu_mutex_release(&priv->lock); | ||
213 | if (!err) | ||
214 | *state = s; | ||
215 | return err; | ||
216 | } | ||
217 | |||
218 | int gk20a_mm_get_buffer_info(struct device *dev, int dmabuf_fd, | ||
219 | u64 *buffer_id, u64 *buffer_len) | ||
220 | { | ||
221 | struct dma_buf *dmabuf; | ||
222 | struct gk20a_dmabuf_priv *priv; | ||
223 | int err = 0; | ||
224 | |||
225 | dmabuf = dma_buf_get(dmabuf_fd); | ||
226 | if (IS_ERR(dmabuf)) { | ||
227 | dev_warn(dev, "%s: fd %d is not a dmabuf", __func__, dmabuf_fd); | ||
228 | return PTR_ERR(dmabuf); | ||
229 | } | ||
230 | |||
231 | err = gk20a_dmabuf_alloc_drvdata(dmabuf, dev); | ||
232 | if (err) { | ||
233 | dev_warn(dev, "Failed to allocate dmabuf drvdata (err = %d)", | ||
234 | err); | ||
235 | goto clean_up; | ||
236 | } | ||
237 | |||
238 | priv = dma_buf_get_drvdata(dmabuf, dev); | ||
239 | if (likely(priv)) { | ||
240 | *buffer_id = priv->buffer_id; | ||
241 | *buffer_len = dmabuf->size; | ||
242 | } | ||
243 | |||
244 | clean_up: | ||
245 | dma_buf_put(dmabuf); | ||
246 | return err; | ||
247 | } | ||
diff --git a/drivers/gpu/nvgpu/common/linux/dmabuf.h b/drivers/gpu/nvgpu/common/linux/dmabuf.h new file mode 100644 index 00000000..718386c5 --- /dev/null +++ b/drivers/gpu/nvgpu/common/linux/dmabuf.h | |||
@@ -0,0 +1,73 @@ | |||
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 __COMMON_LINUX_DMABUF_H__ | ||
18 | #define __COMMON_LINUX_DMABUF_H__ | ||
19 | |||
20 | #include <nvgpu/comptags.h> | ||
21 | #include <nvgpu/list.h> | ||
22 | #include <nvgpu/lock.h> | ||
23 | #include <nvgpu/gmmu.h> | ||
24 | |||
25 | struct sg_table; | ||
26 | struct dma_buf; | ||
27 | struct dma_buf_attachment; | ||
28 | struct device; | ||
29 | |||
30 | struct gk20a; | ||
31 | struct gk20a_buffer_state; | ||
32 | |||
33 | struct gk20a_dmabuf_priv { | ||
34 | struct nvgpu_mutex lock; | ||
35 | |||
36 | struct gk20a *g; | ||
37 | |||
38 | struct gk20a_comptag_allocator *comptag_allocator; | ||
39 | struct gk20a_comptags comptags; | ||
40 | |||
41 | struct dma_buf_attachment *attach; | ||
42 | struct sg_table *sgt; | ||
43 | |||
44 | int pin_count; | ||
45 | |||
46 | struct nvgpu_list_node states; | ||
47 | |||
48 | u64 buffer_id; | ||
49 | }; | ||
50 | |||
51 | /* | ||
52 | * These are implemented in common/linux/comptags.c - these are dmabuf related | ||
53 | * functions though so they are defined here. They cannot be defined in | ||
54 | * <nvgpu/comptags.h> since that file must be OS agnostic. | ||
55 | */ | ||
56 | int gk20a_alloc_comptags(struct gk20a *g, | ||
57 | struct device *dev, | ||
58 | struct dma_buf *dmabuf, | ||
59 | struct gk20a_comptag_allocator *allocator, | ||
60 | u32 lines); | ||
61 | void gk20a_get_comptags(struct device *dev, struct dma_buf *dmabuf, | ||
62 | struct gk20a_comptags *comptags); | ||
63 | |||
64 | struct sg_table *gk20a_mm_pin(struct device *dev, struct dma_buf *dmabuf); | ||
65 | void gk20a_mm_unpin(struct device *dev, struct dma_buf *dmabuf, | ||
66 | struct sg_table *sgt); | ||
67 | |||
68 | int gk20a_dmabuf_alloc_drvdata(struct dma_buf *dmabuf, struct device *dev); | ||
69 | |||
70 | int gk20a_dmabuf_get_state(struct dma_buf *dmabuf, struct gk20a *g, | ||
71 | u64 offset, struct gk20a_buffer_state **state); | ||
72 | |||
73 | #endif | ||
diff --git a/drivers/gpu/nvgpu/common/linux/vm.c b/drivers/gpu/nvgpu/common/linux/vm.c index 45058321..b686d616 100644 --- a/drivers/gpu/nvgpu/common/linux/vm.c +++ b/drivers/gpu/nvgpu/common/linux/vm.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <nvgpu/nvgpu_mem.h> | 24 | #include <nvgpu/nvgpu_mem.h> |
25 | #include <nvgpu/page_allocator.h> | 25 | #include <nvgpu/page_allocator.h> |
26 | #include <nvgpu/vidmem.h> | 26 | #include <nvgpu/vidmem.h> |
27 | #include <nvgpu/enabled.h> | ||
28 | 27 | ||
29 | #include <nvgpu/linux/vidmem.h> | 28 | #include <nvgpu/linux/vidmem.h> |
30 | #include <nvgpu/linux/nvgpu_mem.h> | 29 | #include <nvgpu/linux/nvgpu_mem.h> |
@@ -36,33 +35,7 @@ | |||
36 | 35 | ||
37 | #include "vm_priv.h" | 36 | #include "vm_priv.h" |
38 | #include "os_linux.h" | 37 | #include "os_linux.h" |
39 | 38 | #include "dmabuf.h" | |
40 | /* | ||
41 | * Temporary location for this code until a dmabuf.c file exists. | ||
42 | */ | ||
43 | enum nvgpu_aperture gk20a_dmabuf_aperture(struct gk20a *g, | ||
44 | struct dma_buf *dmabuf) | ||
45 | { | ||
46 | struct gk20a *buf_owner = nvgpu_vidmem_buf_owner(dmabuf); | ||
47 | bool unified_memory = nvgpu_is_enabled(g, NVGPU_MM_UNIFIED_MEMORY); | ||
48 | |||
49 | if (buf_owner == NULL) { | ||
50 | /* Not nvgpu-allocated, assume system memory */ | ||
51 | return APERTURE_SYSMEM; | ||
52 | } else if (WARN_ON(buf_owner == g && unified_memory)) { | ||
53 | /* Looks like our video memory, but this gpu doesn't support | ||
54 | * it. Warn about a bug and bail out */ | ||
55 | nvgpu_warn(g, | ||
56 | "dmabuf is our vidmem but we don't have local vidmem"); | ||
57 | return APERTURE_INVALID; | ||
58 | } else if (buf_owner != g) { | ||
59 | /* Someone else's vidmem */ | ||
60 | return APERTURE_INVALID; | ||
61 | } else { | ||
62 | /* Yay, buf_owner == g */ | ||
63 | return APERTURE_VIDMEM; | ||
64 | } | ||
65 | } | ||
66 | 39 | ||
67 | static struct nvgpu_mapped_buf *__nvgpu_vm_find_mapped_buf_reverse( | 40 | static struct nvgpu_mapped_buf *__nvgpu_vm_find_mapped_buf_reverse( |
68 | struct vm_gk20a *vm, struct dma_buf *dmabuf, u32 kind) | 41 | struct vm_gk20a *vm, struct dma_buf *dmabuf, u32 kind) |
diff --git a/drivers/gpu/nvgpu/common/linux/vm_priv.h b/drivers/gpu/nvgpu/common/linux/vm_priv.h index 1eadf1d0..fa173d59 100644 --- a/drivers/gpu/nvgpu/common/linux/vm_priv.h +++ b/drivers/gpu/nvgpu/common/linux/vm_priv.h | |||
@@ -102,10 +102,5 @@ int setup_buffer_kind_and_compression(struct vm_gk20a *vm, | |||
102 | u32 flags, | 102 | u32 flags, |
103 | struct buffer_attrs *bfr, | 103 | struct buffer_attrs *bfr, |
104 | enum gmmu_pgsz_gk20a pgsz_idx); | 104 | enum gmmu_pgsz_gk20a pgsz_idx); |
105 | int gk20a_alloc_comptags(struct gk20a *g, | ||
106 | struct device *dev, | ||
107 | struct dma_buf *dmabuf, | ||
108 | struct gk20a_comptag_allocator *allocator, | ||
109 | u32 lines); | ||
110 | 105 | ||
111 | #endif | 106 | #endif |