summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/sim.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/sim.c')
-rw-r--r--drivers/gpu/nvgpu/common/sim.c19
1 files changed, 2 insertions, 17 deletions
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 @@
31 31
32int nvgpu_alloc_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem) 32int nvgpu_alloc_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem)
33{ 33{
34 int err; 34 return nvgpu_dma_alloc_sys(g, PAGE_SIZE, mem);
35
36 err = nvgpu_dma_alloc_sys(g, PAGE_SIZE, mem);
37 if (err)
38 return err;
39 /*
40 * create a valid cpu_va mapping
41 */
42 nvgpu_mem_begin(g, mem);
43
44 return 0;
45} 35}
46 36
47void nvgpu_free_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem) 37void nvgpu_free_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem)
48{ 38{
49 if (nvgpu_mem_is_valid(mem)) { 39 if (nvgpu_mem_is_valid(mem))
50 /*
51 * invalidate the cpu_va mapping
52 */
53 nvgpu_mem_end(g, mem);
54 nvgpu_dma_free(g, mem); 40 nvgpu_dma_free(g, mem);
55 }
56 41
57 memset(mem, 0, sizeof(*mem)); 42 memset(mem, 0, sizeof(*mem));
58} 43}