From 8ee3aa4b3175d8d27e57a0f5d5e2cdf3d78a4a58 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 24 Jan 2017 19:00:42 +0530 Subject: gpu: nvgpu: use common nvgpu mutex/spinlock APIs Instead of using Linux APIs for mutex and spinlocks directly, use new APIs defined in 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 instead of including and 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 Reviewed-on: http://git-master/r/1293187 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/sync_gk20a.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/sync_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c index edfe3deb..f57871d5 100644 --- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c @@ -20,8 +20,7 @@ #include #include #include -#include - +#include #include #include @@ -55,7 +54,7 @@ struct gk20a_sync_pt { * than a mutex - there should be very little contention on this * lock. */ - spinlock_t lock; + struct nvgpu_spinlock lock; }; struct gk20a_sync_pt_inst { @@ -242,7 +241,7 @@ static struct gk20a_sync_pt *gk20a_sync_pt_create_shared( } } - spin_lock_init(&shared->lock); + nvgpu_spinlock_init(&shared->lock); nvgpu_semaphore_get(sema); @@ -304,7 +303,7 @@ static int gk20a_sync_pt_has_signaled(struct sync_pt *sync_pt) #endif bool signaled = true; - spin_lock(&pt->lock); + nvgpu_spinlock_acquire(&pt->lock); if (!pt->sema) goto done; @@ -345,7 +344,7 @@ static int gk20a_sync_pt_has_signaled(struct sync_pt *sync_pt) pt->sema = NULL; } done: - spin_unlock(&pt->lock); + nvgpu_spinlock_release(&pt->lock); return signaled; } -- cgit v1.2.2