From 24e1c7e0a729158be36d63b821550d206a8a0436 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 8 Mar 2017 17:08:50 -0800 Subject: gpu: nvgpu: Use new kmem API functions (misc) Use the new kmem API functions in misc gk20a code. Some additional modifications were also made: o Add a struct gk20a pointer to gk20a_fence to enable proper kmem free usage. o Add gk20a pointer to alloc_session() in dbg_gpu_gk20a.c to use kmem API for allocating a session. o Plumb a gk20a pointer through the fence creation and deletion. o Use statically allocated buffers for names in file creation. Bug 1799159 Bug 1823380 Change-Id: I3678080e3ffa1f9bcf6934e3f4819a1bc531689b Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1318323 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c index 4bc7ee52..53d5f78d 100644 --- a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c @@ -19,9 +19,11 @@ #include #include #include -#include #include +#include +#include + #include "gk20a.h" #include "css_gr_gk20a.h" @@ -112,7 +114,7 @@ static int css_gr_create_shared_data(struct gr_gk20a *gr) if (gr->cs_data) return 0; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = nvgpu_kzalloc(gr->g, sizeof(*data)); if (!data) return -ENOMEM; @@ -234,7 +236,7 @@ static void css_gr_free_shared_data(struct gr_gk20a *gr) g->ops.css.disable_snapshot(gr); /* release the objects */ - kfree(gr->cs_data); + nvgpu_kfree(gr->g, gr->cs_data); gr->cs_data = NULL; } } @@ -458,7 +460,7 @@ static int css_gr_free_client_data(struct gk20a *g, dma_buf_put(client->dma_handler); } - kfree(client); + nvgpu_kfree(g, client); return ret; } @@ -471,7 +473,7 @@ static int css_gr_create_client_data(struct gk20a *g, struct gk20a_cs_snapshot_client *cur; int ret = 0; - cur = kzalloc(sizeof(*cur), GFP_KERNEL); + cur = nvgpu_kzalloc(g, sizeof(*cur)); if (!cur) { ret = -ENOMEM; goto failed; -- cgit v1.2.2