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/mm_gk20a.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index 294dc628..5f29c9e7 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h @@ -131,7 +131,7 @@ struct gk20a_buffer_state { struct list_head list; /* The valid compbits and the fence must be changed atomically. */ - struct mutex lock; + struct nvgpu_mutex lock; /* Offset of the surface within the dma-buf whose state is * described by this struct (one dma-buf can contain multiple @@ -272,7 +272,7 @@ struct vm_gk20a { struct kref ref; - struct mutex update_gmmu_lock; + struct nvgpu_mutex update_gmmu_lock; struct gk20a_mm_entry pdb; @@ -360,7 +360,7 @@ struct mm_gk20a { struct vm_gk20a vm; } ce; - struct mutex l2_op_lock; + struct nvgpu_mutex l2_op_lock; #ifdef CONFIG_ARCH_TEGRA_18x_SOC struct mem_desc bar2_desc; #endif @@ -395,7 +395,7 @@ struct mm_gk20a { struct mem_desc sysmem_flush; u32 pramin_window; - spinlock_t pramin_window_lock; + struct nvgpu_spinlock pramin_window_lock; #if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) u32 force_pramin; /* via debugfs */ #else @@ -413,10 +413,10 @@ struct mm_gk20a { u32 ce_ctx_id; volatile bool cleared; - struct mutex first_clear_mutex; + struct nvgpu_mutex first_clear_mutex; struct list_head clear_list_head; - struct mutex clear_list_mutex; + struct nvgpu_mutex clear_list_mutex; struct work_struct clear_mem_worker; atomic64_t bytes_pending; -- cgit v1.2.2