mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
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>
This commit is contained in:
committed by
mobile promotions
parent
1389aa3e87
commit
aeaa7c9826
@@ -135,3 +135,14 @@ config NVGPU_SUPPORT_CDE
|
||||
default y
|
||||
help
|
||||
Enable support for extraction of comptags for CDE.
|
||||
|
||||
config NVGPU_USE_TEGRA_ALLOC_FD
|
||||
bool "Use tegra_alloc_fd() for allocating dma_buf fds for vidmem"
|
||||
depends on GK20A && GK20A_VIDMEM
|
||||
default y
|
||||
help
|
||||
Use tegra_alloc_fd() for allocating dma_buf fds. This allocates
|
||||
the fds above 1024 which exempts them from counting against process
|
||||
fd limit.
|
||||
|
||||
It is only available in Tegra kernel.
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
#include <linux/dma-buf.h>
|
||||
#include <uapi/linux/nvgpu.h>
|
||||
|
||||
#ifdef CONFIG_NVGPU_USE_TEGRA_ALLOC_FD
|
||||
#include <linux/platform/tegra/tegra_fd.h>
|
||||
#endif
|
||||
|
||||
#include <nvgpu/dma.h>
|
||||
#include <nvgpu/enabled.h>
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user