summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-01-24 08:30:42 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-02-22 07:15:02 -0500
commit8ee3aa4b3175d8d27e57a0f5d5e2cdf3d78a4a58 (patch)
tree505dfd2ea2aca2f1cbdb254baee980862d21e04d /drivers/gpu/nvgpu/vgpu/mm_vgpu.c
parent1f855af63fdd31fe3dcfee75f4f5f9b62f30d87e (diff)
gpu: nvgpu: use common nvgpu mutex/spinlock APIs
Instead of using Linux APIs for mutex and spinlocks directly, use new APIs defined in <nvgpu/lock.h> Replace Linux specific mutex/spinlock declaration, init, lock, unlock APIs with new APIs e.g struct mutex is replaced by struct nvgpu_mutex and mutex_lock() is replaced by nvgpu_mutex_acquire() And also include <nvgpu/lock.h> instead of including <linux/mutex.h> and <linux/spinlock.h> Add explicit nvgpu/lock.h includes to below files to fix complilation failures. gk20a/platform_gk20a.h include/nvgpu/allocator.h Jira NVGPU-13 Change-Id: I81a05d21ecdbd90c2076a9f0aefd0e40b215bd33 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1293187 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/mm_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index c6780cf7..70b50e7e 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -200,7 +200,7 @@ static void vgpu_vm_remove_support(struct vm_gk20a *vm)
200 int err; 200 int err;
201 201
202 gk20a_dbg_fn(""); 202 gk20a_dbg_fn("");
203 mutex_lock(&vm->update_gmmu_lock); 203 nvgpu_mutex_acquire(&vm->update_gmmu_lock);
204 204
205 /* TBD: add a flag here for the unmap code to recognize teardown 205 /* TBD: add a flag here for the unmap code to recognize teardown
206 * and short-circuit any otherwise expensive operations. */ 206 * and short-circuit any otherwise expensive operations. */
@@ -231,7 +231,7 @@ static void vgpu_vm_remove_support(struct vm_gk20a *vm)
231 if (nvgpu_alloc_initialized(&vm->user)) 231 if (nvgpu_alloc_initialized(&vm->user))
232 nvgpu_alloc_destroy(&vm->user); 232 nvgpu_alloc_destroy(&vm->user);
233 233
234 mutex_unlock(&vm->update_gmmu_lock); 234 nvgpu_mutex_release(&vm->update_gmmu_lock);
235 235
236 /* vm is not used anymore. release it. */ 236 /* vm is not used anymore. release it. */
237 kfree(vm); 237 kfree(vm);
@@ -401,7 +401,7 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
401 401
402 vm->mapped_buffers = RB_ROOT; 402 vm->mapped_buffers = RB_ROOT;
403 403
404 mutex_init(&vm->update_gmmu_lock); 404 nvgpu_mutex_init(&vm->update_gmmu_lock);
405 kref_init(&vm->ref); 405 kref_init(&vm->ref);
406 INIT_LIST_HEAD(&vm->reserved_va_list); 406 INIT_LIST_HEAD(&vm->reserved_va_list);
407 407