From 50667e097b2be567e3d2f95e23b046243bca2bf6 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 21 Mar 2017 15:34:50 -0700 Subject: gpu: nvgpu: Rename nvgpu DMA APIs Rename the nvgpu DMA APIs from gk20a_gmmu_alloc* to nvgpu_dma_alloc*. This better reflects the purpose of the APIs (to allocate DMA suitable memory) and avoids confusion with GMMU related code. JIRA NVGPU-12 Change-Id: I673d607db56dd6e44f02008dc7b5293209ef67bf Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1325548 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 4 +-- drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | 4 +-- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 10 ++++---- drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c | 6 ++--- drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | 4 +-- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 16 ++++++------ drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 40 +++++++++++++++--------------- drivers/gpu/nvgpu/gk20a/ltc_common.c | 4 +-- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 18 +++++++------- drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 14 +++++------ 10 files changed, 60 insertions(+), 60 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index e70ee4a6..7c251e2d 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c @@ -54,7 +54,7 @@ static void gk20a_deinit_cde_img(struct gk20a_cde_ctx *cde_ctx) for (i = 0; i < cde_ctx->num_bufs; i++) { struct nvgpu_mem *mem = cde_ctx->mem + i; - gk20a_gmmu_unmap_free(cde_ctx->vm, mem); + nvgpu_dma_unmap_free(cde_ctx->vm, mem); } nvgpu_kfree(cde_ctx->g, cde_ctx->init_convert_cmd); @@ -247,7 +247,7 @@ static int gk20a_init_cde_buf(struct gk20a_cde_ctx *cde_ctx, /* allocate buf */ mem = cde_ctx->mem + cde_ctx->num_bufs; - err = gk20a_gmmu_alloc_map_sys(cde_ctx->vm, buf->num_bytes, mem); + err = nvgpu_dma_alloc_map_sys(cde_ctx->vm, buf->num_bytes, mem); if (err) { gk20a_warn(cde_ctx->dev, "cde: could not allocate device memory. buffer idx = %d", cde_ctx->num_bufs); diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c index 9cc4b678..f3ac28ea 100644 --- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c @@ -195,7 +195,7 @@ static void gk20a_ce_delete_gpu_context(struct gk20a_gpu_ctx *ce_ctx) if (ce_ctx->cmd_buf_mem.cpu_va) { gk20a_ce_free_command_buffer_stored_fence(ce_ctx); - gk20a_gmmu_unmap_free(ce_ctx->vm, &ce_ctx->cmd_buf_mem); + nvgpu_dma_unmap_free(ce_ctx->vm, &ce_ctx->cmd_buf_mem); } /* free the channel */ @@ -479,7 +479,7 @@ u32 gk20a_ce_create_context_with_cb(struct device *dev, } /* allocate command buffer (4096 should be more than enough) from sysmem*/ - err = gk20a_gmmu_alloc_map_sys(ce_ctx->vm, NVGPU_CE_COMMAND_BUF_SIZE, &ce_ctx->cmd_buf_mem); + err = nvgpu_dma_alloc_map_sys(ce_ctx->vm, NVGPU_CE_COMMAND_BUF_SIZE, &ce_ctx->cmd_buf_mem); if (err) { gk20a_err(ce_ctx->dev, "ce: could not allocate command buffer for CE context"); diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 6be616b3..81901c52 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -523,7 +523,7 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) gk20a_gr_flush_channel_tlb(gr); - gk20a_gmmu_unmap_free(ch_vm, &ch->gpfifo.mem); + nvgpu_dma_unmap_free(ch_vm, &ch->gpfifo.mem); nvgpu_big_free(g, ch->gpfifo.pipe); memset(&ch->gpfifo, 0, sizeof(struct gpfifo_desc)); @@ -899,7 +899,7 @@ static int channel_gk20a_alloc_priv_cmdbuf(struct channel_gk20a *c) size = roundup_pow_of_two(c->gpfifo.entry_num * 2 * 18 * sizeof(u32) / 3); - err = gk20a_gmmu_alloc_map_sys(ch_vm, size, &q->mem); + err = nvgpu_dma_alloc_map_sys(ch_vm, size, &q->mem); if (err) { gk20a_err(d, "%s: memory allocation failed\n", __func__); goto clean_up; @@ -922,7 +922,7 @@ static void channel_gk20a_free_priv_cmdbuf(struct channel_gk20a *c) if (q->size == 0) return; - gk20a_gmmu_unmap_free(ch_vm, &q->mem); + nvgpu_dma_unmap_free(ch_vm, &q->mem); memset(q, 0, sizeof(struct priv_cmd_queue)); } @@ -1244,7 +1244,7 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, return -EEXIST; } - err = gk20a_gmmu_alloc_map_sys(ch_vm, + err = nvgpu_dma_alloc_map_sys(ch_vm, gpfifo_size * sizeof(struct nvgpu_gpfifo), &c->gpfifo.mem); if (err) { @@ -1331,7 +1331,7 @@ clean_up_sync: } clean_up_unmap: nvgpu_big_free(g, c->gpfifo.pipe); - gk20a_gmmu_unmap_free(ch_vm, &c->gpfifo.mem); + nvgpu_dma_unmap_free(ch_vm, &c->gpfifo.mem); clean_up: memset(&c->gpfifo, 0, sizeof(struct gpfifo_desc)); gk20a_err(d, "fail"); diff --git a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c index 738e8c1c..e5910e7f 100644 --- a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c @@ -143,7 +143,7 @@ static int css_hw_enable_snapshot(struct channel_gk20a *ch, if (snapshot_size < CSS_MIN_HW_SNAPSHOT_SIZE) snapshot_size = CSS_MIN_HW_SNAPSHOT_SIZE; - ret = gk20a_gmmu_alloc_map_sys(&g->mm.pmu.vm, snapshot_size, + ret = nvgpu_dma_alloc_map_sys(&g->mm.pmu.vm, snapshot_size, &data->hw_memdesc); if (ret) return ret; @@ -192,7 +192,7 @@ static int css_hw_enable_snapshot(struct channel_gk20a *ch, failed_allocation: if (data->hw_memdesc.size) { - gk20a_gmmu_unmap_free(&g->mm.pmu.vm, &data->hw_memdesc); + nvgpu_dma_unmap_free(&g->mm.pmu.vm, &data->hw_memdesc); memset(&data->hw_memdesc, 0, sizeof(data->hw_memdesc)); } data->hw_snapshot = NULL; @@ -220,7 +220,7 @@ static void css_hw_disable_snapshot(struct gr_gk20a *gr) perf_pmasys_mem_block_valid_false_f() | perf_pmasys_mem_block_target_f(0)); - gk20a_gmmu_unmap_free(&g->mm.pmu.vm, &data->hw_memdesc); + nvgpu_dma_unmap_free(&g->mm.pmu.vm, &data->hw_memdesc); memset(&data->hw_memdesc, 0, sizeof(data->hw_memdesc)); data->hw_snapshot = NULL; diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c index d8fa7505..96b94ea7 100644 --- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c @@ -400,7 +400,7 @@ static int gk20a_fecs_trace_alloc_ring(struct gk20a *g) { struct gk20a_fecs_trace *trace = g->fecs_trace; - return gk20a_gmmu_alloc_sys(g, GK20A_FECS_TRACE_NUM_RECORDS + return nvgpu_dma_alloc_sys(g, GK20A_FECS_TRACE_NUM_RECORDS * ctxsw_prog_record_timestamp_record_size_in_bytes_v(), &trace->trace_buf); } @@ -409,7 +409,7 @@ static void gk20a_fecs_trace_free_ring(struct gk20a *g) { struct gk20a_fecs_trace *trace = g->fecs_trace; - gk20a_gmmu_free(g, &trace->trace_buf); + nvgpu_dma_free(g, &trace->trace_buf); } #ifdef CONFIG_DEBUG_FS diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index c1f94eb3..ca09c22a 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -483,7 +483,7 @@ void gk20a_fifo_delete_runlist(struct fifo_gk20a *f) for (runlist_id = 0; runlist_id < f->max_runlists; runlist_id++) { runlist = &f->runlist_info[runlist_id]; for (i = 0; i < MAX_RUNLIST_BUFFERS; i++) { - gk20a_gmmu_free(g, &runlist->mem[i]); + nvgpu_dma_free(g, &runlist->mem[i]); } nvgpu_kfree(g, runlist->active_channels); @@ -544,9 +544,9 @@ static void gk20a_remove_fifo_support(struct fifo_gk20a *f) nvgpu_vfree(g, f->channel); nvgpu_vfree(g, f->tsg); if (g->ops.mm.is_bar1_supported(g)) - gk20a_gmmu_unmap_free(&g->mm.bar1.vm, &f->userd); + nvgpu_dma_unmap_free(&g->mm.bar1.vm, &f->userd); else - gk20a_gmmu_free(g, &f->userd); + nvgpu_dma_free(g, &f->userd); gk20a_fifo_delete_runlist(f); @@ -686,7 +686,7 @@ static int init_runlist(struct gk20a *g, struct fifo_gk20a *f) f->num_runlist_entries, runlist_size); for (i = 0; i < MAX_RUNLIST_BUFFERS; i++) { - int err = gk20a_gmmu_alloc_sys(g, runlist_size, + int err = nvgpu_dma_alloc_sys(g, runlist_size, &runlist->mem[i]); if (err) { dev_err(d, "memory allocation failed\n"); @@ -940,12 +940,12 @@ static int gk20a_init_fifo_setup_sw(struct gk20a *g) nvgpu_mutex_init(&f->free_chs_mutex); if (g->ops.mm.is_bar1_supported(g)) - err = gk20a_gmmu_alloc_map_sys(&g->mm.bar1.vm, + err = nvgpu_dma_alloc_map_sys(&g->mm.bar1.vm, f->userd_entry_size * f->num_channels, &f->userd); else - err = gk20a_gmmu_alloc_sys(g, f->userd_entry_size * + err = nvgpu_dma_alloc_sys(g, f->userd_entry_size * f->num_channels, &f->userd); if (err) { dev_err(d, "userd memory allocation failed\n"); @@ -980,9 +980,9 @@ static int gk20a_init_fifo_setup_sw(struct gk20a *g) clean_up: gk20a_dbg_fn("fail"); if (g->ops.mm.is_bar1_supported(g)) - gk20a_gmmu_unmap_free(&g->mm.bar1.vm, &f->userd); + nvgpu_dma_unmap_free(&g->mm.bar1.vm, &f->userd); else - gk20a_gmmu_free(g, &f->userd); + nvgpu_dma_free(g, &f->userd); nvgpu_vfree(g, f->channel); f->channel = NULL; diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index a9b6a546..af02491e 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -1938,7 +1938,7 @@ int gr_gk20a_update_hwpm_ctxsw_mode(struct gk20a *g, if (enable_hwpm_ctxsw) { /* Allocate buffer if necessary */ if (pm_ctx->mem.gpu_va == 0) { - ret = gk20a_gmmu_alloc_flags_sys(g, + ret = nvgpu_dma_alloc_flags_sys(g, NVGPU_DMA_NO_KERNEL_MAPPING, g->gr.ctx_vars.pm_ctxsw_image_size, &pm_ctx->mem); @@ -1958,7 +1958,7 @@ int gr_gk20a_update_hwpm_ctxsw_mode(struct gk20a *g, if (!pm_ctx->mem.gpu_va) { gk20a_err(dev_from_gk20a(g), "failed to map pm ctxt buffer"); - gk20a_gmmu_free(g, &pm_ctx->mem); + nvgpu_dma_free(g, &pm_ctx->mem); c->g->ops.fifo.enable_channel(c); return -ENOMEM; } @@ -2018,7 +2018,7 @@ clean_up_mem: cleanup_pm_buf: gk20a_gmmu_unmap(c->vm, pm_ctx->mem.gpu_va, pm_ctx->mem.size, gk20a_mem_flag_none); - gk20a_gmmu_free(g, &pm_ctx->mem); + nvgpu_dma_free(g, &pm_ctx->mem); memset(&pm_ctx->mem, 0, sizeof(struct nvgpu_mem)); gk20a_enable_channel_tsg(g, c); @@ -2318,7 +2318,7 @@ int gr_gk20a_init_ctxsw_ucode(struct gk20a *g) g->gr.ctx_vars.ucode.gpccs.inst.count * sizeof(u32), g->gr.ctx_vars.ucode.gpccs.data.count * sizeof(u32)); - err = gk20a_gmmu_alloc_sys(g, ucode_size, &ucode_info->surface_desc); + err = nvgpu_dma_alloc_sys(g, ucode_size, &ucode_info->surface_desc); if (err) goto clean_up; @@ -2350,7 +2350,7 @@ int gr_gk20a_init_ctxsw_ucode(struct gk20a *g) if (ucode_info->surface_desc.gpu_va) gk20a_gmmu_unmap(vm, ucode_info->surface_desc.gpu_va, ucode_info->surface_desc.size, gk20a_mem_flag_none); - gk20a_gmmu_free(g, &ucode_info->surface_desc); + nvgpu_dma_free(g, &ucode_info->surface_desc); release_firmware(gpccs_fw); gpccs_fw = NULL; @@ -2700,7 +2700,7 @@ static void gk20a_gr_destroy_ctx_buffer(struct gk20a *g, { if (!desc) return; - gk20a_gmmu_free(g, &desc->mem); + nvgpu_dma_free(g, &desc->mem); desc->destroy = NULL; } @@ -2710,7 +2710,7 @@ static int gk20a_gr_alloc_ctx_buffer(struct gk20a *g, { int err = 0; - err = gk20a_gmmu_alloc_flags_sys(g, NVGPU_DMA_NO_KERNEL_MAPPING, + err = nvgpu_dma_alloc_flags_sys(g, NVGPU_DMA_NO_KERNEL_MAPPING, size, &desc->mem); if (err) return err; @@ -2953,7 +2953,7 @@ int gr_gk20a_alloc_gr_ctx(struct gk20a *g, if (!gr_ctx) return -ENOMEM; - err = gk20a_gmmu_alloc_flags(g, NVGPU_DMA_NO_KERNEL_MAPPING, + err = nvgpu_dma_alloc_flags(g, NVGPU_DMA_NO_KERNEL_MAPPING, gr->ctx_vars.buffer_total_size, &gr_ctx->mem); if (err) @@ -2973,7 +2973,7 @@ int gr_gk20a_alloc_gr_ctx(struct gk20a *g, return 0; err_free_mem: - gk20a_gmmu_free(g, &gr_ctx->mem); + nvgpu_dma_free(g, &gr_ctx->mem); err_free_ctx: nvgpu_kfree(g, gr_ctx); gr_ctx = NULL; @@ -3022,7 +3022,7 @@ void gr_gk20a_free_gr_ctx(struct gk20a *g, gk20a_gmmu_unmap(vm, gr_ctx->mem.gpu_va, gr_ctx->mem.size, gk20a_mem_flag_none); - gk20a_gmmu_free(g, &gr_ctx->mem); + nvgpu_dma_free(g, &gr_ctx->mem); nvgpu_kfree(g, gr_ctx); } @@ -3051,7 +3051,7 @@ static int gr_gk20a_alloc_channel_patch_ctx(struct gk20a *g, gk20a_dbg_fn(""); - err = gk20a_gmmu_alloc_map_flags_sys(ch_vm, NVGPU_DMA_NO_KERNEL_MAPPING, + err = nvgpu_dma_alloc_map_flags_sys(ch_vm, NVGPU_DMA_NO_KERNEL_MAPPING, 128 * sizeof(u32), &patch_ctx->mem); if (err) return err; @@ -3071,7 +3071,7 @@ static void gr_gk20a_free_channel_patch_ctx(struct channel_gk20a *c) gk20a_gmmu_unmap(c->vm, patch_ctx->mem.gpu_va, patch_ctx->mem.size, gk20a_mem_flag_none); - gk20a_gmmu_free(g, &patch_ctx->mem); + nvgpu_dma_free(g, &patch_ctx->mem); patch_ctx->data_count = 0; } @@ -3086,7 +3086,7 @@ static void gr_gk20a_free_channel_pm_ctx(struct channel_gk20a *c) gk20a_gmmu_unmap(c->vm, pm_ctx->mem.gpu_va, pm_ctx->mem.size, gk20a_mem_flag_none); - gk20a_gmmu_free(g, &pm_ctx->mem); + nvgpu_dma_free(g, &pm_ctx->mem); } } @@ -3366,10 +3366,10 @@ static void gk20a_remove_gr_support(struct gr_gk20a *gr) gr_gk20a_free_global_ctx_buffers(g); - gk20a_gmmu_free(g, &gr->mmu_wr_mem); - gk20a_gmmu_free(g, &gr->mmu_rd_mem); + nvgpu_dma_free(g, &gr->mmu_wr_mem); + nvgpu_dma_free(g, &gr->mmu_rd_mem); - gk20a_gmmu_free(g, &gr->compbit_store.mem); + nvgpu_dma_free(g, &gr->compbit_store.mem); memset(&gr->compbit_store, 0, sizeof(struct compbit_store_desc)); @@ -3658,17 +3658,17 @@ static int gr_gk20a_init_mmu_sw(struct gk20a *g, struct gr_gk20a *gr) { int err; - err = gk20a_gmmu_alloc_sys(g, 0x1000, &gr->mmu_wr_mem); + err = nvgpu_dma_alloc_sys(g, 0x1000, &gr->mmu_wr_mem); if (err) goto err; - err = gk20a_gmmu_alloc_sys(g, 0x1000, &gr->mmu_rd_mem); + err = nvgpu_dma_alloc_sys(g, 0x1000, &gr->mmu_rd_mem); if (err) goto err_free_wr_mem; return 0; err_free_wr_mem: - gk20a_gmmu_free(g, &gr->mmu_wr_mem); + nvgpu_dma_free(g, &gr->mmu_wr_mem); err: return -ENOMEM; } @@ -5215,7 +5215,7 @@ static int gk20a_init_gr_bind_fecs_elpg(struct gk20a *g) } if (!pmu->pg_buf.cpu_va) { - err = gk20a_gmmu_alloc_map_sys(vm, size, &pmu->pg_buf); + err = nvgpu_dma_alloc_map_sys(vm, size, &pmu->pg_buf); if (err) { gk20a_err(d, "failed to allocate memory\n"); return -ENOMEM; diff --git a/drivers/gpu/nvgpu/gk20a/ltc_common.c b/drivers/gpu/nvgpu/gk20a/ltc_common.c index 7c73be77..03b12740 100644 --- a/drivers/gpu/nvgpu/gk20a/ltc_common.c +++ b/drivers/gpu/nvgpu/gk20a/ltc_common.c @@ -70,7 +70,7 @@ static int gk20a_ltc_alloc_phys_cbc(struct gk20a *g, { struct gr_gk20a *gr = &g->gr; - return gk20a_gmmu_alloc_flags_sys(g, NVGPU_DMA_FORCE_CONTIGUOUS, + return nvgpu_dma_alloc_flags_sys(g, NVGPU_DMA_FORCE_CONTIGUOUS, compbit_backing_size, &gr->compbit_store.mem); } @@ -80,7 +80,7 @@ static int gk20a_ltc_alloc_virt_cbc(struct gk20a *g, { struct gr_gk20a *gr = &g->gr; - return gk20a_gmmu_alloc_flags_sys(g, NVGPU_DMA_NO_KERNEL_MAPPING, + return nvgpu_dma_alloc_flags_sys(g, NVGPU_DMA_NO_KERNEL_MAPPING, compbit_backing_size, &gr->compbit_store.mem); } diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 79654af3..cfe7745d 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -509,7 +509,7 @@ static void gk20a_remove_mm_support(struct mm_gk20a *mm) static int gk20a_alloc_sysmem_flush(struct gk20a *g) { - return gk20a_gmmu_alloc_sys(g, SZ_4K, &g->mm.sysmem_flush); + return nvgpu_dma_alloc_sys(g, SZ_4K, &g->mm.sysmem_flush); } #if defined(CONFIG_GK20A_VIDMEM) @@ -897,9 +897,9 @@ static int alloc_gmmu_pages(struct vm_gk20a *vm, u32 order, * default. */ if (IS_ENABLED(CONFIG_ARM64)) - err = gk20a_gmmu_alloc(g, len, &entry->mem); + err = nvgpu_dma_alloc(g, len, &entry->mem); else - err = gk20a_gmmu_alloc_flags(g, NVGPU_DMA_NO_KERNEL_MAPPING, + err = nvgpu_dma_alloc_flags(g, NVGPU_DMA_NO_KERNEL_MAPPING, len, &entry->mem); @@ -929,7 +929,7 @@ void free_gmmu_pages(struct vm_gk20a *vm, return; } - gk20a_gmmu_free(g, &entry->mem); + nvgpu_dma_free(g, &entry->mem); } int map_gmmu_pages(struct gk20a *g, struct gk20a_mm_entry *entry) @@ -1756,7 +1756,7 @@ static void gk20a_vidbuf_release(struct dma_buf *dmabuf) if (buf->dmabuf_priv) buf->dmabuf_priv_delete(buf->dmabuf_priv); - gk20a_gmmu_free(buf->g, buf->mem); + nvgpu_dma_free(buf->g, buf->mem); nvgpu_kfree(buf->g, buf); } @@ -1873,7 +1873,7 @@ int gk20a_vidmem_buf_alloc(struct gk20a *g, size_t bytes) buf->mem->user_mem = true; - err = gk20a_gmmu_alloc_vid(g, bytes, buf->mem); + err = nvgpu_dma_alloc_vid(g, bytes, buf->mem); if (err) goto err_memfree; @@ -1896,7 +1896,7 @@ int gk20a_vidmem_buf_alloc(struct gk20a *g, size_t bytes) return fd; err_bfree: - gk20a_gmmu_free(g, buf->mem); + nvgpu_dma_free(g, buf->mem); err_memfree: nvgpu_kfree(g, buf->mem); err_kfree: @@ -4199,7 +4199,7 @@ int gk20a_alloc_inst_block(struct gk20a *g, struct nvgpu_mem *inst_block) gk20a_dbg_fn(""); - err = gk20a_gmmu_alloc(g, ram_in_alloc_size_v(), inst_block); + err = nvgpu_dma_alloc(g, ram_in_alloc_size_v(), inst_block); if (err) { gk20a_err(dev, "%s: memory allocation failed\n", __func__); return err; @@ -4212,7 +4212,7 @@ int gk20a_alloc_inst_block(struct gk20a *g, struct nvgpu_mem *inst_block) void gk20a_free_inst_block(struct gk20a *g, struct nvgpu_mem *inst_block) { if (inst_block->size) - gk20a_gmmu_free(g, inst_block); + nvgpu_dma_free(g, inst_block); } u64 gk20a_mm_inst_block_addr(struct gk20a *g, struct nvgpu_mem *inst_block) diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 7a6bfe22..547ba924 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -3151,7 +3151,7 @@ static int gk20a_prepare_ucode(struct gk20a *g) pmu->ucode_image = (u32 *)((u8 *)pmu->desc + pmu->desc->descriptor_size); - err = gk20a_gmmu_alloc_map_sys(vm, GK20A_PMU_UCODE_SIZE_MAX, + err = nvgpu_dma_alloc_map_sys(vm, GK20A_PMU_UCODE_SIZE_MAX, &pmu->ucode); if (err) goto err_release_fw; @@ -3225,7 +3225,7 @@ static int gk20a_init_pmu_setup_sw(struct gk20a *g) INIT_WORK(&pmu->pg_init, pmu_setup_hw); - err = gk20a_gmmu_alloc_map_sys(vm, GK20A_PMU_SEQ_BUF_SIZE, + err = nvgpu_dma_alloc_map_sys(vm, GK20A_PMU_SEQ_BUF_SIZE, &pmu->seq_buf); if (err) { gk20a_err(d, "failed to allocate memory\n"); @@ -3242,7 +3242,7 @@ static int gk20a_init_pmu_setup_sw(struct gk20a *g) pmu->seq_buf.size = GK20A_PMU_SEQ_BUF_SIZE; - err = gk20a_gmmu_alloc_map(vm, GK20A_PMU_TRACE_BUFSIZE, + err = nvgpu_dma_alloc_map(vm, GK20A_PMU_TRACE_BUFSIZE, &pmu->trace_buf); if (err) { gk20a_err(d, "failed to allocate pmu trace buffer\n"); @@ -3255,7 +3255,7 @@ skip_init: gk20a_dbg_fn("done"); return 0; err_free_seq_buf: - gk20a_gmmu_unmap_free(vm, &pmu->seq_buf); + nvgpu_dma_unmap_free(vm, &pmu->seq_buf); err_free_seq: nvgpu_kfree(g, pmu->seq); err_free_mutex: @@ -4760,7 +4760,7 @@ int gk20a_pmu_vidmem_surface_alloc(struct gk20a *g, struct nvgpu_mem *mem, struct vm_gk20a *vm = &mm->pmu.vm; int err; - err = gk20a_gmmu_alloc_map_vid(vm, size, mem); + err = nvgpu_dma_alloc_map_vid(vm, size, mem); if (err) { gk20a_err(g->dev, "memory allocation failed"); return -ENOMEM; @@ -4776,7 +4776,7 @@ int gk20a_pmu_sysmem_surface_alloc(struct gk20a *g, struct nvgpu_mem *mem, struct vm_gk20a *vm = &mm->pmu.vm; int err; - err = gk20a_gmmu_alloc_map_sys(vm, size, mem); + err = nvgpu_dma_alloc_map_sys(vm, size, mem); if (err) { gk20a_err(g->dev, "failed to allocate memory\n"); return -ENOMEM; @@ -4787,7 +4787,7 @@ int gk20a_pmu_sysmem_surface_alloc(struct gk20a *g, struct nvgpu_mem *mem, void gk20a_pmu_surface_free(struct gk20a *g, struct nvgpu_mem *mem) { - gk20a_gmmu_free(g, mem); + nvgpu_dma_free(g, mem); memset(mem, 0, sizeof(struct nvgpu_mem)); } -- cgit v1.2.2