drm/amdgpu: add some lockdep checks to the VM code
Subsystems (3)
PATCH 1/2 drm/amdgpu: add some lockdep checks to the VM code
Whenever a bo_va structure is added or removed the VM and eventually added BO should be locked.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +6 -0
@@ -2260,6 +2260,8 @@ struct amdgpu_bo_va *amdgpu_vm_bo_add(struct amdgpu_device *adev, {struct amdgpu_bo_va *bo_va; +dma_resv_assert_held (vm->root.bo->tbo.base.resv); + bo_va =kzalloc (sizeof (struct amdgpu_bo_va ),GFP_KERNEL );if (bo_va ==NULL ) {return NULL ;
@@ -2273,6 +2275,7 @@ struct amdgpu_bo_va *amdgpu_vm_bo_add(struct amdgpu_device *adev,if (!bo)return bo_va; +dma_resv_assert_held (bo->tbo.base.resv);if (amdgpu_dmabuf_is_xgmi_accessible (adev, bo)) { bo_va->is_xgmi = true;/* Power up XGMI if it can be potentially used */
@@ -2667,7 +2670,10 @@ void amdgpu_vm_bo_rmv(struct amdgpu_device *adev,struct amdgpu_vm *vm = bo_va->base.vm;struct amdgpu_vm_bo_base **base; +dma_resv_assert_held (vm->root.bo->tbo.base.resv); +if (bo) { +dma_resv_assert_held (bo->tbo.base.resv);if (bo->tbo.base.resv == vm->root.bo->tbo.base.resv) vm->bulk_moveable = false;
Signature · 1 line
2.25.1
PATCH 2/2 drm/amdgpu: rename amdgpu_vm_bo_rmv to _del
Some people complained about the name and this matches much more Linux naming conventions for object functions.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +2 -2
@@ -778,7 +778,7 @@ static int kfd_mem_attach(struct amdgpu_device *adev, struct kgd_mem *mem,continue ;if (attachment[i]->bo_va) {amdgpu_bo_reserve (bo[i], true); -amdgpu_vm_bo_rmv (adev, attachment[i]->bo_va); +amdgpu_vm_bo_del (adev, attachment[i]->bo_va);amdgpu_bo_unreserve (bo[i]);list_del (&attachment[i]->list); }
@@ -795,7 +795,7 @@ static void kfd_mem_detach(struct kfd_mem_attachment *attachment)pr_debug ("\t remove VA 0x%llx in entry %p\n" , attachment->va, attachment); -amdgpu_vm_bo_rmv (attachment->adev, attachment->bo_va); +amdgpu_vm_bo_del (attachment->adev, attachment->bo_va);drm_gem_object_put (&bo->tbo.base);list_del (&attachment->list);kfree (attachment);
drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c +1 -1
@@ -98,7 +98,7 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm,if (r) {DRM_ERROR ("failed to do bo_map on static CSA, err=%d\n" , r); -amdgpu_vm_bo_rmv (adev, *bo_va); +amdgpu_vm_bo_del (adev, *bo_va);ttm_eu_backoff_reservation (&ticket, &list);return r; }
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
@@ -221,7 +221,7 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,if (!bo_va || --bo_va->ref_count) goto out_unlock; -amdgpu_vm_bo_rmv (adev, bo_va); +amdgpu_vm_bo_del (adev, bo_va);if (!amdgpu_vm_ready (vm)) goto out_unlock;
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2 -2
@@ -1194,12 +1194,12 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,if (amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_VCE ) !=NULL )amdgpu_vce_free_handles (adev, file_priv); -amdgpu_vm_bo_rmv (adev, fpriv->prt_va); +amdgpu_vm_bo_del (adev, fpriv->prt_va);if (amdgpu_mcbp ||amdgpu_sriov_vf (adev)) {/* TODO: how to handle reserve failure */ BUG_ON (amdgpu_bo_reserve (adev->virt.csa_obj, true)); -amdgpu_vm_bo_rmv (adev, fpriv->csa_va); +amdgpu_vm_bo_del (adev, fpriv->csa_va); fpriv->csa_va =NULL ;amdgpu_bo_unreserve (adev->virt.csa_obj); }
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -2
@@ -2653,7 +2653,7 @@ void amdgpu_vm_bo_trace_cs(struct amdgpu_vm *vm, struct ww_acquire_ctx *ticket) }/** -* amdgpu_vm_bo_rmv - remove a bo to a specific vm +* amdgpu_vm_bo_del - remove a bo to a specific vm * * @adev: amdgpu_device pointer * @bo_va: requested bo_va
@@ -2662,7 +2662,7 @@ void amdgpu_vm_bo_trace_cs(struct amdgpu_vm *vm, struct ww_acquire_ctx *ticket)* * Object have to be reserved! */ -void amdgpu_vm_bo_rmv (struct amdgpu_device *adev, +void amdgpu_vm_bo_del (struct amdgpu_device *adev,struct amdgpu_bo_va *bo_va) {struct amdgpu_bo_va_mapping *mapping, *next;
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +1 -1
@@ -435,7 +435,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,struct amdgpu_bo_va_mapping *amdgpu_vm_bo_lookup_mapping (struct amdgpu_vm *vm,uint64_t addr);void amdgpu_vm_bo_trace_cs (struct amdgpu_vm *vm,struct ww_acquire_ctx *ticket); -void amdgpu_vm_bo_rmv (struct amdgpu_device *adev, +void amdgpu_vm_bo_del (struct amdgpu_device *adev,struct amdgpu_bo_va *bo_va); void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t min_vm_size, uint32_t fragment_size_default, unsigned max_level,
Signature · 1 line
2.25.1
Re: [PATCH 2/2] drm/amdgpu: rename amdgpu_vm_bo_rmv to _del
Quoted 86 lines · Christian König
Some people complained about the name and this matches much more Linux naming conventions for object functions.
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +2
-2@@ -778,7 +778,7 @@ static int kfd_mem_attach(struct amdgpu_device *adev, struct kgd_mem *mem,continue ;if (attachment[i]->bo_va) {amdgpu_bo_reserve (bo[i], true); -amdgpu_vm_bo_rmv (adev, attachment[i]->bo_va); +amdgpu_vm_bo_del (adev, attachment[i]->bo_va);amdgpu_bo_unreserve (bo[i]);list_del (&attachment[i]->list); }@@ -795,7 +795,7 @@ static void kfd_mem_detach(struct kfd_mem_attachment *attachment)pr_debug ("\t remove VA 0x%llx in entry %p\n" , attachment->va, attachment); -amdgpu_vm_bo_rmv (attachment->adev, attachment->bo_va); +amdgpu_vm_bo_del (attachment->adev, attachment->bo_va);drm_gem_object_put (&bo->tbo.base);list_del (&attachment->list);kfree (attachment);drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c +1
-1@@ -98,7 +98,7 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm,if (r) {DRM_ERROR ("failed to do bo_map on static CSA, err=%d\n" , r); -amdgpu_vm_bo_rmv (adev, *bo_va); +amdgpu_vm_bo_del (adev, *bo_va);ttm_eu_backoff_reservation (&ticket, &list);return r; }drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1
-1@@ -221,7 +221,7 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,if (!bo_va || --bo_va->ref_count) goto out_unlock; -amdgpu_vm_bo_rmv (adev, bo_va); +amdgpu_vm_bo_del (adev, bo_va);if (!amdgpu_vm_ready (vm)) goto out_unlock;drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2
-2@@ -1194,12 +1194,12 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,if (amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_VCE ) !=NULL )amdgpu_vce_free_handles (adev, file_priv); -amdgpu_vm_bo_rmv (adev, fpriv->prt_va); +amdgpu_vm_bo_del (adev, fpriv->prt_va);if (amdgpu_mcbp ||amdgpu_sriov_vf (adev)) {/* TODO: how to handle reserve failure */ BUG_ON (amdgpu_bo_reserve (adev->virt.csa_obj, true)); -amdgpu_vm_bo_rmv (adev, fpriv->csa_va); +amdgpu_vm_bo_del (adev, fpriv->csa_va); fpriv->csa_va =NULL ;amdgpu_bo_unreserve (adev->virt.csa_obj); }drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c void amdgpu_vm_bo_trace_cs(struct amdgpu_vm *vm, struct ww_acquire_ctx *ticket) · line 2656
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1@@ -2653,7 +2653,7 @@ void amdgpu_vm_bo_trace_cs(struct amdgpu_vm *vm, struct ww_acquire_ctx *ticket) }/** -* amdgpu_vm_bo_rmv - remove a bo to a specific vm +* amdgpu_vm_bo_del - remove a bo to a specific vm
Maybe reword this to "remove a bo from a specific vm", with that fixed, the series is:
Quoted 28 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1* * @adev: amdgpu_device pointer * @bo_va: requested bo_va @@ -2662,7 +2662,7 @@ void amdgpu_vm_bo_trace_cs(struct amdgpu_vm *vm, struct ww_acquire_ctx *ticket)* * Object have to be reserved! */ -void amdgpu_vm_bo_rmv (struct amdgpu_device *adev, +void amdgpu_vm_bo_del (struct amdgpu_device *adev,struct amdgpu_bo_va *bo_va) {struct amdgpu_bo_va_mapping *mapping, *next;drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +1
-2@@ -435,7 +435,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,struct amdgpu_bo_va_mapping *amdgpu_vm_bo_lookup_mapping (struct amdgpu_vm *vm,uint64_t addr);void amdgpu_vm_bo_trace_cs (struct amdgpu_vm *vm,struct ww_acquire_ctx *ticket); -void amdgpu_vm_bo_rmv (struct amdgpu_device *adev, +void amdgpu_vm_bo_del (struct amdgpu_device *adev,struct amdgpu_bo_va *bo_va); void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t min_vm_size, uint32_t fragment_size_default, unsigned max_level, --2.25.1
Re: [PATCH 2/2] drm/amdgpu: rename amdgpu_vm_bo_rmv to _del
In reply to Christian KönigAm 2022-02-01 um 10:28 schrieb Christian König:
Quoted 4 lines
Some people complained about the name and this matches much more Linux naming conventions for object functions.
Signed-off-by Christian König <[email protected]>
The series is
Quoted 111 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +2
-2@@ -778,7 +778,7 @@ static int kfd_mem_attach(struct amdgpu_device *adev, struct kgd_mem *mem,continue ;if (attachment[i]->bo_va) {amdgpu_bo_reserve (bo[i], true); -amdgpu_vm_bo_rmv (adev, attachment[i]->bo_va); +amdgpu_vm_bo_del (adev, attachment[i]->bo_va);amdgpu_bo_unreserve (bo[i]);list_del (&attachment[i]->list); }@@ -795,7 +795,7 @@ static void kfd_mem_detach(struct kfd_mem_attachment *attachment)pr_debug ("\t remove VA 0x%llx in entry %p\n" , attachment->va, attachment); -amdgpu_vm_bo_rmv (attachment->adev, attachment->bo_va); +amdgpu_vm_bo_del (attachment->adev, attachment->bo_va);drm_gem_object_put (&bo->tbo.base);list_del (&attachment->list);kfree (attachment);drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c +1
-1@@ -98,7 +98,7 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm,if (r) {DRM_ERROR ("failed to do bo_map on static CSA, err=%d\n" , r); -amdgpu_vm_bo_rmv (adev, *bo_va); +amdgpu_vm_bo_del (adev, *bo_va);ttm_eu_backoff_reservation (&ticket, &list);return r; }drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1
-1@@ -221,7 +221,7 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,if (!bo_va || --bo_va->ref_count) goto out_unlock; -amdgpu_vm_bo_rmv (adev, bo_va); +amdgpu_vm_bo_del (adev, bo_va);if (!amdgpu_vm_ready (vm)) goto out_unlock;drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2
-2@@ -1194,12 +1194,12 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,if (amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_VCE ) !=NULL )amdgpu_vce_free_handles (adev, file_priv); -amdgpu_vm_bo_rmv (adev, fpriv->prt_va); +amdgpu_vm_bo_del (adev, fpriv->prt_va);if (amdgpu_mcbp ||amdgpu_sriov_vf (adev)) {/* TODO: how to handle reserve failure */ BUG_ON (amdgpu_bo_reserve (adev->virt.csa_obj, true)); -amdgpu_vm_bo_rmv (adev, fpriv->csa_va); +amdgpu_vm_bo_del (adev, fpriv->csa_va); fpriv->csa_va =NULL ;amdgpu_bo_unreserve (adev->virt.csa_obj); }drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2
-2@@ -2653,7 +2653,7 @@ void amdgpu_vm_bo_trace_cs(struct amdgpu_vm *vm, struct ww_acquire_ctx *ticket) }/** -* amdgpu_vm_bo_rmv - remove a bo to a specific vm +* amdgpu_vm_bo_del - remove a bo to a specific vm * * @adev: amdgpu_device pointer * @bo_va: requested bo_va @@ -2662,7 +2662,7 @@ void amdgpu_vm_bo_trace_cs(struct amdgpu_vm *vm, struct ww_acquire_ctx *ticket)* * Object have to be reserved! */ -void amdgpu_vm_bo_rmv (struct amdgpu_device *adev, +void amdgpu_vm_bo_del (struct amdgpu_device *adev,struct amdgpu_bo_va *bo_va) {struct amdgpu_bo_va_mapping *mapping, *next;drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +1
-1@@ -435,7 +435,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,struct amdgpu_bo_va_mapping *amdgpu_vm_bo_lookup_mapping (struct amdgpu_vm *vm,uint64_t addr);void amdgpu_vm_bo_trace_cs (struct amdgpu_vm *vm,struct ww_acquire_ctx *ticket); -void amdgpu_vm_bo_rmv (struct amdgpu_device *adev, +void amdgpu_vm_bo_del (struct amdgpu_device *adev,struct amdgpu_bo_va *bo_va); void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t min_vm_size, uint32_t fragment_size_default, unsigned max_level,
Re: [PATCH 2/2] drm/amdgpu: rename amdgpu_vm_bo_rmv to _del
In reply to Christian KönigQuoted 5 lines · Christian König
Some people complained about the name and this matches much more Linux naming conventions for object functions.
Signed-off-by Christian König <[email protected]>
"some people" sounds mightily ominous :-)
On both patches: Acked-by: Daniel Vetter <[email protected]>
Cheers, Daniel
Quoted 114 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +2
-2@@ -778,7 +778,7 @@ static int kfd_mem_attach(struct amdgpu_device *adev, struct kgd_mem *mem,continue ;if (attachment[i]->bo_va) {amdgpu_bo_reserve (bo[i], true); -amdgpu_vm_bo_rmv (adev, attachment[i]->bo_va); +amdgpu_vm_bo_del (adev, attachment[i]->bo_va);amdgpu_bo_unreserve (bo[i]);list_del (&attachment[i]->list); }@@ -795,7 +795,7 @@ static void kfd_mem_detach(struct kfd_mem_attachment *attachment)pr_debug ("\t remove VA 0x%llx in entry %p\n" , attachment->va, attachment); -amdgpu_vm_bo_rmv (attachment->adev, attachment->bo_va); +amdgpu_vm_bo_del (attachment->adev, attachment->bo_va);drm_gem_object_put (&bo->tbo.base);list_del (&attachment->list);kfree (attachment);drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c +1
-1@@ -98,7 +98,7 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm,if (r) {DRM_ERROR ("failed to do bo_map on static CSA, err=%d\n" , r); -amdgpu_vm_bo_rmv (adev, *bo_va); +amdgpu_vm_bo_del (adev, *bo_va);ttm_eu_backoff_reservation (&ticket, &list);return r; }drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1
-1@@ -221,7 +221,7 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,if (!bo_va || --bo_va->ref_count) goto out_unlock; -amdgpu_vm_bo_rmv (adev, bo_va); +amdgpu_vm_bo_del (adev, bo_va);if (!amdgpu_vm_ready (vm)) goto out_unlock;drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2
-2@@ -1194,12 +1194,12 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,if (amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_VCE ) !=NULL )amdgpu_vce_free_handles (adev, file_priv); -amdgpu_vm_bo_rmv (adev, fpriv->prt_va); +amdgpu_vm_bo_del (adev, fpriv->prt_va);if (amdgpu_mcbp ||amdgpu_sriov_vf (adev)) {/* TODO: how to handle reserve failure */ BUG_ON (amdgpu_bo_reserve (adev->virt.csa_obj, true)); -amdgpu_vm_bo_rmv (adev, fpriv->csa_va); +amdgpu_vm_bo_del (adev, fpriv->csa_va); fpriv->csa_va =NULL ;amdgpu_bo_unreserve (adev->virt.csa_obj); }drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2
-2@@ -2653,7 +2653,7 @@ void amdgpu_vm_bo_trace_cs(struct amdgpu_vm *vm, struct ww_acquire_ctx *ticket) }/** -* amdgpu_vm_bo_rmv - remove a bo to a specific vm +* amdgpu_vm_bo_del - remove a bo to a specific vm * * @adev: amdgpu_device pointer * @bo_va: requested bo_va @@ -2662,7 +2662,7 @@ void amdgpu_vm_bo_trace_cs(struct amdgpu_vm *vm, struct ww_acquire_ctx *ticket)* * Object have to be reserved! */ -void amdgpu_vm_bo_rmv (struct amdgpu_device *adev, +void amdgpu_vm_bo_del (struct amdgpu_device *adev,struct amdgpu_bo_va *bo_va) {struct amdgpu_bo_va_mapping *mapping, *next;drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +1
-2@@ -435,7 +435,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,struct amdgpu_bo_va_mapping *amdgpu_vm_bo_lookup_mapping (struct amdgpu_vm *vm,uint64_t addr);void amdgpu_vm_bo_trace_cs (struct amdgpu_vm *vm,struct ww_acquire_ctx *ticket); -void amdgpu_vm_bo_rmv (struct amdgpu_device *adev, +void amdgpu_vm_bo_del (struct amdgpu_device *adev,struct amdgpu_bo_va *bo_va); void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t min_vm_size, uint32_t fragment_size_default, unsigned max_level, --2.25.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Re: [PATCH 2/2] drm/amdgpu: rename amdgpu_vm_bo_rmv to _del
Am 01.02.22 um 17:27 schrieb Daniel Vetter:
Quoted 7 lines
Quoted 4 lines · Christian König
Some people complained about the name and this matches much more Linux naming conventions for object functions.
Signed-off-by Christian König <[email protected]>"some people" sounds mightily ominous :-)
That's intentional, you were not the only one :)
Cheers,
Christian.
Quoted 120 lines
On both patches: Acked-by: Daniel Vetter <[email protected]>
Cheers, Daniel
Quoted 114 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +2
-2@@ -778,7 +778,7 @@ static int kfd_mem_attach(struct amdgpu_device *adev, struct kgd_mem *mem,continue ;if (attachment[i]->bo_va) {amdgpu_bo_reserve (bo[i], true); -amdgpu_vm_bo_rmv (adev, attachment[i]->bo_va); +amdgpu_vm_bo_del (adev, attachment[i]->bo_va);amdgpu_bo_unreserve (bo[i]);list_del (&attachment[i]->list); }@@ -795,7 +795,7 @@ static void kfd_mem_detach(struct kfd_mem_attachment *attachment)pr_debug ("\t remove VA 0x%llx in entry %p\n" , attachment->va, attachment); -amdgpu_vm_bo_rmv (attachment->adev, attachment->bo_va); +amdgpu_vm_bo_del (attachment->adev, attachment->bo_va);drm_gem_object_put (&bo->tbo.base);list_del (&attachment->list);kfree (attachment);drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c +1
-1@@ -98,7 +98,7 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm,if (r) {DRM_ERROR ("failed to do bo_map on static CSA, err=%d\n" , r); -amdgpu_vm_bo_rmv (adev, *bo_va); +amdgpu_vm_bo_del (adev, *bo_va);ttm_eu_backoff_reservation (&ticket, &list);return r; }drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1
-1@@ -221,7 +221,7 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,if (!bo_va || --bo_va->ref_count) goto out_unlock; -amdgpu_vm_bo_rmv (adev, bo_va); +amdgpu_vm_bo_del (adev, bo_va);if (!amdgpu_vm_ready (vm)) goto out_unlock;drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2
-2@@ -1194,12 +1194,12 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,if (amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_VCE ) !=NULL )amdgpu_vce_free_handles (adev, file_priv); -amdgpu_vm_bo_rmv (adev, fpriv->prt_va); +amdgpu_vm_bo_del (adev, fpriv->prt_va);if (amdgpu_mcbp ||amdgpu_sriov_vf (adev)) {/* TODO: how to handle reserve failure */ BUG_ON (amdgpu_bo_reserve (adev->virt.csa_obj, true)); -amdgpu_vm_bo_rmv (adev, fpriv->csa_va); +amdgpu_vm_bo_del (adev, fpriv->csa_va); fpriv->csa_va =NULL ;amdgpu_bo_unreserve (adev->virt.csa_obj); }drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2
-2@@ -2653,7 +2653,7 @@ void amdgpu_vm_bo_trace_cs(struct amdgpu_vm *vm, struct ww_acquire_ctx *ticket) }/** -* amdgpu_vm_bo_rmv - remove a bo to a specific vm +* amdgpu_vm_bo_del - remove a bo to a specific vm * * @adev: amdgpu_device pointer * @bo_va: requested bo_va @@ -2662,7 +2662,7 @@ void amdgpu_vm_bo_trace_cs(struct amdgpu_vm *vm, struct ww_acquire_ctx *ticket)* * Object have to be reserved! */ -void amdgpu_vm_bo_rmv (struct amdgpu_device *adev, +void amdgpu_vm_bo_del (struct amdgpu_device *adev,struct amdgpu_bo_va *bo_va) {struct amdgpu_bo_va_mapping *mapping, *next;drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +1
-2@@ -435,7 +435,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,struct amdgpu_bo_va_mapping *amdgpu_vm_bo_lookup_mapping (struct amdgpu_vm *vm,uint64_t addr);void amdgpu_vm_bo_trace_cs (struct amdgpu_vm *vm,struct ww_acquire_ctx *ticket); -void amdgpu_vm_bo_rmv (struct amdgpu_device *adev, +void amdgpu_vm_bo_del (struct amdgpu_device *adev,struct amdgpu_bo_va *bo_va); void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t min_vm_size, uint32_t fragment_size_default, unsigned max_level, --2.25.1