drm/amdgpu: simplify bo_va list when vm bo update
Subsystems (2)
PATCH 1/1 drm/amdgpu: simplify bo_va list when vm bo update
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +9 -12
@@ -1561,19 +1561,16 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, }spin_lock (&vm->status_lock); -if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) { -unsigned mem_type = bo->tbo.mem.mem_type; +list_del_init (&bo_va->base.vm_status); -/* 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. -*/ -list_del_init (&bo_va->base.vm_status); -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); - } +/* 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. +*/ +unsigned mem_type = bo->tbo.mem.mem_type; +if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv && + !(bo->preferred_domains &amdgpu_mem_type_to_domain (mem_type))) +list_add_tail (&bo_va->base.vm_status, &vm->evicted);spin_unlock (&vm->status_lock);list_splice_init (&bo_va->invalids, &bo_va->valids);
Signature · 6 lines
1.9.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): 1524115892-22616-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org
Quoted 22 lines · Junwei Zhang
Signed-off-by Junwei Zhang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-7@@ -1561,19 +1561,16 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, }spin_lock (&vm->status_lock); -if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) { -unsigned mem_type = bo->tbo.mem.mem_type; +list_del_init (&bo_va->base.vm_status); -/* 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. -*/ -list_del_init (&bo_va->base.vm_status);
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device *adev, · line 1570
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5
-5-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); - } +/* 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. +*/ +unsigned mem_type = bo->tbo.mem.mem_type;
Don't you get compiling warning for defining var between code?
Regards,
David Zhou
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device *adev, · line 1576
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3
-0+if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv && + !(bo->preferred_domains &amdgpu_mem_type_to_domain (mem_type))) +list_add_tail (&bo_va->base.vm_status, &vm->evicted);spin_unlock (&vm->status_lock);list_splice_init (&bo_va->invalids, &bo_va->valids);
_______________________________________________
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): 5c9f7bf7-df86-4201-24f2-7adadef1f1c1-5C7GfCeVMHo@public.gmane.org
Quoted 27 lines · On 04/19/2018 02:26 PM, zhoucm1 wrote:
Quoted 24 lines · Junwei Zhang
Signed-off-by Junwei Zhang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-10@@ -1561,19 +1561,16 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, }spin_lock (&vm->status_lock); -if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) { -unsigned mem_type = bo->tbo.mem.mem_type; +list_del_init (&bo_va->base.vm_status); -/* 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. -*/ -list_del_init (&bo_va->base.vm_status); -if (!(bo->preferred_domains &amdgpu_mem_type_to_domain (mem_type))) -list_add_tail (&bo_va->base.vm_status, &vm->evicted); - }else {
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device *adev, · line 1570
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5
-2-list_del_init (&bo_va->base.vm_status); - } +/* 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. +*/ +unsigned mem_type = bo->tbo.mem.mem_type;Don't you get compiling warning for defining var between code?
Thanks to reminder that.
Fixed in v2.
Jerry
Quoted 9 lines
Regards,
David Zhoudrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device *adev, · line 1576
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3
-0+if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv && + !(bo->preferred_domains &amdgpu_mem_type_to_domain (mem_type))) +list_add_tail (&bo_va->base.vm_status, &vm->evicted);spin_unlock (&vm->status_lock);list_splice_init (&bo_va->invalids, &bo_va->valids);
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx