From de67fb18fb639b7a605c77eeb2e1c639a8a3d67e Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Thu, 17 May 2018 14:01:36 +0300 Subject: gpu: nvgpu: drop force_need_sync_fence in submit path For CDE work a sync fence is always requested, but kernel does not need it and submit flags from userspace will be passed to the submit function in cde path so a sync fence will get created if necessary. To reduce some complexity, remove the explicit boolean in favor of just NVGPU_SUBMIT_FLAGS_SYNC_FENCE. Jira NVGPU-705 Change-Id: I8aac85288513ed7cc640acd021d892cee86f41d8 Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1721785 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/cde.c | 2 +- drivers/gpu/nvgpu/common/linux/ce2.c | 2 +- drivers/gpu/nvgpu/common/linux/channel.c | 12 +----------- drivers/gpu/nvgpu/common/linux/channel.h | 1 - drivers/gpu/nvgpu/common/linux/ioctl_channel.c | 2 +- 5 files changed, 4 insertions(+), 15 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/common/linux/cde.c b/drivers/gpu/nvgpu/common/linux/cde.c index 511d564f..8a15b82a 100644 --- a/drivers/gpu/nvgpu/common/linux/cde.c +++ b/drivers/gpu/nvgpu/common/linux/cde.c @@ -781,7 +781,7 @@ static int gk20a_cde_execute_buffer(struct gk20a_cde_ctx *cde_ctx, } return gk20a_submit_channel_gpfifo(cde_ctx->ch, gpfifo, NULL, - num_entries, flags, fence, fence_out, true, + num_entries, flags, fence, fence_out, NULL); } diff --git a/drivers/gpu/nvgpu/common/linux/ce2.c b/drivers/gpu/nvgpu/common/linux/ce2.c index a2ab22ff..165f33db 100644 --- a/drivers/gpu/nvgpu/common/linux/ce2.c +++ b/drivers/gpu/nvgpu/common/linux/ce2.c @@ -132,7 +132,7 @@ int gk20a_ce_execute_ops(struct gk20a *g, ret = gk20a_submit_channel_gpfifo(ce_ctx->ch, &gpfifo, NULL, 1, submit_flags, &fence, - &ce_cmd_buf_fence_out, false, NULL); + &ce_cmd_buf_fence_out, NULL); if (!ret) { ce_ctx->postfences[ce_ctx->cmd_buf_read_queue_offset] = diff --git a/drivers/gpu/nvgpu/common/linux/channel.c b/drivers/gpu/nvgpu/common/linux/channel.c index f189d3ed..88bc2009 100644 --- a/drivers/gpu/nvgpu/common/linux/channel.c +++ b/drivers/gpu/nvgpu/common/linux/channel.c @@ -527,7 +527,6 @@ static int gk20a_submit_prepare_syncs(struct channel_gk20a *c, struct priv_cmd_entry **wait_cmd, struct priv_cmd_entry **incr_cmd, struct gk20a_fence **post_fence, - bool force_need_sync_fence, bool register_irq, u32 flags) { @@ -539,13 +538,6 @@ static int gk20a_submit_prepare_syncs(struct channel_gk20a *c, bool need_wfi = !(flags & NVGPU_SUBMIT_FLAGS_SUPPRESS_WFI); bool pre_alloc_enabled = channel_gk20a_is_prealloc_enabled(c); - /* - * If user wants to always allocate sync_fence_fds then respect that; - * otherwise, allocate sync_fence_fd based on user flags. - */ - if (force_need_sync_fence) - need_sync_fence = true; - if (g->aggressive_sync_destroy_thresh) { nvgpu_mutex_acquire(&c->sync_lock); if (!c->sync) { @@ -772,7 +764,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, u32 flags, struct nvgpu_channel_fence *fence, struct gk20a_fence **fence_out, - bool force_need_sync_fence, struct fifo_profile_gk20a *profile) { struct gk20a *g = c->g; @@ -861,7 +852,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, if (c->deterministic && !channel_gk20a_is_prealloc_enabled(c)) return -EINVAL; - need_sync_framework = force_need_sync_fence || + need_sync_framework = gk20a_channel_sync_needs_sync_framework(g) || (flags & NVGPU_SUBMIT_FLAGS_SYNC_FENCE && flags & NVGPU_SUBMIT_FLAGS_FENCE_GET); @@ -968,7 +959,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, err = gk20a_submit_prepare_syncs(c, fence, job, &wait_cmd, &incr_cmd, &post_fence, - force_need_sync_fence, need_deferred_cleanup, flags); if (err) diff --git a/drivers/gpu/nvgpu/common/linux/channel.h b/drivers/gpu/nvgpu/common/linux/channel.h index 805de55a..4a58b10c 100644 --- a/drivers/gpu/nvgpu/common/linux/channel.h +++ b/drivers/gpu/nvgpu/common/linux/channel.h @@ -91,7 +91,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, u32 flags, struct nvgpu_channel_fence *fence, struct gk20a_fence **fence_out, - bool force_need_sync_fence, struct fifo_profile_gk20a *profile); #endif /* __NVGPU_CHANNEL_H__ */ diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c index c1492cad..057c81e2 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c @@ -803,7 +803,7 @@ static int gk20a_ioctl_channel_submit_gpfifo( ret = gk20a_submit_channel_gpfifo(ch, NULL, args, args->num_entries, submit_flags, &fence, - &fence_out, false, profile); + &fence_out, profile); if (ret) { if (fd != -1) -- cgit v1.2.2