From bc92e2fb972e039ee33c1f1477204a4d145a8b96 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 8 Mar 2017 17:08:32 -0800 Subject: 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 Reviewed-on: http://git-master/r/1318322 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.h') 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 @@ #ifndef __GR_CTX_GK20A_H__ #define __GR_CTX_GK20A_H__ +#include + struct gr_gk20a; /* production netlist, one and only one from below */ @@ -145,23 +147,24 @@ struct ctxsw_buf_offset_map_entry { }; static inline -struct av_gk20a *alloc_av_list_gk20a(struct av_list_gk20a *avl) +struct av_gk20a *alloc_av_list_gk20a(struct gk20a *g, struct av_list_gk20a *avl) { - avl->l = kzalloc(avl->count * sizeof(*avl->l), GFP_KERNEL); + avl->l = nvgpu_kzalloc(g, avl->count * sizeof(*avl->l)); return avl->l; } static inline -struct aiv_gk20a *alloc_aiv_list_gk20a(struct aiv_list_gk20a *aivl) +struct aiv_gk20a *alloc_aiv_list_gk20a(struct gk20a *g, + struct aiv_list_gk20a *aivl) { - aivl->l = kzalloc(aivl->count * sizeof(*aivl->l), GFP_KERNEL); + aivl->l = nvgpu_kzalloc(g, aivl->count * sizeof(*aivl->l)); return aivl->l; } static inline -u32 *alloc_u32_list_gk20a(struct u32_list_gk20a *u32l) +u32 *alloc_u32_list_gk20a(struct gk20a *g, struct u32_list_gk20a *u32l) { - u32l->l = kzalloc(u32l->count * sizeof(*u32l->l), GFP_KERNEL); + u32l->l = nvgpu_kzalloc(g, u32l->count * sizeof(*u32l->l)); return u32l->l; } -- cgit v1.2.2