diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-01-24 08:30:42 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-02-22 07:15:02 -0500 |
commit | 8ee3aa4b3175d8d27e57a0f5d5e2cdf3d78a4a58 (patch) | |
tree | 505dfd2ea2aca2f1cbdb254baee980862d21e04d /drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |
parent | 1f855af63fdd31fe3dcfee75f4f5f9b62f30d87e (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/gk20a/mm_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 12 |
1 files changed, 6 insertions, 6 deletions
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 { | |||
131 | struct list_head list; | 131 | struct list_head list; |
132 | 132 | ||
133 | /* The valid compbits and the fence must be changed atomically. */ | 133 | /* The valid compbits and the fence must be changed atomically. */ |
134 | struct mutex lock; | 134 | struct nvgpu_mutex lock; |
135 | 135 | ||
136 | /* Offset of the surface within the dma-buf whose state is | 136 | /* Offset of the surface within the dma-buf whose state is |
137 | * described by this struct (one dma-buf can contain multiple | 137 | * described by this struct (one dma-buf can contain multiple |
@@ -272,7 +272,7 @@ struct vm_gk20a { | |||
272 | 272 | ||
273 | struct kref ref; | 273 | struct kref ref; |
274 | 274 | ||
275 | struct mutex update_gmmu_lock; | 275 | struct nvgpu_mutex update_gmmu_lock; |
276 | 276 | ||
277 | struct gk20a_mm_entry pdb; | 277 | struct gk20a_mm_entry pdb; |
278 | 278 | ||
@@ -360,7 +360,7 @@ struct mm_gk20a { | |||
360 | struct vm_gk20a vm; | 360 | struct vm_gk20a vm; |
361 | } ce; | 361 | } ce; |
362 | 362 | ||
363 | struct mutex l2_op_lock; | 363 | struct nvgpu_mutex l2_op_lock; |
364 | #ifdef CONFIG_ARCH_TEGRA_18x_SOC | 364 | #ifdef CONFIG_ARCH_TEGRA_18x_SOC |
365 | struct mem_desc bar2_desc; | 365 | struct mem_desc bar2_desc; |
366 | #endif | 366 | #endif |
@@ -395,7 +395,7 @@ struct mm_gk20a { | |||
395 | struct mem_desc sysmem_flush; | 395 | struct mem_desc sysmem_flush; |
396 | 396 | ||
397 | u32 pramin_window; | 397 | u32 pramin_window; |
398 | spinlock_t pramin_window_lock; | 398 | struct nvgpu_spinlock pramin_window_lock; |
399 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) | 399 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) |
400 | u32 force_pramin; /* via debugfs */ | 400 | u32 force_pramin; /* via debugfs */ |
401 | #else | 401 | #else |
@@ -413,10 +413,10 @@ struct mm_gk20a { | |||
413 | 413 | ||
414 | u32 ce_ctx_id; | 414 | u32 ce_ctx_id; |
415 | volatile bool cleared; | 415 | volatile bool cleared; |
416 | struct mutex first_clear_mutex; | 416 | struct nvgpu_mutex first_clear_mutex; |
417 | 417 | ||
418 | struct list_head clear_list_head; | 418 | struct list_head clear_list_head; |
419 | struct mutex clear_list_mutex; | 419 | struct nvgpu_mutex clear_list_mutex; |
420 | 420 | ||
421 | struct work_struct clear_mem_worker; | 421 | struct work_struct clear_mem_worker; |
422 | atomic64_t bytes_pending; | 422 | atomic64_t bytes_pending; |