summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
index 7bb97369..e7da0978 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
@@ -55,6 +55,16 @@ struct gk20a_ctrl_priv {
55 struct nvgpu_clk_session *clk_session; 55 struct nvgpu_clk_session *clk_session;
56}; 56};
57 57
58static u32 gk20a_as_translate_as_alloc_flags(struct gk20a *g, u32 flags)
59{
60 u32 core_flags = 0;
61
62 if (flags & NVGPU_GPU_IOCTL_ALLOC_AS_FLAGS_USERSPACE_MANAGED)
63 core_flags |= NVGPU_AS_ALLOC_USERSPACE_MANAGED;
64
65 return core_flags;
66}
67
58int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp) 68int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp)
59{ 69{
60 struct nvgpu_os_linux *l; 70 struct nvgpu_os_linux *l;
@@ -439,7 +449,9 @@ static int gk20a_ctrl_alloc_as(
439 goto clean_up; 449 goto clean_up;
440 } 450 }
441 451
442 err = gk20a_as_alloc_share(g, args->big_page_size, args->flags, 452 err = gk20a_as_alloc_share(g, args->big_page_size,
453 gk20a_as_translate_as_alloc_flags(g,
454 args->flags),
443 &as_share); 455 &as_share);
444 if (err) 456 if (err)
445 goto clean_up_file; 457 goto clean_up_file;