diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-08-04 13:44:25 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-09-08 23:05:41 -0400 |
commit | a0dd3ee5becb8e0f91e46654e25619b55655c017 (patch) | |
tree | b6c9b4a80e8f81d0be2bb1af402c4038ce2150ab /drivers | |
parent | a222bc55b5b05725fa6b86b3840534b344290f41 (diff) |
gpu: nvgpu: Allocate vidmem fds from 1024
Allocate vidmem fds from 1024 onwards. This prevents us from
using up the 0-1023 range which is tracked per process, and
fits within FD_SETSIZE.
Bug 200222681
Change-Id: I104b81f2831f1816ff66fc245fa63013d78001ec
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1199269
(cherry picked from commit 5d5cbaf6a63dd31538fa35081b70e103d8a658f4)
Reviewed-on: http://git-master/r/1217294
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index d26855f4..c9f2a840 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/vmalloc.h> | 27 | #include <linux/vmalloc.h> |
28 | #include <linux/dma-buf.h> | 28 | #include <linux/dma-buf.h> |
29 | #include <linux/lcm.h> | 29 | #include <linux/lcm.h> |
30 | #include <linux/fdtable.h> | ||
30 | #include <uapi/linux/nvgpu.h> | 31 | #include <uapi/linux/nvgpu.h> |
31 | #include <trace/events/gk20a.h> | 32 | #include <trace/events/gk20a.h> |
32 | #include <gk20a/page_allocator_priv.h> | 33 | #include <gk20a/page_allocator_priv.h> |
@@ -2161,7 +2162,7 @@ int gk20a_vidmem_buf_alloc(struct gk20a *g, size_t bytes) | |||
2161 | goto err_bfree; | 2162 | goto err_bfree; |
2162 | } | 2163 | } |
2163 | 2164 | ||
2164 | fd = get_unused_fd_flags(O_RDWR); | 2165 | fd = __alloc_fd(current->files, 1024, sysctl_nr_open, O_RDWR); |
2165 | if (fd < 0) { | 2166 | if (fd < 0) { |
2166 | /* ->release frees what we have done */ | 2167 | /* ->release frees what we have done */ |
2167 | dma_buf_put(buf->dmabuf); | 2168 | dma_buf_put(buf->dmabuf); |