summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorDebarshi Dutta <ddutta@nvidia.com>2017-08-03 06:04:44 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-17 17:26:47 -0400
commit98186ec2c2127c2af65a34f9e697e04f518a79ab (patch)
tree08ad87f3bf8c739e96b36f01728a8f7a30749a0e /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parent49dc335cfe588179cbb42d8bab53bc76ba88b28f (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/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 16fe7149..e21be1e5 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -617,7 +617,7 @@ static int gk20a_init_vidmem(struct mm_gk20a *mm)
617 nvgpu_mutex_init(&mm->vidmem.first_clear_mutex); 617 nvgpu_mutex_init(&mm->vidmem.first_clear_mutex);
618 618
619 INIT_WORK(&mm->vidmem.clear_mem_worker, gk20a_vidmem_clear_mem_worker); 619 INIT_WORK(&mm->vidmem.clear_mem_worker, gk20a_vidmem_clear_mem_worker);
620 atomic64_set(&mm->vidmem.bytes_pending, 0); 620 nvgpu_atomic64_set(&mm->vidmem.bytes_pending, 0);
621 nvgpu_init_list_node(&mm->vidmem.clear_list_head); 621 nvgpu_init_list_node(&mm->vidmem.clear_list_head);
622 nvgpu_mutex_init(&mm->vidmem.clear_list_mutex); 622 nvgpu_mutex_init(&mm->vidmem.clear_list_mutex);
623 623
@@ -1165,7 +1165,7 @@ int gk20a_vidmem_get_space(struct gk20a *g, u64 *space)
1165 1165
1166 nvgpu_mutex_acquire(&g->mm.vidmem.clear_list_mutex); 1166 nvgpu_mutex_acquire(&g->mm.vidmem.clear_list_mutex);
1167 *space = nvgpu_alloc_space(allocator) + 1167 *space = nvgpu_alloc_space(allocator) +
1168 atomic64_read(&g->mm.vidmem.bytes_pending); 1168 nvgpu_atomic64_read(&g->mm.vidmem.bytes_pending);
1169 nvgpu_mutex_release(&g->mm.vidmem.clear_list_mutex); 1169 nvgpu_mutex_release(&g->mm.vidmem.clear_list_mutex);
1170 return 0; 1170 return 0;
1171#else 1171#else
@@ -1483,7 +1483,7 @@ static void gk20a_vidmem_clear_mem_worker(struct work_struct *work)
1483 (u64)get_vidmem_page_alloc(mem->priv.sgt->sgl)); 1483 (u64)get_vidmem_page_alloc(mem->priv.sgt->sgl));
1484 nvgpu_free_sgtable(g, &mem->priv.sgt); 1484 nvgpu_free_sgtable(g, &mem->priv.sgt);
1485 1485
1486 WARN_ON(atomic64_sub_return(mem->size, 1486 WARN_ON(nvgpu_atomic64_sub_return(mem->size,
1487 &g->mm.vidmem.bytes_pending) < 0); 1487 &g->mm.vidmem.bytes_pending) < 0);
1488 mem->size = 0; 1488 mem->size = 0;
1489 mem->aperture = APERTURE_INVALID; 1489 mem->aperture = APERTURE_INVALID;