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/pmu_gk20a.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/pmu_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h index e4513457..c1583eab 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h @@ -136,7 +136,7 @@ struct pmu_queue { u32 mutex_id; u32 mutex_lock; /* used by sw, for LPQ/HPQ queue */ - struct mutex mutex; + struct nvgpu_mutex mutex; /* current write position */ u32 position; @@ -334,8 +334,8 @@ struct pmu_gk20a { struct pmu_mutex *mutex; u32 mutex_cnt; - struct mutex pmu_copy_lock; - struct mutex pmu_seq_lock; + struct nvgpu_mutex pmu_copy_lock; + struct nvgpu_mutex pmu_seq_lock; struct nvgpu_allocator dmem; @@ -355,8 +355,8 @@ struct pmu_gk20a { #define PMU_ELPG_ENABLE_ALLOW_DELAY_MSEC 1 /* msec */ struct work_struct pg_init; - struct mutex pg_mutex; /* protect pg-RPPG/MSCG enable/disable */ - struct mutex elpg_mutex; /* protect elpg enable/disable */ + struct nvgpu_mutex pg_mutex; /* protect pg-RPPG/MSCG enable/disable */ + struct nvgpu_mutex elpg_mutex; /* protect elpg enable/disable */ int elpg_refcnt; /* disable -1, enable +1, <=0 elpg disabled, > 0 elpg enabled */ union { @@ -375,7 +375,7 @@ struct pmu_gk20a { u32 load_shadow; u32 load_avg; - struct mutex isr_mutex; + struct nvgpu_mutex isr_mutex; bool isr_enabled; bool zbc_ready; -- cgit v1.2.2