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
This commit is contained in:
Terje Bergstrom
2016-08-04 10:44:25 -07:00
committed by mobile promotions
parent a222bc55b5
commit a0dd3ee5be

View File

@@ -27,6 +27,7 @@
#include <linux/vmalloc.h>
#include <linux/dma-buf.h>
#include <linux/lcm.h>
#include <linux/fdtable.h>
#include <uapi/linux/nvgpu.h>
#include <trace/events/gk20a.h>
#include <gk20a/page_allocator_priv.h>
@@ -2161,7 +2162,7 @@ int gk20a_vidmem_buf_alloc(struct gk20a *g, size_t bytes)
goto err_bfree;
}
fd = get_unused_fd_flags(O_RDWR);
fd = __alloc_fd(current->files, 1024, sysctl_nr_open, O_RDWR);
if (fd < 0) {
/* ->release frees what we have done */
dma_buf_put(buf->dmabuf);