diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2018-04-05 17:16:04 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-04-06 17:07:33 -0400 |
commit | aeaa7c982662c98d2477b5cfb9fb5242d5f540b5 (patch) | |
tree | dd33f32bf7873dbf3ca7968e9bf834f0935e07bb /drivers/gpu/nvgpu/common | |
parent | 1389aa3e87ae059121329af41009b37692177775 (diff) |
gpu: nvgpu: Use tegra_alloc_fd() only on Tegra kernel
tegra_alloc_fd() exists only in Tegra kernel. Use get_unused_fd_flags()
in other platforms.
JIRA NVGPU-4
Change-Id: I12b16957263f6cea771314a9da229384c865e65f
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1689538
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/vidmem.c | 6 |
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); |