From 1eded552869f6957bec7695554752e26391daaee Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 13 Mar 2015 10:30:52 -0700 Subject: gpu: nvgpu: Use gk20a_mem_phys instead of sg_phys There were still a couple of places using sg_phys directly. Use new gk20a_mem_phys() to make the code shorter. Change-Id: I6eb9b14e0c14a27ec39bacd06ab24e31e99769ca Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/717502 --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 4 ++-- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 6 +++--- drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 2 +- drivers/gpu/nvgpu/gm20b/acr_gm20b.c | 2 +- drivers/gpu/nvgpu/gm20b/fifo_gm20b.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index feb80adf..e11ecc8b 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -264,7 +264,7 @@ static void channel_gk20a_bind(struct channel_gk20a *ch_gk20a) struct fifo_engine_info_gk20a *engine_info = f->engine_info + ENGINE_GR_GK20A; - u32 inst_ptr = sg_phys(ch_gk20a->inst_block.sgt->sgl) + u32 inst_ptr = gk20a_mem_phys(&ch_gk20a->inst_block) >> ram_in_base_shift_v(); gk20a_dbg_info("bind channel %d inst ptr 0x%08x", @@ -323,7 +323,7 @@ int channel_gk20a_alloc_inst(struct gk20a *g, struct channel_gk20a *ch) return err; gk20a_dbg_info("channel %d inst block physical addr: 0x%16llx", - ch->hw_chid, (u64)sg_phys(ch->inst_block.sgt->sgl)); + ch->hw_chid, (u64)gk20a_mem_phys(&ch->inst_block)); gk20a_dbg_fn("done"); return 0; diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 47659445..88e3f60a 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -646,7 +646,7 @@ channel_from_inst_ptr(struct fifo_gk20a *f, u64 inst_ptr) for (ci = 0; ci < f->num_channels; ci++) { struct channel_gk20a *c = f->channel+ci; if (c->inst_block.cpu_va && - (inst_ptr == sg_phys(c->inst_block.sgt->sgl))) + (inst_ptr == gk20a_mem_phys(&c->inst_block))) return f->channel+ci; } return NULL; @@ -1002,10 +1002,10 @@ static bool gk20a_fifo_handle_mmu_fault(struct gk20a *g) gk20a_fifo_set_ctx_mmu_error_ch(g, ch); gk20a_channel_abort(ch); } else if (f.inst_ptr == - sg_phys(g->mm.bar1.inst_block.sgt->sgl)) { + gk20a_mem_phys(&g->mm.bar1.inst_block)) { gk20a_err(dev_from_gk20a(g), "mmu fault from bar1"); } else if (f.inst_ptr == - sg_phys(g->mm.pmu.inst_block.sgt->sgl)) { + gk20a_mem_phys(&g->mm.pmu.inst_block)) { gk20a_err(dev_from_gk20a(g), "mmu fault from pmu"); } else gk20a_err(dev_from_gk20a(g), "couldn't locate channel for mmu fault"); diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 95bb1eb6..275fbd4e 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -1349,7 +1349,7 @@ static int pmu_bootstrap(struct pmu_gk20a *pmu) pwr_falcon_itfen_ctxen_enable_f()); gk20a_writel(g, pwr_pmu_new_instblk_r(), pwr_pmu_new_instblk_ptr_f( - sg_phys(mm->pmu.inst_block.sgt->sgl) >> 12) | + gk20a_mem_phys(&mm->pmu.inst_block) >> 12) | pwr_pmu_new_instblk_valid_f(1) | pwr_pmu_new_instblk_target_sys_coh_f()); diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c index ecb0f8ab..02706bad 100644 --- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c @@ -1041,7 +1041,7 @@ static int bl_bootstrap(struct pmu_gk20a *pmu, pwr_falcon_itfen_ctxen_enable_f()); gk20a_writel(g, pwr_pmu_new_instblk_r(), pwr_pmu_new_instblk_ptr_f( - sg_phys(mm->pmu.inst_block.sgt->sgl) >> 12) | + gk20a_mem_phys(&mm->pmu.inst_block) >> 12) | pwr_pmu_new_instblk_valid_f(1) | pwr_pmu_new_instblk_target_sys_coh_f()); diff --git a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c index 10d2a13e..530df04a 100644 --- a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c @@ -24,7 +24,7 @@ static void channel_gm20b_bind(struct channel_gk20a *ch_gk20a) { struct gk20a *g = ch_gk20a->g; - u32 inst_ptr = sg_phys(ch_gk20a->inst_block.sgt->sgl) + u32 inst_ptr = gk20a_mem_phys(&ch_gk20a->inst_block) >> ram_in_base_shift_v(); gk20a_dbg_info("bind channel %d inst ptr 0x%08x", -- cgit v1.2.2