summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-01-11 18:00:54 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-03 13:34:48 -0500
commit707ea45e0f1d7a07885597777496b186dd5fb6f0 (patch)
tree9b48640703ccdf0108d731e66574370179a44b23 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parent3966efc2e58f1802411f44fd00967dde448f278d (diff)
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 <alexw@nvidia.com> Reviewed-on: http://git-master/r/1283828 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c12
1 files changed, 6 insertions, 6 deletions
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)
986 memset(&ch->ramfc, 0, sizeof(struct mem_desc_sub)); 986 memset(&ch->ramfc, 0, sizeof(struct mem_desc_sub));
987 987
988 gk20a_gmmu_unmap_free(ch_vm, &ch->gpfifo.mem); 988 gk20a_gmmu_unmap_free(ch_vm, &ch->gpfifo.mem);
989 nvgpu_big_free(ch->gpfifo.pipe); 989 nvgpu_big_free(g, ch->gpfifo.pipe);
990 memset(&ch->gpfifo, 0, sizeof(struct gpfifo_desc)); 990 memset(&ch->gpfifo, 0, sizeof(struct gpfifo_desc));
991 991
992#if defined(CONFIG_GK20A_CYCLE_STATS) 992#if defined(CONFIG_GK20A_CYCLE_STATS)
@@ -1856,7 +1856,7 @@ int gk20a_alloc_channel_gpfifo(struct channel_gk20a *c,
1856 } 1856 }
1857 1857
1858 if (c->gpfifo.mem.aperture == APERTURE_VIDMEM || g->mm.force_pramin) { 1858 if (c->gpfifo.mem.aperture == APERTURE_VIDMEM || g->mm.force_pramin) {
1859 c->gpfifo.pipe = nvgpu_big_malloc( 1859 c->gpfifo.pipe = nvgpu_big_malloc(g,
1860 gpfifo_size * sizeof(struct nvgpu_gpfifo)); 1860 gpfifo_size * sizeof(struct nvgpu_gpfifo));
1861 if (!c->gpfifo.pipe) { 1861 if (!c->gpfifo.pipe) {
1862 err = -ENOMEM; 1862 err = -ENOMEM;
@@ -1927,7 +1927,7 @@ clean_up_sync:
1927 c->sync = NULL; 1927 c->sync = NULL;
1928 } 1928 }
1929clean_up_unmap: 1929clean_up_unmap:
1930 nvgpu_big_free(c->gpfifo.pipe); 1930 nvgpu_big_free(g, c->gpfifo.pipe);
1931 gk20a_gmmu_unmap_free(ch_vm, &c->gpfifo.mem); 1931 gk20a_gmmu_unmap_free(ch_vm, &c->gpfifo.mem);
1932clean_up: 1932clean_up:
1933 memset(&c->gpfifo, 0, sizeof(struct gpfifo_desc)); 1933 memset(&c->gpfifo, 0, sizeof(struct gpfifo_desc));
@@ -2057,12 +2057,12 @@ static void trace_write_pushbuffer_range(struct channel_gk20a *c,
2057 if (!g) { 2057 if (!g) {
2058 size = count * sizeof(struct nvgpu_gpfifo); 2058 size = count * sizeof(struct nvgpu_gpfifo);
2059 if (size) { 2059 if (size) {
2060 g = nvgpu_big_malloc(size); 2060 g = nvgpu_big_malloc(c->g, size);
2061 if (!g) 2061 if (!g)
2062 return; 2062 return;
2063 2063
2064 if (copy_from_user(g, user_gpfifo, size)) { 2064 if (copy_from_user(g, user_gpfifo, size)) {
2065 nvgpu_big_free(g); 2065 nvgpu_big_free(c->g, g);
2066 return; 2066 return;
2067 } 2067 }
2068 } 2068 }
@@ -2074,7 +2074,7 @@ static void trace_write_pushbuffer_range(struct channel_gk20a *c,
2074 trace_write_pushbuffer(c, gp); 2074 trace_write_pushbuffer(c, gp);
2075 2075
2076 if (gpfifo_allocated) 2076 if (gpfifo_allocated)
2077 nvgpu_big_free(g); 2077 nvgpu_big_free(c->g, g);
2078} 2078}
2079 2079
2080static void __gk20a_channel_timeout_start(struct channel_gk20a *ch) 2080static void __gk20a_channel_timeout_start(struct channel_gk20a *ch)