mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
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>
This commit is contained in:
committed by
mobile promotions
parent
a17a938a48
commit
83bdf33b56
@@ -971,6 +971,26 @@ fail:
|
||||
return err;
|
||||
}
|
||||
|
||||
static u32 nvgpu_obj_ctx_user_flags_to_common_flags(u32 user_flags)
|
||||
{
|
||||
u32 flags = 0;
|
||||
|
||||
if (user_flags & NVGPU_ALLOC_OBJ_FLAGS_GFXP)
|
||||
flags |= NVGPU_OBJ_CTX_FLAGS_SUPPORT_GFXP;
|
||||
|
||||
if (user_flags & NVGPU_ALLOC_OBJ_FLAGS_CILP)
|
||||
flags |= NVGPU_OBJ_CTX_FLAGS_SUPPORT_CILP;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
static int nvgpu_ioctl_channel_alloc_obj_ctx(struct channel_gk20a *ch,
|
||||
u32 class_num, u32 user_flags)
|
||||
{
|
||||
return ch->g->ops.gr.alloc_obj_ctx(ch, class_num,
|
||||
nvgpu_obj_ctx_user_flags_to_common_flags(user_flags));
|
||||
}
|
||||
|
||||
long gk20a_channel_ioctl(struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
@@ -1024,7 +1044,7 @@ long gk20a_channel_ioctl(struct file *filp,
|
||||
__func__, cmd);
|
||||
break;
|
||||
}
|
||||
err = ch->g->ops.gr.alloc_obj_ctx(ch, args->class_num, args->flags);
|
||||
err = nvgpu_ioctl_channel_alloc_obj_ctx(ch, args->class_num, args->flags);
|
||||
gk20a_idle(ch->g);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user