These functions only ever hand out the dedicated SPM VMID now, not a generic reserved VMID. Rename them to amdgpu_vmid_alloc_spm() and amdgpu_vmid_free_spm() to say so. Pure rename, no functional change.
Signed-off-by: Sunil Khatri <[email protected]> Suggested-by: Christian König <[email protected]> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 8 ++++---- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c index 8e60e5fdd210d..a3293b32ea58a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c @@ -527,7 +527,7 @@ bool amdgpu_vmid_uses_reserved(struct amdgpu_vm *vm, unsigned int vmhub) } /* - * amdgpu_vmid_alloc_reserved - reserve a specific VMID for this vm + * amdgpu_vmid_alloc_spm - reserve a specific VMID for this vm * @adev: amdgpu device structure * @vm: the VM to reserve an ID for * @vmhub: the VMHUB which should be used @@ -536,7 +536,7 @@ bool amdgpu_vmid_uses_reserved(struct amdgpu_vm *vm, unsigned int vmhub) * * Returns: 0 for success, -ENOENT if an ID is already reserved. */ -int amdgpu_vmid_alloc_reserved(struct amdgpu_device *adev, struct amdgpu_vm *vm, +int amdgpu_vmid_alloc_spm(struct amdgpu_device *adev, struct amdgpu_vm *vm, unsigned vmhub) { struct amdgpu_kq_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub]; @@ -567,12 +567,12 @@ int amdgpu_vmid_alloc_reserved(struct amdgpu_device *adev, struct amdgpu_vm *vm, } /* - * amdgpu_vmid_free_reserved - free up a reserved VMID again + * amdgpu_vmid_free_spm - free up a reserved VMID again * @adev: amdgpu device structure * @vm: the VM with the reserved ID * @vmhub: the VMHUB which should be used */ -void amdgpu_vmid_free_reserved(struct amdgpu_device *adev, struct amdgpu_vm *vm, +void amdgpu_vmid_free_spm(struct amdgpu_device *adev, struct amdgpu_vm *vm, unsigned vmhub) { struct amdgpu_kq_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub]; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h index 105272ee2dce6..e2aa16b0898cb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h @@ -122,9 +122,9 @@ void amdgpu_pasid_mgr_cleanup(void); bool amdgpu_vmid_had_gpu_reset(struct amdgpu_device *adev, struct amdgpu_vmid *id); bool amdgpu_vmid_uses_reserved(struct amdgpu_vm *vm, unsigned int vmhub); -int amdgpu_vmid_alloc_reserved(struct amdgpu_device *adev, struct amdgpu_vm *vm, +int amdgpu_vmid_alloc_spm(struct amdgpu_device *adev, struct amdgpu_vm *vm, unsigned vmhub); -void amdgpu_vmid_free_reserved(struct amdgpu_device *adev, struct amdgpu_vm *vm, +void amdgpu_vmid_free_spm(struct amdgpu_device *adev, struct amdgpu_vm *vm, unsigned vmhub); int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring, struct amdgpu_job *job, struct dma_fence **fence); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 05358e7d81cb8..15fe597b7515e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -2892,7 +2892,7 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm) dma_fence_put(vm->last_update); for (i = 0; i < AMDGPU_MAX_VMHUBS; i++) { - amdgpu_vmid_free_reserved(adev, vm, i); + amdgpu_vmid_free_spm(adev, vm, i); } ttm_lru_bulk_move_fini(&adev->mman.bdev, &vm->lru_bulk_move); @@ -2995,13 +2995,13 @@ int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) int r; /* We only have requirement to reserve vmid from gfxhub */ - r = amdgpu_vmid_alloc_reserved(adev, vm, AMDGPU_GFXHUB(0)); + r = amdgpu_vmid_alloc_spm(adev, vm, AMDGPU_GFXHUB(0)); if (!r) amdgpu_vm_spm_update(adev, vm); return r; } case AMDGPU_VM_OP_UNRESERVE_VMID: - amdgpu_vmid_free_reserved(adev, vm, AMDGPU_GFXHUB(0)); + amdgpu_vmid_free_spm(adev, vm, AMDGPU_GFXHUB(0)); break; default: return -EINVAL; -- 2.34.1
