From 2aad9366fe6d5f537751b5b16a82231e2c4b1bdf Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Thu, 15 Mar 2018 15:46:52 +0200 Subject: gpu: nvgpu: delete unused job->pre_fence The pre_fence member in channel_gk20a_job is no longer used for anything. Delete it. Only the post fence needs to be tracked. Jira NVGPU-527 Jira NVGPU-528 Bug 200390539 Change-Id: Ia1a556728dabf9a8e305ed76020ac1aa0b4d6b88 Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1676735 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Deepak Nibade Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/channel.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux') diff --git a/drivers/gpu/nvgpu/common/linux/channel.c b/drivers/gpu/nvgpu/common/linux/channel.c index cd9cadf8..1d4afcc8 100644 --- a/drivers/gpu/nvgpu/common/linux/channel.c +++ b/drivers/gpu/nvgpu/common/linux/channel.c @@ -420,7 +420,6 @@ static int gk20a_submit_prepare_syncs(struct channel_gk20a *c, struct channel_gk20a_job *job, struct priv_cmd_entry **wait_cmd, struct priv_cmd_entry **incr_cmd, - struct gk20a_fence **pre_fence, struct gk20a_fence **post_fence, bool force_need_sync_fence, bool register_irq, @@ -470,19 +469,13 @@ static int gk20a_submit_prepare_syncs(struct channel_gk20a *c, * this condition. */ if (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_WAIT) { - job->pre_fence = gk20a_alloc_fence(c); - if (!job->pre_fence) { - err = -ENOMEM; - goto fail; - } - if (!pre_alloc_enabled) job->wait_cmd = nvgpu_kzalloc(g, sizeof(struct priv_cmd_entry)); if (!job->wait_cmd) { err = -ENOMEM; - goto clean_up_pre_fence; + goto fail; } if (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_SYNC_FENCE) { @@ -495,12 +488,11 @@ static int gk20a_submit_prepare_syncs(struct channel_gk20a *c, job->wait_cmd); } - if (!err) { - if (job->wait_cmd->valid) - *wait_cmd = job->wait_cmd; - *pre_fence = job->pre_fence; - } else + if (err) goto clean_up_wait_cmd; + + if (job->wait_cmd->valid) + *wait_cmd = job->wait_cmd; } if ((flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_GET) && @@ -552,12 +544,8 @@ clean_up_wait_cmd: free_priv_cmdbuf(c, job->wait_cmd); if (!pre_alloc_enabled) job->wait_cmd = NULL; -clean_up_pre_fence: - gk20a_fence_put(job->pre_fence); - job->pre_fence = NULL; fail: *wait_cmd = NULL; - *pre_fence = NULL; return err; } @@ -684,7 +672,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, struct gk20a *g = c->g; struct priv_cmd_entry *wait_cmd = NULL; struct priv_cmd_entry *incr_cmd = NULL; - struct gk20a_fence *pre_fence = NULL; struct gk20a_fence *post_fence = NULL; struct channel_gk20a_job *job = NULL; /* we might need two extra gpfifo entries - one for pre fence @@ -875,7 +862,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, err = gk20a_submit_prepare_syncs(c, fence, job, &wait_cmd, &incr_cmd, - &pre_fence, &post_fence, + &post_fence, force_need_sync_fence, need_deferred_cleanup, flags); @@ -940,7 +927,6 @@ clean_up_job: channel_gk20a_free_job(c, job); clean_up: gk20a_dbg_fn("fail"); - gk20a_fence_put(pre_fence); gk20a_fence_put(post_fence); if (c->deterministic) nvgpu_rwsem_up_read(&g->deterministic_busy); -- cgit v1.2.2