summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/vidmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/vidmem.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/vidmem.c6
1 files changed, 6 insertions, 0 deletions
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);