From aeaa7c982662c98d2477b5cfb9fb5242d5f540b5 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 5 Apr 2018 14:16:04 -0700 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1689538 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/vidmem.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gpu/nvgpu/common') 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 @@ #include #include +#ifdef CONFIG_NVGPU_USE_TEGRA_ALLOC_FD #include +#endif #include #include @@ -195,7 +197,11 @@ int nvgpu_vidmem_export_linux(struct gk20a *g, size_t bytes) buf->priv = priv; +#ifdef CONFIG_NVGPU_USE_TEGRA_ALLOC_FD fd = tegra_alloc_fd(current->files, 1024, O_RDWR); +#else + fd = get_unused_fd_flags(O_RDWR); +#endif if (fd < 0) { /* ->release frees what we have done */ dma_buf_put(priv->dmabuf); -- cgit v1.2.2