summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-03-08 20:08:50 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-30 15:36:09 -0400
commit24e1c7e0a729158be36d63b821550d206a8a0436 (patch)
treecf26c850cc63957f63f3e8f97914268839d8e0de /drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c
parent7010bf88399ea81b2b35844f738baac19dc5a441 (diff)
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 <alexw@nvidia.com> Reviewed-on: http://git-master/r/1318323 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c12
1 files changed, 7 insertions, 5 deletions
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 @@
19#include <linux/bitops.h> 19#include <linux/bitops.h>
20#include <linux/dma-mapping.h> 20#include <linux/dma-mapping.h>
21#include <linux/dma-buf.h> 21#include <linux/dma-buf.h>
22#include <nvgpu/lock.h>
23#include <linux/vmalloc.h> 22#include <linux/vmalloc.h>
24 23
24#include <nvgpu/kmem.h>
25#include <nvgpu/lock.h>
26
25#include "gk20a.h" 27#include "gk20a.h"
26#include "css_gr_gk20a.h" 28#include "css_gr_gk20a.h"
27 29
@@ -112,7 +114,7 @@ static int css_gr_create_shared_data(struct gr_gk20a *gr)
112 if (gr->cs_data) 114 if (gr->cs_data)
113 return 0; 115 return 0;
114 116
115 data = kzalloc(sizeof(*data), GFP_KERNEL); 117 data = nvgpu_kzalloc(gr->g, sizeof(*data));
116 if (!data) 118 if (!data)
117 return -ENOMEM; 119 return -ENOMEM;
118 120
@@ -234,7 +236,7 @@ static void css_gr_free_shared_data(struct gr_gk20a *gr)
234 g->ops.css.disable_snapshot(gr); 236 g->ops.css.disable_snapshot(gr);
235 237
236 /* release the objects */ 238 /* release the objects */
237 kfree(gr->cs_data); 239 nvgpu_kfree(gr->g, gr->cs_data);
238 gr->cs_data = NULL; 240 gr->cs_data = NULL;
239 } 241 }
240} 242}
@@ -458,7 +460,7 @@ static int css_gr_free_client_data(struct gk20a *g,
458 dma_buf_put(client->dma_handler); 460 dma_buf_put(client->dma_handler);
459 } 461 }
460 462
461 kfree(client); 463 nvgpu_kfree(g, client);
462 464
463 return ret; 465 return ret;
464} 466}
@@ -471,7 +473,7 @@ static int css_gr_create_client_data(struct gk20a *g,
471 struct gk20a_cs_snapshot_client *cur; 473 struct gk20a_cs_snapshot_client *cur;
472 int ret = 0; 474 int ret = 0;
473 475
474 cur = kzalloc(sizeof(*cur), GFP_KERNEL); 476 cur = nvgpu_kzalloc(g, sizeof(*cur));
475 if (!cur) { 477 if (!cur) {
476 ret = -ENOMEM; 478 ret = -ENOMEM;
477 goto failed; 479 goto failed;