diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/Kconfig | 11 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/vidmem.c | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/Kconfig b/drivers/gpu/nvgpu/Kconfig index ca1db973..ac0fa261 100644 --- a/drivers/gpu/nvgpu/Kconfig +++ b/drivers/gpu/nvgpu/Kconfig | |||
@@ -135,3 +135,14 @@ config NVGPU_SUPPORT_CDE | |||
135 | default y | 135 | default y |
136 | help | 136 | help |
137 | Enable support for extraction of comptags for CDE. | 137 | Enable support for extraction of comptags for CDE. |
138 | |||
139 | config NVGPU_USE_TEGRA_ALLOC_FD | ||
140 | bool "Use tegra_alloc_fd() for allocating dma_buf fds for vidmem" | ||
141 | depends on GK20A && GK20A_VIDMEM | ||
142 | default y | ||
143 | help | ||
144 | Use tegra_alloc_fd() for allocating dma_buf fds. This allocates | ||
145 | the fds above 1024 which exempts them from counting against process | ||
146 | fd limit. | ||
147 | |||
148 | It is only available in Tegra kernel. | ||
diff --git a/drivers/gpu/nvgpu/common/linux/vidmem.c b/drivers/gpu/nvgpu/common/linux/vidmem.c index 684262ba..136d4a10 100644 --- a/drivers/gpu/nvgpu/common/linux/vidmem.c +++ b/drivers/gpu/nvgpu/common/linux/vidmem.c | |||
@@ -17,7 +17,9 @@ | |||
17 | #include <linux/dma-buf.h> | 17 | #include <linux/dma-buf.h> |
18 | #include <uapi/linux/nvgpu.h> | 18 | #include <uapi/linux/nvgpu.h> |
19 | 19 | ||
20 | #ifdef CONFIG_NVGPU_USE_TEGRA_ALLOC_FD | ||
20 | #include <linux/platform/tegra/tegra_fd.h> | 21 | #include <linux/platform/tegra/tegra_fd.h> |
22 | #endif | ||
21 | 23 | ||
22 | #include <nvgpu/dma.h> | 24 | #include <nvgpu/dma.h> |
23 | #include <nvgpu/enabled.h> | 25 | #include <nvgpu/enabled.h> |
@@ -195,7 +197,11 @@ int nvgpu_vidmem_export_linux(struct gk20a *g, size_t bytes) | |||
195 | 197 | ||
196 | buf->priv = priv; | 198 | buf->priv = priv; |
197 | 199 | ||
200 | #ifdef CONFIG_NVGPU_USE_TEGRA_ALLOC_FD | ||
198 | fd = tegra_alloc_fd(current->files, 1024, O_RDWR); | 201 | fd = tegra_alloc_fd(current->files, 1024, O_RDWR); |
202 | #else | ||
203 | fd = get_unused_fd_flags(O_RDWR); | ||
204 | #endif | ||
199 | if (fd < 0) { | 205 | if (fd < 0) { |
200 | /* ->release frees what we have done */ | 206 | /* ->release frees what we have done */ |
201 | dma_buf_put(priv->dmabuf); | 207 | dma_buf_put(priv->dmabuf); |