summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.h
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/gk20a/gk20a.h
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/gk20a/gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 31b02378..acc3b975 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -29,7 +29,7 @@ struct gk20a_ctxsw_trace;
29struct acr_desc; 29struct acr_desc;
30 30
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/spinlock.h> 32#include <nvgpu/lock.h>
33#include <linux/nvgpu.h> 33#include <linux/nvgpu.h>
34#include <linux/irqreturn.h> 34#include <linux/irqreturn.h>
35#include <soc/tegra/chip-id.h> 35#include <soc/tegra/chip-id.h>
@@ -871,9 +871,9 @@ struct gk20a {
871 bool timeouts_enabled; 871 bool timeouts_enabled;
872#endif 872#endif
873 873
874 struct mutex ch_wdt_lock; 874 struct nvgpu_mutex ch_wdt_lock;
875 875
876 struct mutex poweroff_lock; 876 struct nvgpu_mutex poweroff_lock;
877 877
878 /* Channel priorities */ 878 /* Channel priorities */
879 u32 timeslice_low_priority_us; 879 u32 timeslice_low_priority_us;
@@ -900,7 +900,7 @@ struct gk20a {
900 u32 emc3d_ratio; 900 u32 emc3d_ratio;
901 901
902#ifdef CONFIG_DEBUG_FS 902#ifdef CONFIG_DEBUG_FS
903 spinlock_t debugfs_lock; 903 struct nvgpu_spinlock debugfs_lock;
904 struct dentry *debugfs_ltc_enabled; 904 struct dentry *debugfs_ltc_enabled;
905 struct dentry *debugfs_timeouts_enabled; 905 struct dentry *debugfs_timeouts_enabled;
906 struct dentry *debugfs_gr_idle_timeout_default; 906 struct dentry *debugfs_gr_idle_timeout_default;
@@ -924,11 +924,11 @@ struct gk20a {
924 924
925 /* List of pending SW semaphore waits. */ 925 /* List of pending SW semaphore waits. */
926 struct list_head pending_sema_waits; 926 struct list_head pending_sema_waits;
927 raw_spinlock_t pending_sema_waits_lock; 927 struct nvgpu_raw_spinlock pending_sema_waits_lock;
928 928
929 /* held while manipulating # of debug/profiler sessions present */ 929 /* held while manipulating # of debug/profiler sessions present */
930 /* also prevents debug sessions from attaching until released */ 930 /* also prevents debug sessions from attaching until released */
931 struct mutex dbg_sessions_lock; 931 struct nvgpu_mutex dbg_sessions_lock;
932 int dbg_powergating_disabled_refcount; /*refcount for pg disable */ 932 int dbg_powergating_disabled_refcount; /*refcount for pg disable */
933 int dbg_timeout_disabled_refcount; /*refcount for timeout disable */ 933 int dbg_timeout_disabled_refcount; /*refcount for timeout disable */
934 934
@@ -942,7 +942,7 @@ struct gk20a {
942 u64 pg_ungating_time_us; 942 u64 pg_ungating_time_us;
943 u32 pg_gating_cnt; 943 u32 pg_gating_cnt;
944 944
945 spinlock_t mc_enable_lock; 945 struct nvgpu_spinlock mc_enable_lock;
946 946
947 struct nvgpu_gpu_characteristics gpu_characteristics; 947 struct nvgpu_gpu_characteristics gpu_characteristics;
948 948
@@ -983,7 +983,7 @@ struct gk20a {
983 struct device *node; 983 struct device *node;
984 } sched; 984 } sched;
985 985
986 struct mutex client_lock; 986 struct nvgpu_mutex client_lock;
987 int client_refcount; /* open channels and ctrl nodes */ 987 int client_refcount; /* open channels and ctrl nodes */
988 988
989 dev_t cdev_region; 989 dev_t cdev_region;
@@ -1289,11 +1289,11 @@ static inline u32 get_field(u32 reg, u32 mask)
1289/* invalidate channel lookup tlb */ 1289/* invalidate channel lookup tlb */
1290static inline void gk20a_gr_flush_channel_tlb(struct gr_gk20a *gr) 1290static inline void gk20a_gr_flush_channel_tlb(struct gr_gk20a *gr)
1291{ 1291{
1292 spin_lock(&gr->ch_tlb_lock); 1292 nvgpu_spinlock_acquire(&gr->ch_tlb_lock);
1293 memset(gr->chid_tlb, 0, 1293 memset(gr->chid_tlb, 0,
1294 sizeof(struct gr_channel_map_tlb_entry) * 1294 sizeof(struct gr_channel_map_tlb_entry) *
1295 GR_CHANNEL_MAP_TLB_SIZE); 1295 GR_CHANNEL_MAP_TLB_SIZE);
1296 spin_unlock(&gr->ch_tlb_lock); 1296 nvgpu_spinlock_release(&gr->ch_tlb_lock);
1297} 1297}
1298 1298
1299/* classes that the device supports */ 1299/* classes that the device supports */