summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/as_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-03-08 20:06:47 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-30 15:36:04 -0400
commit7010bf88399ea81b2b35844f738baac19dc5a441 (patch)
tree476a43b94402d702f20c4336dec98009d23a2afa /drivers/gpu/nvgpu/gk20a/as_gk20a.c
parentbc92e2fb972e039ee33c1f1477204a4d145a8b96 (diff)
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 <alexw@nvidia.com> Reviewed-on: http://git-master/r/1318321 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: Konsta Holtta <kholtta@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/as_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/as_gk20a.c8
1 files changed, 5 insertions, 3 deletions
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 @@
22 22
23#include <uapi/linux/nvgpu.h> 23#include <uapi/linux/nvgpu.h>
24 24
25#include <nvgpu/kmem.h>
26
25#include "gk20a.h" 27#include "gk20a.h"
26 28
27/* dumb allocator... */ 29/* dumb allocator... */
@@ -51,7 +53,7 @@ int gk20a_as_alloc_share(struct gk20a_as *as,
51 return -ENODEV; 53 return -ENODEV;
52 54
53 *out = NULL; 55 *out = NULL;
54 as_share = kzalloc(sizeof(*as_share), GFP_KERNEL); 56 as_share = nvgpu_kzalloc(g, sizeof(*as_share));
55 if (!as_share) 57 if (!as_share)
56 return -ENOMEM; 58 return -ENOMEM;
57 59
@@ -72,7 +74,7 @@ int gk20a_as_alloc_share(struct gk20a_as *as,
72 return 0; 74 return 0;
73 75
74failed: 76failed:
75 kfree(as_share); 77 nvgpu_kfree(g, as_share);
76 return err; 78 return err;
77} 79}
78 80
@@ -98,8 +100,8 @@ int gk20a_as_release_share(struct gk20a_as_share *as_share)
98 100
99release_fail: 101release_fail:
100 release_as_share_id(as_share->as, as_share->id); 102 release_as_share_id(as_share->as, as_share->id);
103 nvgpu_kfree(g, as_share);
101 gk20a_put(g); 104 gk20a_put(g);
102 kfree(as_share);
103 105
104 return err; 106 return err;
105} 107}