diff options
author | Debarshi Dutta <ddutta@nvidia.com> | 2017-08-03 06:04:44 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-17 17:26:47 -0400 |
commit | 98186ec2c2127c2af65a34f9e697e04f518a79ab (patch) | |
tree | 08ad87f3bf8c739e96b36f01728a8f7a30749a0e /drivers/gpu/nvgpu/common/linux/debug_fifo.c | |
parent | 49dc335cfe588179cbb42d8bab53bc76ba88b28f (diff) |
gpu: nvgpu: Add wrapper over atomic_t and atomic64_t
- added wrapper structs nvgpu_atomic_t and nvgpu_atomic64_t over
atomic_t and atomic64_t
- added nvgpu_atomic_* and nvgpu_atomic64_* APIs to access the above
wrappers.
JIRA NVGPU-121
Change-Id: I61667bb0a84c2fc475365abb79bffb42b8b4786a
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1533044
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/debug_fifo.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/debug_fifo.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/debug_fifo.c b/drivers/gpu/nvgpu/common/linux/debug_fifo.c index a240a138..1763eb7e 100644 --- a/drivers/gpu/nvgpu/common/linux/debug_fifo.c +++ b/drivers/gpu/nvgpu/common/linux/debug_fifo.c | |||
@@ -167,7 +167,7 @@ static int gk20a_fifo_profile_enable(void *data, u64 val) | |||
167 | } | 167 | } |
168 | kref_init(&f->profile.ref); | 168 | kref_init(&f->profile.ref); |
169 | } | 169 | } |
170 | atomic_set(&f->profile.get, 0); | 170 | atomic_set(&f->profile.get.atomic_var, 0); |
171 | f->profile.enabled = true; | 171 | f->profile.enabled = true; |
172 | } | 172 | } |
173 | } | 173 | } |
@@ -246,7 +246,7 @@ static int gk20a_fifo_profile_stats(struct seq_file *s, void *unused) | |||
246 | return 0; | 246 | return 0; |
247 | } | 247 | } |
248 | 248 | ||
249 | get = atomic_read(&g->fifo.profile.get); | 249 | get = atomic_read(&g->fifo.profile.get.atomic_var); |
250 | 250 | ||
251 | __gk20a_fifo_create_stats(g, percentiles_ioctl, | 251 | __gk20a_fifo_create_stats(g, percentiles_ioctl, |
252 | PROFILE_IOCTL_EXIT, PROFILE_IOCTL_ENTRY); | 252 | PROFILE_IOCTL_EXIT, PROFILE_IOCTL_ENTRY); |
@@ -311,7 +311,7 @@ void gk20a_fifo_debugfs_init(struct gk20a *g) | |||
311 | 311 | ||
312 | nvgpu_mutex_init(&g->fifo.profile.lock); | 312 | nvgpu_mutex_init(&g->fifo.profile.lock); |
313 | g->fifo.profile.enabled = false; | 313 | g->fifo.profile.enabled = false; |
314 | atomic_set(&g->fifo.profile.get, 0); | 314 | atomic_set(&g->fifo.profile.get.atomic_var, 0); |
315 | atomic_set(&g->fifo.profile.ref.refcount, 0); | 315 | atomic_set(&g->fifo.profile.ref.refcount, 0); |
316 | 316 | ||
317 | debugfs_create_file("enable", 0600, profile_root, g, | 317 | debugfs_create_file("enable", 0600, profile_root, g, |
@@ -342,7 +342,7 @@ struct fifo_profile_gk20a *gk20a_fifo_profile_acquire(struct gk20a *g) | |||
342 | /* If kref is zero, profiling is not enabled */ | 342 | /* If kref is zero, profiling is not enabled */ |
343 | if (!kref_get_unless_zero(&f->profile.ref)) | 343 | if (!kref_get_unless_zero(&f->profile.ref)) |
344 | return NULL; | 344 | return NULL; |
345 | index = atomic_inc_return(&f->profile.get); | 345 | index = atomic_inc_return(&f->profile.get.atomic_var); |
346 | profile = &f->profile.data[index % FIFO_PROFILING_ENTRIES]; | 346 | profile = &f->profile.data[index % FIFO_PROFILING_ENTRIES]; |
347 | 347 | ||
348 | return profile; | 348 | return profile; |