diff options
author | Debarshi Dutta <ddutta@nvidia.com> | 2018-09-04 08:09:36 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-18 02:39:24 -0400 |
commit | 2517d59be282426eec7a97745b76d745ff36c388 (patch) | |
tree | faf915b5cfffb781918d674ec7d769feb7e98ac8 /drivers/gpu/nvgpu/common/fifo | |
parent | 8381eeea4f9b4717854387068ddf9244973e7d0d (diff) |
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 <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1812594
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/fifo')
-rw-r--r-- | drivers/gpu/nvgpu/common/fifo/channel.c | 14 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/fifo/submit.c | 6 |
2 files changed, 10 insertions, 10 deletions
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 @@ | |||
44 | #include <nvgpu/log2.h> | 44 | #include <nvgpu/log2.h> |
45 | #include <nvgpu/ptimer.h> | 45 | #include <nvgpu/ptimer.h> |
46 | #include <nvgpu/channel.h> | 46 | #include <nvgpu/channel.h> |
47 | #include <nvgpu/channel_sync.h> | ||
47 | 48 | ||
48 | #include "gk20a/gk20a.h" | 49 | #include "gk20a/gk20a.h" |
49 | #include "gk20a/dbg_gpu_gk20a.h" | 50 | #include "gk20a/dbg_gpu_gk20a.h" |
50 | #include "gk20a/fence_gk20a.h" | 51 | #include "gk20a/fence_gk20a.h" |
51 | #include "gk20a/channel_sync_gk20a.h" | ||
52 | 52 | ||
53 | static void free_channel(struct fifo_gk20a *f, struct channel_gk20a *c); | 53 | static void free_channel(struct fifo_gk20a *f, struct channel_gk20a *c); |
54 | static void gk20a_channel_dump_ref_actions(struct channel_gk20a *c); | 54 | 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) | |||
416 | /* sync must be destroyed before releasing channel vm */ | 416 | /* sync must be destroyed before releasing channel vm */ |
417 | nvgpu_mutex_acquire(&ch->sync_lock); | 417 | nvgpu_mutex_acquire(&ch->sync_lock); |
418 | if (ch->sync) { | 418 | if (ch->sync) { |
419 | gk20a_channel_sync_destroy(ch->sync, false); | 419 | nvgpu_channel_sync_destroy(ch->sync, false); |
420 | ch->sync = NULL; | 420 | ch->sync = NULL; |
421 | } | 421 | } |
422 | if (ch->user_sync) { | 422 | if (ch->user_sync) { |
@@ -425,9 +425,9 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) | |||
425 | * But it's already done if channel has timedout | 425 | * But it's already done if channel has timedout |
426 | */ | 426 | */ |
427 | if (ch->has_timedout) { | 427 | if (ch->has_timedout) { |
428 | gk20a_channel_sync_destroy(ch->user_sync, false); | 428 | nvgpu_channel_sync_destroy(ch->user_sync, false); |
429 | } else { | 429 | } else { |
430 | gk20a_channel_sync_destroy(ch->user_sync, true); | 430 | nvgpu_channel_sync_destroy(ch->user_sync, true); |
431 | } | 431 | } |
432 | ch->user_sync = NULL; | 432 | ch->user_sync = NULL; |
433 | } | 433 | } |
@@ -1191,7 +1191,7 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1191 | 1191 | ||
1192 | if (g->aggressive_sync_destroy_thresh == 0U) { | 1192 | if (g->aggressive_sync_destroy_thresh == 0U) { |
1193 | nvgpu_mutex_acquire(&c->sync_lock); | 1193 | nvgpu_mutex_acquire(&c->sync_lock); |
1194 | c->sync = gk20a_channel_sync_create(c, false); | 1194 | c->sync = nvgpu_channel_sync_create(c, false); |
1195 | if (c->sync == NULL) { | 1195 | if (c->sync == NULL) { |
1196 | err = -ENOMEM; | 1196 | err = -ENOMEM; |
1197 | nvgpu_mutex_release(&c->sync_lock); | 1197 | nvgpu_mutex_release(&c->sync_lock); |
@@ -1253,7 +1253,7 @@ clean_up_prealloc: | |||
1253 | } | 1253 | } |
1254 | clean_up_sync: | 1254 | clean_up_sync: |
1255 | if (c->sync) { | 1255 | if (c->sync) { |
1256 | gk20a_channel_sync_destroy(c->sync, false); | 1256 | nvgpu_channel_sync_destroy(c->sync, false); |
1257 | c->sync = NULL; | 1257 | c->sync = NULL; |
1258 | } | 1258 | } |
1259 | clean_up_unmap: | 1259 | clean_up_unmap: |
@@ -1984,7 +1984,7 @@ void gk20a_channel_clean_up_jobs(struct channel_gk20a *c, | |||
1984 | if (nvgpu_atomic_dec_and_test( | 1984 | if (nvgpu_atomic_dec_and_test( |
1985 | &c->sync->refcount) && | 1985 | &c->sync->refcount) && |
1986 | g->aggressive_sync_destroy) { | 1986 | g->aggressive_sync_destroy) { |
1987 | gk20a_channel_sync_destroy(c->sync, | 1987 | nvgpu_channel_sync_destroy(c->sync, |
1988 | false); | 1988 | false); |
1989 | c->sync = NULL; | 1989 | c->sync = NULL; |
1990 | } | 1990 | } |
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 @@ | |||
24 | #include <nvgpu/ltc.h> | 24 | #include <nvgpu/ltc.h> |
25 | #include <nvgpu/os_sched.h> | 25 | #include <nvgpu/os_sched.h> |
26 | #include <nvgpu/utils.h> | 26 | #include <nvgpu/utils.h> |
27 | #include <nvgpu/channel_sync.h> | ||
27 | 28 | ||
28 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> | 29 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> |
29 | 30 | ||
30 | #include "gk20a/gk20a.h" | 31 | #include "gk20a/gk20a.h" |
31 | #include "gk20a/fence_gk20a.h" | 32 | #include "gk20a/fence_gk20a.h" |
32 | #include "gk20a/channel_sync_gk20a.h" | ||
33 | 33 | ||
34 | #include <trace/events/gk20a.h> | 34 | #include <trace/events/gk20a.h> |
35 | 35 | ||
@@ -56,7 +56,7 @@ static int nvgpu_submit_prepare_syncs(struct channel_gk20a *c, | |||
56 | if (g->aggressive_sync_destroy_thresh) { | 56 | if (g->aggressive_sync_destroy_thresh) { |
57 | nvgpu_mutex_acquire(&c->sync_lock); | 57 | nvgpu_mutex_acquire(&c->sync_lock); |
58 | if (!c->sync) { | 58 | if (!c->sync) { |
59 | c->sync = gk20a_channel_sync_create(c, false); | 59 | c->sync = nvgpu_channel_sync_create(c, false); |
60 | if (!c->sync) { | 60 | if (!c->sync) { |
61 | err = -ENOMEM; | 61 | err = -ENOMEM; |
62 | nvgpu_mutex_release(&c->sync_lock); | 62 | nvgpu_mutex_release(&c->sync_lock); |
@@ -409,7 +409,7 @@ static int nvgpu_submit_channel_gpfifo(struct channel_gk20a *c, | |||
409 | } | 409 | } |
410 | 410 | ||
411 | need_sync_framework = | 411 | need_sync_framework = |
412 | gk20a_channel_sync_needs_sync_framework(g) || | 412 | nvgpu_channel_sync_needs_os_fence_framework(g) || |
413 | (flags & NVGPU_SUBMIT_FLAGS_SYNC_FENCE && | 413 | (flags & NVGPU_SUBMIT_FLAGS_SYNC_FENCE && |
414 | flags & NVGPU_SUBMIT_FLAGS_FENCE_GET); | 414 | flags & NVGPU_SUBMIT_FLAGS_FENCE_GET); |
415 | 415 | ||