drm/amdgpu: re-validate per VM BOs if required v2
Subsystems (2)
PATCH 1/2 drm/amdgpu: re-validate per VM BOs if required v2
If a per VM BO ends up in a allowed domain it never moves back into the prefered domain.
v2: move the extra handling into amdgpu_vm_bo_update when we exit the
state machine. Make memory type handling generic.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +14 -1
@@ -1555,7 +1555,20 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, }spin_lock (&vm->status_lock); -list_del_init (&bo_va->base.vm_status); +if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) { +unsigned mem_type = bo->tbo.mem.mem_type; + +/* If the BO is not in its preferred location add it back to +* the evicted list so that it gets validated again on the +* next command submission. +*/ +if (!(bo->preferred_domains &amdgpu_mem_type_to_domain (mem_type))) +list_add_tail (&bo_va->base.vm_status, &vm->evicted); +else +list_del_init (&bo_va->base.vm_status); + }else { +list_del_init (&bo_va->base.vm_status); + }spin_unlock (&vm->status_lock);list_splice_init (&bo_va->invalids, &bo_va->valids);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180405121904.1604-1-christian.koenig-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdgpu: keep per VM BOs together on the LRU
When one VM BOs validated move all of them them to the end of the LRU to keep them together.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 82 +++++++++++++++++++++++++++++++--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 +- 3 files changed, 78 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +1 -1
@@ -638,7 +638,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, struct amdgpu_bo_list_entry, tv.head); - r =amdgpu_vm_validate_pt_bos (p->adev, &fpriv->vm, + r =amdgpu_vm_validate_pt_bos (p->adev, p->filp, &fpriv->vm, amdgpu_cs_validate, p);if (r) {DRM_ERROR ("amdgpu_vm_validate_pt_bos() failed.\n" );
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +75 -7
120 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +2 -1
@@ -257,7 +257,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm,struct list_head *validated, struct amdgpu_bo_list_entry *entry);bool amdgpu_vm_ready (struct amdgpu_vm *vm); -int amdgpu_vm_validate_pt_bos (struct amdgpu_device *adev,struct amdgpu_vm *vm, +int amdgpu_vm_validate_pt_bos (struct amdgpu_device *adev,struct drm_file *filp, +struct amdgpu_vm *vm,int (*callback)(void *p,struct amdgpu_bo *bo),void *param); int amdgpu_vm_alloc_pts(struct amdgpu_device *adev,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx