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/vgpu/gr_vgpu.c | |
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/vgpu/gr_vgpu.c')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gr_vgpu.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c index 36bbee00..5c637d25 100644 --- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c | |||
@@ -866,7 +866,7 @@ static int vgpu_gr_init_gr_setup_sw(struct gk20a *g) | |||
866 | gr->g = g; | 866 | gr->g = g; |
867 | 867 | ||
868 | #if defined(CONFIG_GK20A_CYCLE_STATS) | 868 | #if defined(CONFIG_GK20A_CYCLE_STATS) |
869 | mutex_init(&g->gr.cs_lock); | 869 | nvgpu_mutex_init(&g->gr.cs_lock); |
870 | #endif | 870 | #endif |
871 | 871 | ||
872 | err = vgpu_gr_init_gr_config(g, gr); | 872 | err = vgpu_gr_init_gr_config(g, gr); |
@@ -885,7 +885,7 @@ static int vgpu_gr_init_gr_setup_sw(struct gk20a *g) | |||
885 | if (err) | 885 | if (err) |
886 | goto clean_up; | 886 | goto clean_up; |
887 | 887 | ||
888 | mutex_init(&gr->ctx_mutex); | 888 | nvgpu_mutex_init(&gr->ctx_mutex); |
889 | 889 | ||
890 | gr->sm_error_states = kzalloc( | 890 | gr->sm_error_states = kzalloc( |
891 | sizeof(struct nvgpu_dbg_gpu_sm_error_state_record) * | 891 | sizeof(struct nvgpu_dbg_gpu_sm_error_state_record) * |
@@ -1078,9 +1078,9 @@ static int vgpu_gr_clear_sm_error_state(struct gk20a *g, | |||
1078 | { | 1078 | { |
1079 | struct gr_gk20a *gr = &g->gr; | 1079 | struct gr_gk20a *gr = &g->gr; |
1080 | 1080 | ||
1081 | mutex_lock(&g->dbg_sessions_lock); | 1081 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); |
1082 | memset(&gr->sm_error_states[sm_id], 0, sizeof(*gr->sm_error_states)); | 1082 | memset(&gr->sm_error_states[sm_id], 0, sizeof(*gr->sm_error_states)); |
1083 | mutex_unlock(&g->dbg_sessions_lock); | 1083 | nvgpu_mutex_release(&g->dbg_sessions_lock); |
1084 | 1084 | ||
1085 | return 0; | 1085 | return 0; |
1086 | } | 1086 | } |
@@ -1096,7 +1096,7 @@ void vgpu_gr_handle_sm_esr_event(struct gk20a *g, | |||
1096 | return; | 1096 | return; |
1097 | } | 1097 | } |
1098 | 1098 | ||
1099 | mutex_lock(&g->dbg_sessions_lock); | 1099 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); |
1100 | 1100 | ||
1101 | sm_error_states = &g->gr.sm_error_states[info->sm_id]; | 1101 | sm_error_states = &g->gr.sm_error_states[info->sm_id]; |
1102 | 1102 | ||
@@ -1108,7 +1108,7 @@ void vgpu_gr_handle_sm_esr_event(struct gk20a *g, | |||
1108 | sm_error_states->hww_warp_esr_report_mask = | 1108 | sm_error_states->hww_warp_esr_report_mask = |
1109 | info->hww_warp_esr_report_mask; | 1109 | info->hww_warp_esr_report_mask; |
1110 | 1110 | ||
1111 | mutex_unlock(&g->dbg_sessions_lock); | 1111 | nvgpu_mutex_release(&g->dbg_sessions_lock); |
1112 | } | 1112 | } |
1113 | 1113 | ||
1114 | void vgpu_init_gr_ops(struct gpu_ops *gops) | 1114 | void vgpu_init_gr_ops(struct gpu_ops *gops) |