diff options
author | Alex Waterman <alexw@nvidia.com> | 2018-05-16 14:15:27 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-05-17 16:03:32 -0400 |
commit | 2203d0330231821eeae18517715ba754e093ab18 (patch) | |
tree | 73b142861090ea56b7f4e1a3b055d5adfff5fd07 /drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | |
parent | 7abf697204481869dd2652fe306e2a46879d9152 (diff) |
gpu: nvgpu: Translate as_alloc flags
Translate the as_alloc flags so that the common/as.c code no longer
needs to include <uapi/linux/nvgpu.h>. This was an oversight from
prior MM unification efforts which was caught by the userspace
POSIX build on QNX.
JIRA NVGPU-525
Change-Id: I6af6cb9904c2ae9edeb8dbb970846c31b56822bf
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1720918
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Sourab Gupta <sourabg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 14 |
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 | ||
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; |