diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_as.c | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 14 |
2 files changed, 16 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_as.c b/drivers/gpu/nvgpu/common/linux/ioctl_as.c index 41bbdfcb..47f612cc 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_as.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_as.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include "ioctl_as.h" | 32 | #include "ioctl_as.h" |
33 | #include "os_linux.h" | 33 | #include "os_linux.h" |
34 | 34 | ||
35 | static u32 gk20a_as_translate_linux_flags(struct gk20a *g, u32 flags) | 35 | static u32 gk20a_as_translate_as_alloc_space_flags(struct gk20a *g, u32 flags) |
36 | { | 36 | { |
37 | u32 core_flags = 0; | 37 | u32 core_flags = 0; |
38 | 38 | ||
@@ -80,8 +80,8 @@ static int gk20a_as_ioctl_alloc_space( | |||
80 | nvgpu_log_fn(g, " "); | 80 | nvgpu_log_fn(g, " "); |
81 | return nvgpu_vm_area_alloc(as_share->vm, args->pages, args->page_size, | 81 | return nvgpu_vm_area_alloc(as_share->vm, args->pages, args->page_size, |
82 | &args->o_a.offset, | 82 | &args->o_a.offset, |
83 | gk20a_as_translate_linux_flags(g, | 83 | gk20a_as_translate_as_alloc_space_flags(g, |
84 | args->flags)); | 84 | args->flags)); |
85 | } | 85 | } |
86 | 86 | ||
87 | static int gk20a_as_ioctl_free_space( | 87 | static int gk20a_as_ioctl_free_space( |
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 | ||
58 | static 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 | |||
58 | int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp) | 68 | int 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; |