diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-11-08 10:37:24 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-10 13:30:19 -0500 |
commit | 83bdf33b56b231784987028c9c3c461097a962aa (patch) | |
tree | 80744d6cf20aaa20ab1c7640d38a8432f9081c14 /drivers/gpu/nvgpu/common | |
parent | a17a938a48af462ccf89195196a13b9623af2e21 (diff) |
gpu: nvgpu: remove NVGPU_ALLOC_OBJ_FLAGS_* from common code
In gr_gp10b_alloc_gr_ctx(), we use linux specific flags NVGPU_ALLOC_OBJ_FLAGS_*
Since common code should be independent of linux specific code, define new flags
NVGPU_OBJ_CTX_FLAGS_SUPPORT_* in common code and use them wherever needed
Linux code will parse the user flags and send appropriate flags to
g->ops.gr.alloc_obj_ctx()
Also remove use of NVGPU_ALLOC_OBJ_FLAGS_LOCKBOOST_ZERO since this seems to be
deadcode anyways
Jira NVGPU-382
Change-Id: Id82efe0d46ddc3e2c063610025ea57f283bc3510
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1594452
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_channel.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c index 0c8bff43..f5947828 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c | |||
@@ -971,6 +971,26 @@ fail: | |||
971 | return err; | 971 | return err; |
972 | } | 972 | } |
973 | 973 | ||
974 | static u32 nvgpu_obj_ctx_user_flags_to_common_flags(u32 user_flags) | ||
975 | { | ||
976 | u32 flags = 0; | ||
977 | |||
978 | if (user_flags & NVGPU_ALLOC_OBJ_FLAGS_GFXP) | ||
979 | flags |= NVGPU_OBJ_CTX_FLAGS_SUPPORT_GFXP; | ||
980 | |||
981 | if (user_flags & NVGPU_ALLOC_OBJ_FLAGS_CILP) | ||
982 | flags |= NVGPU_OBJ_CTX_FLAGS_SUPPORT_CILP; | ||
983 | |||
984 | return flags; | ||
985 | } | ||
986 | |||
987 | static int nvgpu_ioctl_channel_alloc_obj_ctx(struct channel_gk20a *ch, | ||
988 | u32 class_num, u32 user_flags) | ||
989 | { | ||
990 | return ch->g->ops.gr.alloc_obj_ctx(ch, class_num, | ||
991 | nvgpu_obj_ctx_user_flags_to_common_flags(user_flags)); | ||
992 | } | ||
993 | |||
974 | long gk20a_channel_ioctl(struct file *filp, | 994 | long gk20a_channel_ioctl(struct file *filp, |
975 | unsigned int cmd, unsigned long arg) | 995 | unsigned int cmd, unsigned long arg) |
976 | { | 996 | { |
@@ -1024,7 +1044,7 @@ long gk20a_channel_ioctl(struct file *filp, | |||
1024 | __func__, cmd); | 1044 | __func__, cmd); |
1025 | break; | 1045 | break; |
1026 | } | 1046 | } |
1027 | err = ch->g->ops.gr.alloc_obj_ctx(ch, args->class_num, args->flags); | 1047 | err = nvgpu_ioctl_channel_alloc_obj_ctx(ch, args->class_num, args->flags); |
1028 | gk20a_idle(ch->g); | 1048 | gk20a_idle(ch->g); |
1029 | break; | 1049 | break; |
1030 | } | 1050 | } |