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/ce2_gk20a.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/ce2_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c index 418572a1..3ca38715 100644 --- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c @@ -26,6 +26,8 @@ #include #include +#include + #include "gk20a.h" #include "debug_gk20a.h" @@ -207,7 +209,7 @@ static void gk20a_ce_delete_gpu_context(struct gk20a_gpu_ctx *ce_ctx) nvgpu_mutex_release(&ce_ctx->gpu_ctx_mutex); nvgpu_mutex_destroy(&ce_ctx->gpu_ctx_mutex); - kfree(ce_ctx); + nvgpu_kfree(ce_ctx->g, ce_ctx); } static inline unsigned int gk20a_ce_get_method_size(int request_operation) @@ -428,7 +430,7 @@ u32 gk20a_ce_create_context_with_cb(struct device *dev, if (!ce_app->initialised || ce_app->app_state != NVGPU_CE_ACTIVE) return ctx_id; - ce_ctx = kzalloc(sizeof(*ce_ctx), GFP_KERNEL); + ce_ctx = nvgpu_kzalloc(g, sizeof(*ce_ctx)); if (!ce_ctx) return ctx_id; -- cgit v1.2.2