From c86e940e1169be32e92297f6dfb07d0c2cade135 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 30 Mar 2017 21:16:51 +0100 Subject: gpu: nvgpu: Remove last Linux kmem usage Replace the last of the Linux kmem API usage with nvgpu kmem calls instead. Several places are left alone - allocating the struct gk20a in particular. Also one function was updated in the clk code to take a struct gk20a as an argument so that it could use nvgpu_kmalloc(). Bug 1799159 Bug 1823380 Change-Id: I84fc3f8e19c63d6265bac6098dc727d93e3ff613 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1331702 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 0e3bcdbe..3e9a388b 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -3343,13 +3343,16 @@ int gk20a_comptag_allocator_init(struct gk20a_comptag_allocator *allocator, void gk20a_comptag_allocator_destroy(struct gk20a_comptag_allocator *allocator) { + struct gr_gk20a *gr = container_of(allocator, + struct gr_gk20a, comp_tags); + /* * called only when exiting the driver (gk20a_remove, or unwinding the * init stage); no users should be active, so taking the mutex is * unnecessary here. */ allocator->size = 0; - vfree(allocator->bitmap); + nvgpu_vfree(gr->g, allocator->bitmap); } static void gk20a_remove_gr_support(struct gr_gk20a *gr) @@ -3419,7 +3422,7 @@ static void gk20a_remove_gr_support(struct gr_gk20a *gr) nvgpu_kfree(g, gr->ctx_vars.ctxsw_regs.pm_ltc.l); nvgpu_kfree(g, gr->ctx_vars.ctxsw_regs.pm_fbpa.l); - vfree(gr->ctx_vars.local_golden_image); + nvgpu_vfree(g, gr->ctx_vars.local_golden_image); gr->ctx_vars.local_golden_image = NULL; if (gr->ctx_vars.hwpm_ctxsw_buffer_offset_map) -- cgit v1.2.2