From 2517d59be282426eec7a97745b76d745ff36c388 Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Tue, 4 Sep 2018 17:39:36 +0530 Subject: gpu: nvgpu: move channel_sync_gk20a.* to common directory 1) Move channel_sync_gk20a.* from gk20a/ to common/ directory as they donot program any hardware registers. Also as an add-on rename channel_sync_gk20a.* to channel_sync.* and update the headers in required files. 2) Rename the struct gk20a_channel_sync to struct nvgpu_channel_sync. Also, corresponding syncpt and semaphore versions of the struct alongwith related methods are renamed by removing "gk20a" from their names and adding "nvgpu". 3) Add misra-c cleanups Jira NVGPU-1086 Change-Id: I4e0e21803ca3858dd7a5fc4d2454dba1f1bfcecd Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/1812594 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fifo/channel.c | 14 +++++++------- drivers/gpu/nvgpu/common/fifo/submit.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'drivers/gpu/nvgpu/common/fifo') diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index 45f5b736..1613f5f6 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -44,11 +44,11 @@ #include #include #include +#include #include "gk20a/gk20a.h" #include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/fence_gk20a.h" -#include "gk20a/channel_sync_gk20a.h" static void free_channel(struct fifo_gk20a *f, struct channel_gk20a *c); static void gk20a_channel_dump_ref_actions(struct channel_gk20a *c); @@ -416,7 +416,7 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) /* sync must be destroyed before releasing channel vm */ nvgpu_mutex_acquire(&ch->sync_lock); if (ch->sync) { - gk20a_channel_sync_destroy(ch->sync, false); + nvgpu_channel_sync_destroy(ch->sync, false); ch->sync = NULL; } if (ch->user_sync) { @@ -425,9 +425,9 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) * But it's already done if channel has timedout */ if (ch->has_timedout) { - gk20a_channel_sync_destroy(ch->user_sync, false); + nvgpu_channel_sync_destroy(ch->user_sync, false); } else { - gk20a_channel_sync_destroy(ch->user_sync, true); + nvgpu_channel_sync_destroy(ch->user_sync, true); } ch->user_sync = NULL; } @@ -1191,7 +1191,7 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, if (g->aggressive_sync_destroy_thresh == 0U) { nvgpu_mutex_acquire(&c->sync_lock); - c->sync = gk20a_channel_sync_create(c, false); + c->sync = nvgpu_channel_sync_create(c, false); if (c->sync == NULL) { err = -ENOMEM; nvgpu_mutex_release(&c->sync_lock); @@ -1253,7 +1253,7 @@ clean_up_prealloc: } clean_up_sync: if (c->sync) { - gk20a_channel_sync_destroy(c->sync, false); + nvgpu_channel_sync_destroy(c->sync, false); c->sync = NULL; } clean_up_unmap: @@ -1984,7 +1984,7 @@ void gk20a_channel_clean_up_jobs(struct channel_gk20a *c, if (nvgpu_atomic_dec_and_test( &c->sync->refcount) && g->aggressive_sync_destroy) { - gk20a_channel_sync_destroy(c->sync, + nvgpu_channel_sync_destroy(c->sync, false); c->sync = NULL; } diff --git a/drivers/gpu/nvgpu/common/fifo/submit.c b/drivers/gpu/nvgpu/common/fifo/submit.c index 1f7a04a2..5a0beea9 100644 --- a/drivers/gpu/nvgpu/common/fifo/submit.c +++ b/drivers/gpu/nvgpu/common/fifo/submit.c @@ -24,12 +24,12 @@ #include #include #include +#include #include #include "gk20a/gk20a.h" #include "gk20a/fence_gk20a.h" -#include "gk20a/channel_sync_gk20a.h" #include @@ -56,7 +56,7 @@ static int nvgpu_submit_prepare_syncs(struct channel_gk20a *c, if (g->aggressive_sync_destroy_thresh) { nvgpu_mutex_acquire(&c->sync_lock); if (!c->sync) { - c->sync = gk20a_channel_sync_create(c, false); + c->sync = nvgpu_channel_sync_create(c, false); if (!c->sync) { err = -ENOMEM; nvgpu_mutex_release(&c->sync_lock); @@ -409,7 +409,7 @@ static int nvgpu_submit_channel_gpfifo(struct channel_gk20a *c, } need_sync_framework = - gk20a_channel_sync_needs_sync_framework(g) || + nvgpu_channel_sync_needs_os_fence_framework(g) || (flags & NVGPU_SUBMIT_FLAGS_SYNC_FENCE && flags & NVGPU_SUBMIT_FLAGS_FENCE_GET); -- cgit v1.2.2