diff options
author | Debarshi Dutta <ddutta@nvidia.com> | 2017-08-08 02:38:03 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-24 04:10:37 -0400 |
commit | 3fa47b877db1edc16018d662e7b9915d92354745 (patch) | |
tree | c1d9a8734e7d92b5ae647fbc3f582a01207a23f6 /drivers/gpu/nvgpu/gk20a/sync_gk20a.c | |
parent | 8662fae334f2419da2e7fd220f7734217ec52433 (diff) |
gpu: nvgpu: Replace kref for refcounting in nvgpu
- added wrapper struct nvgpu_ref over nvgpu_atomic_t
- added nvgpu_ref_* APIs to access the above struct
JIRA NVGPU-140
Change-Id: Id47f897995dd4721751f7610b6d4d4fbfe4d6b9a
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1540899
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/sync_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/sync_gk20a.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c index deaf19a1..a8e824b6 100644 --- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c | |||
@@ -43,7 +43,7 @@ struct gk20a_sync_timeline { | |||
43 | */ | 43 | */ |
44 | struct gk20a_sync_pt { | 44 | struct gk20a_sync_pt { |
45 | struct gk20a *g; | 45 | struct gk20a *g; |
46 | struct kref refcount; | 46 | struct nvgpu_ref refcount; |
47 | u32 thresh; | 47 | u32 thresh; |
48 | struct nvgpu_semaphore *sema; | 48 | struct nvgpu_semaphore *sema; |
49 | struct gk20a_sync_timeline *obj; | 49 | struct gk20a_sync_timeline *obj; |
@@ -170,7 +170,7 @@ static struct gk20a_sync_timeline *to_gk20a_timeline(struct sync_timeline *obj) | |||
170 | return (struct gk20a_sync_timeline *)obj; | 170 | return (struct gk20a_sync_timeline *)obj; |
171 | } | 171 | } |
172 | 172 | ||
173 | static void gk20a_sync_pt_free_shared(struct kref *ref) | 173 | static void gk20a_sync_pt_free_shared(struct nvgpu_ref *ref) |
174 | { | 174 | { |
175 | struct gk20a_sync_pt *pt = | 175 | struct gk20a_sync_pt *pt = |
176 | container_of(ref, struct gk20a_sync_pt, refcount); | 176 | container_of(ref, struct gk20a_sync_pt, refcount); |
@@ -192,7 +192,7 @@ static struct gk20a_sync_pt *gk20a_sync_pt_create_shared( | |||
192 | if (!shared) | 192 | if (!shared) |
193 | return NULL; | 193 | return NULL; |
194 | 194 | ||
195 | kref_init(&shared->refcount); | 195 | nvgpu_ref_init(&shared->refcount); |
196 | shared->g = g; | 196 | shared->g = g; |
197 | shared->obj = obj; | 197 | shared->obj = obj; |
198 | shared->sema = sema; | 198 | shared->sema = sema; |
@@ -229,7 +229,7 @@ static void gk20a_sync_pt_free_inst(struct sync_pt *sync_pt) | |||
229 | { | 229 | { |
230 | struct gk20a_sync_pt *pt = to_gk20a_sync_pt(sync_pt); | 230 | struct gk20a_sync_pt *pt = to_gk20a_sync_pt(sync_pt); |
231 | if (pt) | 231 | if (pt) |
232 | kref_put(&pt->refcount, gk20a_sync_pt_free_shared); | 232 | nvgpu_ref_put(&pt->refcount, gk20a_sync_pt_free_shared); |
233 | } | 233 | } |
234 | 234 | ||
235 | static struct sync_pt *gk20a_sync_pt_dup_inst(struct sync_pt *sync_pt) | 235 | static struct sync_pt *gk20a_sync_pt_dup_inst(struct sync_pt *sync_pt) |
@@ -242,7 +242,7 @@ static struct sync_pt *gk20a_sync_pt_dup_inst(struct sync_pt *sync_pt) | |||
242 | if (!pti) | 242 | if (!pti) |
243 | return NULL; | 243 | return NULL; |
244 | pti->shared = pt; | 244 | pti->shared = pt; |
245 | kref_get(&pt->refcount); | 245 | nvgpu_ref_get(&pt->refcount); |
246 | return &pti->pt; | 246 | return &pti->pt; |
247 | } | 247 | } |
248 | 248 | ||