From dd146d42fc910128b0e2987d12b83430bf97bae0 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Mon, 25 Jun 2018 15:47:15 +0300 Subject: gpu: nvgpu: don't mem_{begin,end}() for gr Now that GR buffers always have a kernel mapping, remove the unnecessary calls to nvgpu_mem_begin() and nvgpu_mem_end() on these buffers: - global ctx buffer mem in gr - gr ctx mem in a tsg - patch ctx mem in a gr ctx - pm ctx mem in a gr ctx - ctx_header mem in a channel (subctx header) Change-Id: Id2a8ad108aef8db8b16dce5bae8003bbcd3b23e4 Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1760599 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/subctx_gv11b.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b') diff --git a/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c b/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c index 61fb8954..aad2b2fc 100644 --- a/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c @@ -82,11 +82,7 @@ int gv11b_alloc_subctx_header(struct channel_gk20a *c) return -ENOMEM; } /* Now clear the buffer */ - if (nvgpu_mem_begin(g, &ctx->mem)) - return -ENOMEM; - nvgpu_memset(g, &ctx->mem, 0, 0, ctx->mem.size); - nvgpu_mem_end(g, &ctx->mem); } return ret; } @@ -117,8 +113,6 @@ int gv11b_update_subctx_header(struct channel_gk20a *c, u64 gpu_va) gr_mem = &ctx->mem; g->ops.mm.l2_flush(g, true); - if (nvgpu_mem_begin(g, gr_mem)) - return -ENOMEM; /* set priv access map */ addr_lo = u64_lo32(gr_ctx->global_ctx_buffer_va[PRIV_ACCESS_MAP_VA]); @@ -153,7 +147,7 @@ int gv11b_update_subctx_header(struct channel_gk20a *c, u64 gpu_va) nvgpu_mem_wr(g, gr_mem, ctxsw_prog_main_image_ctl_o(), ctxsw_prog_main_image_ctl_type_per_veid_header_v()); - nvgpu_mem_end(g, gr_mem); + return ret; } -- cgit v1.2.2