From 556643179f1223555e352b48be31df3eda9390b6 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 18 Apr 2016 12:35:57 -0700 Subject: gpu: nvgpu: Allocate channel table with vmalloc Channel table can be bigger than one page, so allocate it with vmalloc. Also add a free for tsg table, which did not exist before, and remove per-channel remove_channel callback which was never used. JIRA DNVGPU-50 Change-Id: I3ee84b65d94881df52bf0618bf4c5f2e85758223 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1129244 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Ken Adams GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index d8c07c89..e69fb288 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -167,14 +167,8 @@ static void gk20a_remove_fifo_support(struct fifo_gk20a *f) gk20a_dbg_fn(""); - if (f->channel) { - int c; - for (c = 0; c < f->num_channels; c++) { - if (f->channel[c].remove_support) - f->channel[c].remove_support(f->channel+c); - } - kfree(f->channel); - } + vfree(f->channel); + vfree(f->tsg); gk20a_gmmu_unmap_free(&g->mm.bar1.vm, &f->userd); engine_info = f->engine_info + ENGINE_GR_GK20A; @@ -502,10 +496,8 @@ static int gk20a_init_fifo_setup_sw(struct gk20a *g) gk20a_dbg(gpu_dbg_map, "userd bar1 va = 0x%llx", f->userd.gpu_va); - f->channel = kzalloc(f->num_channels * sizeof(*f->channel), - GFP_KERNEL); - f->tsg = kzalloc(f->num_channels * sizeof(*f->tsg), - GFP_KERNEL); + f->channel = vzalloc(f->num_channels * sizeof(*f->channel)); + f->tsg = vzalloc(f->num_channels * sizeof(*f->tsg)); f->pbdma_map = kzalloc(f->num_pbdma * sizeof(*f->pbdma_map), GFP_KERNEL); f->engine_info = kzalloc(f->max_engines * sizeof(*f->engine_info), @@ -555,8 +547,10 @@ clean_up: gk20a_dbg_fn("fail"); gk20a_gmmu_unmap_free(&g->mm.bar1.vm, &f->userd); - kfree(f->channel); + vfree(f->channel); f->channel = NULL; + vfree(f->tsg); + f->tsg = NULL; kfree(f->pbdma_map); f->pbdma_map = NULL; kfree(f->engine_info); -- cgit v1.2.2