From 7010bf88399ea81b2b35844f738baac19dc5a441 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 8 Mar 2017 17:06:47 -0800 Subject: gpu: nvgpu: Use new kmem API functions (gk20a mm) Use the new kmem API functions in gk20a's mm code. Add a struct gk20a pointer to the dmabuf priv struct so that the cleanup function has access to the gk20a struct. Also add a gk20a pointer to some of the sg table functions so that they can use the nvgpu kmem APIs. Bug 1799159 Bug 1823380 Change-Id: I85a307c6bf862627c5b1af0e077283b48d78fa72 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1318321 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker Reviewed-by: Konsta Holtta GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/as_gk20a.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/as_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/as_gk20a.c b/drivers/gpu/nvgpu/gk20a/as_gk20a.c index 7dcb8ed7..5acc626b 100644 --- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c @@ -22,6 +22,8 @@ #include +#include + #include "gk20a.h" /* dumb allocator... */ @@ -51,7 +53,7 @@ int gk20a_as_alloc_share(struct gk20a_as *as, return -ENODEV; *out = NULL; - as_share = kzalloc(sizeof(*as_share), GFP_KERNEL); + as_share = nvgpu_kzalloc(g, sizeof(*as_share)); if (!as_share) return -ENOMEM; @@ -72,7 +74,7 @@ int gk20a_as_alloc_share(struct gk20a_as *as, return 0; failed: - kfree(as_share); + nvgpu_kfree(g, as_share); return err; } @@ -98,8 +100,8 @@ int gk20a_as_release_share(struct gk20a_as_share *as_share) release_fail: release_as_share_id(as_share->as, as_share->id); + nvgpu_kfree(g, as_share); gk20a_put(g); - kfree(as_share); return err; } -- cgit v1.2.2