From 7aa928fa07066b1b9ac6ffb2edf0b473f10a2518 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Wed, 11 Apr 2018 11:23:02 -0700 Subject: gpu: nvgpu: vgpu: implement .free_syncpt_buf vgpu needs to free the va range besides unmap the syncpt buffer. Jira VFND-4870 Change-Id: Ia9edb687b66db6da8529bf256d348999e24a0bc3 Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1693094 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c') diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c index 9b689699..e718a30d 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c @@ -21,6 +21,7 @@ */ #include +#include #include #include #include @@ -116,6 +117,14 @@ int vgpu_gv11b_fifo_alloc_syncpt_buf(struct channel_gk20a *c, return 0; } +void vgpu_gv11b_fifo_free_syncpt_buf(struct channel_gk20a *c, + struct nvgpu_mem *syncpt_buf) +{ + nvgpu_gmmu_unmap(c->vm, syncpt_buf, syncpt_buf->gpu_va); + __nvgpu_vm_free_va(c->vm, syncpt_buf->gpu_va, gmmu_page_size_kernel); + nvgpu_dma_free(c->g, syncpt_buf); +} + int vgpu_gv11b_fifo_get_sync_ro_map(struct vm_gk20a *vm, u64 *base_gpuva, u32 *sync_size) { -- cgit v1.2.2