From 707ea45e0f1d7a07885597777496b186dd5fb6f0 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 11 Jan 2017 15:00:54 -0800 Subject: gpu: nvgpu: kmem abstraction and tracking Implement kmem abstraction and tracking in nvgpu. The abstraction helps move nvgpu's core code away from being Linux dependent and allows kmem allocation tracking to be done for Linux and any other OS supported by nvgpu. Bug 1799159 Bug 1823380 Change-Id: Ieaae4ca1bbd1d4db4a1546616ab8b9fc53a4079d Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1283828 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index f228110e..68e43259 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -986,7 +986,7 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) memset(&ch->ramfc, 0, sizeof(struct mem_desc_sub)); gk20a_gmmu_unmap_free(ch_vm, &ch->gpfifo.mem); - nvgpu_big_free(ch->gpfifo.pipe); + nvgpu_big_free(g, ch->gpfifo.pipe); memset(&ch->gpfifo, 0, sizeof(struct gpfifo_desc)); #if defined(CONFIG_GK20A_CYCLE_STATS) @@ -1856,7 +1856,7 @@ int gk20a_alloc_channel_gpfifo(struct channel_gk20a *c, } if (c->gpfifo.mem.aperture == APERTURE_VIDMEM || g->mm.force_pramin) { - c->gpfifo.pipe = nvgpu_big_malloc( + c->gpfifo.pipe = nvgpu_big_malloc(g, gpfifo_size * sizeof(struct nvgpu_gpfifo)); if (!c->gpfifo.pipe) { err = -ENOMEM; @@ -1927,7 +1927,7 @@ clean_up_sync: c->sync = NULL; } clean_up_unmap: - nvgpu_big_free(c->gpfifo.pipe); + nvgpu_big_free(g, c->gpfifo.pipe); gk20a_gmmu_unmap_free(ch_vm, &c->gpfifo.mem); clean_up: memset(&c->gpfifo, 0, sizeof(struct gpfifo_desc)); @@ -2057,12 +2057,12 @@ static void trace_write_pushbuffer_range(struct channel_gk20a *c, if (!g) { size = count * sizeof(struct nvgpu_gpfifo); if (size) { - g = nvgpu_big_malloc(size); + g = nvgpu_big_malloc(c->g, size); if (!g) return; if (copy_from_user(g, user_gpfifo, size)) { - nvgpu_big_free(g); + nvgpu_big_free(c->g, g); return; } } @@ -2074,7 +2074,7 @@ static void trace_write_pushbuffer_range(struct channel_gk20a *c, trace_write_pushbuffer(c, gp); if (gpfifo_allocated) - nvgpu_big_free(g); + nvgpu_big_free(c->g, g); } static void __gk20a_channel_timeout_start(struct channel_gk20a *ch) -- cgit v1.2.2