mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
gpu: nvgpu: add submit entry points for kernel and ioctl
gk20a_submit_channel_gpfifo() supports reading the gpfifo entries from either a kernel buffer or an userspace buffer in an ioctl. Add two separate entry points: one for the ioctl and another for any other kernel use. This shortens the function prototypes and simplifies and clarifies the call sites slightly. Jira NVGPU-705 Change-Id: If5141a459261a451f78cc50972f4c94d95ba44d1 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1730479 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
06ceff1240
commit
0ca69a482d
@@ -783,9 +783,8 @@ static int gk20a_cde_execute_buffer(struct gk20a_cde_ctx *cde_ctx,
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
return gk20a_submit_channel_gpfifo(cde_ctx->ch, gpfifo, NULL,
|
||||
num_entries, flags, fence, fence_out,
|
||||
NULL);
|
||||
return gk20a_submit_channel_gpfifo_kernel(cde_ctx->ch, gpfifo,
|
||||
num_entries, flags, fence, fence_out);
|
||||
}
|
||||
|
||||
static void gk20a_cde_ctx_release(struct gk20a_cde_ctx *cde_ctx)
|
||||
|
||||
@@ -130,9 +130,8 @@ int gk20a_ce_execute_ops(struct gk20a *g,
|
||||
|
||||
nvgpu_smp_wmb();
|
||||
|
||||
ret = gk20a_submit_channel_gpfifo(ce_ctx->ch, &gpfifo, NULL,
|
||||
1, submit_flags, &fence,
|
||||
&ce_cmd_buf_fence_out, NULL);
|
||||
ret = gk20a_submit_channel_gpfifo_kernel(ce_ctx->ch, &gpfifo,
|
||||
1, submit_flags, &fence, &ce_cmd_buf_fence_out);
|
||||
|
||||
if (!ret) {
|
||||
ce_ctx->postfences[ce_ctx->cmd_buf_read_queue_offset] =
|
||||
|
||||
@@ -752,7 +752,7 @@ out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
|
||||
static int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
|
||||
struct nvgpu_gpfifo_entry *gpfifo,
|
||||
struct nvgpu_submit_gpfifo_args *args,
|
||||
u32 num_entries,
|
||||
@@ -1019,3 +1019,25 @@ clean_up:
|
||||
return err;
|
||||
}
|
||||
|
||||
int gk20a_submit_channel_gpfifo_user(struct channel_gk20a *c,
|
||||
struct nvgpu_submit_gpfifo_args *args,
|
||||
u32 num_entries,
|
||||
u32 flags,
|
||||
struct nvgpu_channel_fence *fence,
|
||||
struct gk20a_fence **fence_out,
|
||||
struct fifo_profile_gk20a *profile)
|
||||
{
|
||||
return gk20a_submit_channel_gpfifo(c, NULL, args, num_entries,
|
||||
flags, fence, fence_out, profile);
|
||||
}
|
||||
|
||||
int gk20a_submit_channel_gpfifo_kernel(struct channel_gk20a *c,
|
||||
struct nvgpu_gpfifo_entry *gpfifo,
|
||||
u32 num_entries,
|
||||
u32 flags,
|
||||
struct nvgpu_channel_fence *fence,
|
||||
struct gk20a_fence **fence_out)
|
||||
{
|
||||
return gk20a_submit_channel_gpfifo(c, gpfifo, NULL, num_entries, flags,
|
||||
fence, fence_out, NULL);
|
||||
}
|
||||
|
||||
@@ -84,8 +84,7 @@ struct channel_gk20a *gk20a_open_new_channel_with_cb(struct gk20a *g,
|
||||
int runlist_id,
|
||||
bool is_privileged_channel);
|
||||
|
||||
int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
|
||||
struct nvgpu_gpfifo_entry *gpfifo,
|
||||
int gk20a_submit_channel_gpfifo_user(struct channel_gk20a *c,
|
||||
struct nvgpu_submit_gpfifo_args *args,
|
||||
u32 num_entries,
|
||||
u32 flags,
|
||||
@@ -93,4 +92,11 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
|
||||
struct gk20a_fence **fence_out,
|
||||
struct fifo_profile_gk20a *profile);
|
||||
|
||||
int gk20a_submit_channel_gpfifo_kernel(struct channel_gk20a *c,
|
||||
struct nvgpu_gpfifo_entry *gpfifo,
|
||||
u32 num_entries,
|
||||
u32 flags,
|
||||
struct nvgpu_channel_fence *fence,
|
||||
struct gk20a_fence **fence_out);
|
||||
|
||||
#endif /* __NVGPU_CHANNEL_H__ */
|
||||
|
||||
@@ -798,9 +798,8 @@ static int gk20a_ioctl_channel_submit_gpfifo(
|
||||
return fd;
|
||||
}
|
||||
|
||||
ret = gk20a_submit_channel_gpfifo(ch, NULL, args, args->num_entries,
|
||||
submit_flags, &fence,
|
||||
&fence_out, profile);
|
||||
ret = gk20a_submit_channel_gpfifo_user(ch, args, args->num_entries,
|
||||
submit_flags, &fence, &fence_out, profile);
|
||||
|
||||
if (ret) {
|
||||
if (fd != -1)
|
||||
|
||||
Reference in New Issue
Block a user