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/fence_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/fence_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fence_gk20a.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c index a7250b17..fdfef3da 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c | |||
@@ -33,10 +33,10 @@ | |||
33 | struct gk20a_fence_ops { | 33 | struct gk20a_fence_ops { |
34 | int (*wait)(struct gk20a_fence *, long timeout); | 34 | int (*wait)(struct gk20a_fence *, long timeout); |
35 | bool (*is_expired)(struct gk20a_fence *); | 35 | bool (*is_expired)(struct gk20a_fence *); |
36 | void *(*free)(struct kref *); | 36 | void *(*free)(struct nvgpu_ref *); |
37 | }; | 37 | }; |
38 | 38 | ||
39 | static void gk20a_fence_free(struct kref *ref) | 39 | static void gk20a_fence_free(struct nvgpu_ref *ref) |
40 | { | 40 | { |
41 | struct gk20a_fence *f = | 41 | struct gk20a_fence *f = |
42 | container_of(ref, struct gk20a_fence, ref); | 42 | container_of(ref, struct gk20a_fence, ref); |
@@ -59,13 +59,13 @@ static void gk20a_fence_free(struct kref *ref) | |||
59 | void gk20a_fence_put(struct gk20a_fence *f) | 59 | void gk20a_fence_put(struct gk20a_fence *f) |
60 | { | 60 | { |
61 | if (f) | 61 | if (f) |
62 | kref_put(&f->ref, gk20a_fence_free); | 62 | nvgpu_ref_put(&f->ref, gk20a_fence_free); |
63 | } | 63 | } |
64 | 64 | ||
65 | struct gk20a_fence *gk20a_fence_get(struct gk20a_fence *f) | 65 | struct gk20a_fence *gk20a_fence_get(struct gk20a_fence *f) |
66 | { | 66 | { |
67 | if (f) | 67 | if (f) |
68 | kref_get(&f->ref); | 68 | nvgpu_ref_get(&f->ref); |
69 | return f; | 69 | return f; |
70 | } | 70 | } |
71 | 71 | ||
@@ -175,7 +175,7 @@ struct gk20a_fence *gk20a_alloc_fence(struct channel_gk20a *c) | |||
175 | fence = nvgpu_kzalloc(c->g, sizeof(struct gk20a_fence)); | 175 | fence = nvgpu_kzalloc(c->g, sizeof(struct gk20a_fence)); |
176 | 176 | ||
177 | if (fence) { | 177 | if (fence) { |
178 | kref_init(&fence->ref); | 178 | nvgpu_ref_init(&fence->ref); |
179 | fence->g = c->g; | 179 | fence->g = c->g; |
180 | } | 180 | } |
181 | 181 | ||