From dc1e91a2d7af365b878418d427fb16e4d0192028 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 26 Jun 2018 12:44:21 +0300 Subject: gpu: nvgpu: don't nvgpu_mem_{begin,end}() sim bufs nvgpu_dma_alloc_sys() gives cpu-mapped memory by default. Remove the explicit calls to map and unmap the sim buffers. Change-Id: Icf71961c16a8b2f5dae24382cc927c7a802a769a Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1761580 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/common/sim.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'drivers/gpu/nvgpu/common/sim.c') diff --git a/drivers/gpu/nvgpu/common/sim.c b/drivers/gpu/nvgpu/common/sim.c index 81146cd9..c46f0959 100644 --- a/drivers/gpu/nvgpu/common/sim.c +++ b/drivers/gpu/nvgpu/common/sim.c @@ -31,28 +31,13 @@ int nvgpu_alloc_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem) { - int err; - - err = nvgpu_dma_alloc_sys(g, PAGE_SIZE, mem); - if (err) - return err; - /* - * create a valid cpu_va mapping - */ - nvgpu_mem_begin(g, mem); - - return 0; + return nvgpu_dma_alloc_sys(g, PAGE_SIZE, mem); } void nvgpu_free_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem) { - if (nvgpu_mem_is_valid(mem)) { - /* - * invalidate the cpu_va mapping - */ - nvgpu_mem_end(g, mem); + if (nvgpu_mem_is_valid(mem)) nvgpu_dma_free(g, mem); - } memset(mem, 0, sizeof(*mem)); } -- cgit v1.2.2