gpu: nvgpu: simplify gmmu unmap calls

Introduce nvgpu_gmmu_unmap_addr() to unmap a nvgpu_mem that was mapped
at some other address than mem.gpu_va, which can be the case for buffers
that are shared across different address spaces. Delete the address
parameter from nvgpu_gmmu_unmap(), as the common case is to store the
address to mem.gpu_va when mapping the buffer.

Modify some instances of consecutive unmap + free calls to call just
nvgpu_dma_unmap_free().

Change-Id: Iecd7c9aa41d04e9f48e055f6bc0c9227cd759c69
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2601787
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Konsta Hölttä
2021-09-28 09:24:13 +03:00
committed by mobile promotions
parent 9bdb8f1a10
commit 44422db851
15 changed files with 41 additions and 35 deletions

View File

@@ -409,6 +409,7 @@ nvgpu_gmmu_map
nvgpu_gmmu_map_locked
nvgpu_gmmu_map_fixed
nvgpu_gmmu_unmap
nvgpu_gmmu_unmap_addr
nvgpu_gmmu_unmap_locked
nvgpu_golden_ctx_verif_get_fault_injection
nvgpu_gr_alloc

View File

@@ -425,6 +425,7 @@ nvgpu_gmmu_map
nvgpu_gmmu_map_locked
nvgpu_gmmu_map_fixed
nvgpu_gmmu_unmap
nvgpu_gmmu_unmap_addr
nvgpu_gmmu_unmap_locked
nvgpu_golden_ctx_verif_get_fault_injection
nvgpu_gr_alloc