diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-03-08 20:08:32 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-29 14:50:21 -0400 |
commit | bc92e2fb972e039ee33c1f1477204a4d145a8b96 (patch) | |
tree | a43df80fe921f3e4b50c70bf67aef30a0b5dd5bb /drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h | |
parent | 4022b989aa2e91fe77ed52df49d45838f6d8b9bb (diff) |
gpu: nvgpu: Use new kmem API functions (gk20a core)
Use the new kmem API functions in core gk20a code. Also add a struct
gk20a pointer to several functions to ensure that the kmem APIs can be
used.
Bug 1799159
Bug 1823380
Change-Id: I41276509c4f0b68e80b989aa55cf94d8dbbdf156
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1318322
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h index 4b3f3ae6..b82f5275 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h | |||
@@ -18,6 +18,8 @@ | |||
18 | #ifndef __GR_CTX_GK20A_H__ | 18 | #ifndef __GR_CTX_GK20A_H__ |
19 | #define __GR_CTX_GK20A_H__ | 19 | #define __GR_CTX_GK20A_H__ |
20 | 20 | ||
21 | #include <nvgpu/kmem.h> | ||
22 | |||
21 | struct gr_gk20a; | 23 | struct gr_gk20a; |
22 | 24 | ||
23 | /* production netlist, one and only one from below */ | 25 | /* production netlist, one and only one from below */ |
@@ -145,23 +147,24 @@ struct ctxsw_buf_offset_map_entry { | |||
145 | }; | 147 | }; |
146 | 148 | ||
147 | static inline | 149 | static inline |
148 | struct av_gk20a *alloc_av_list_gk20a(struct av_list_gk20a *avl) | 150 | struct av_gk20a *alloc_av_list_gk20a(struct gk20a *g, struct av_list_gk20a *avl) |
149 | { | 151 | { |
150 | avl->l = kzalloc(avl->count * sizeof(*avl->l), GFP_KERNEL); | 152 | avl->l = nvgpu_kzalloc(g, avl->count * sizeof(*avl->l)); |
151 | return avl->l; | 153 | return avl->l; |
152 | } | 154 | } |
153 | 155 | ||
154 | static inline | 156 | static inline |
155 | struct aiv_gk20a *alloc_aiv_list_gk20a(struct aiv_list_gk20a *aivl) | 157 | struct aiv_gk20a *alloc_aiv_list_gk20a(struct gk20a *g, |
158 | struct aiv_list_gk20a *aivl) | ||
156 | { | 159 | { |
157 | aivl->l = kzalloc(aivl->count * sizeof(*aivl->l), GFP_KERNEL); | 160 | aivl->l = nvgpu_kzalloc(g, aivl->count * sizeof(*aivl->l)); |
158 | return aivl->l; | 161 | return aivl->l; |
159 | } | 162 | } |
160 | 163 | ||
161 | static inline | 164 | static inline |
162 | u32 *alloc_u32_list_gk20a(struct u32_list_gk20a *u32l) | 165 | u32 *alloc_u32_list_gk20a(struct gk20a *g, struct u32_list_gk20a *u32l) |
163 | { | 166 | { |
164 | u32l->l = kzalloc(u32l->count * sizeof(*u32l->l), GFP_KERNEL); | 167 | u32l->l = nvgpu_kzalloc(g, u32l->count * sizeof(*u32l->l)); |
165 | return u32l->l; | 168 | return u32l->l; |
166 | } | 169 | } |
167 | 170 | ||