drm/amdgpu: release the VM shadow in the error path as well
Subsystems (2)
PATCH 1/2 drm/amdgpu: release the VM shadow in the error path as well
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -0
@@ -411,6 +411,7 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev, r =amdgpu_vm_clear_bo (adev, vm, pt, level, ats);if (r) { +amdgpu_bo_unref (&pt->shadow);amdgpu_bo_unref (&pt);return r; }
@@ -418,6 +419,7 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,if (vm->use_cpu_for_update) { r =amdgpu_bo_kmap (pt,NULL );if (r) { +amdgpu_bo_unref (&pt->shadow);amdgpu_bo_unref (&pt);return r; }
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): 20180202201737.12266-1-christian.koenig-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdgpu: clear the shadow fence as well
It also needs to be initialized.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 -0
@@ -336,6 +336,11 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,amdgpu_bo_fence (bo, fence, true);dma_fence_put (fence); + +if (bo->shadow) +return amdgpu_vm_clear_bo (adev, vm, bo->shadow, + level, pte_support_ats); +return 0 ; error_free:
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
The series is Reviewed-by: Chunming Zhou <[email protected]>
Quoted 18 lines · Christian König
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-0@@ -411,6 +411,7 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev, r =amdgpu_vm_clear_bo (adev, vm, pt, level, ats);if (r) { +amdgpu_bo_unref (&pt->shadow);amdgpu_bo_unref (&pt);return r; }
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev, · line 425
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-0@@ -418,6 +419,7 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,if (vm->use_cpu_for_update) { r =amdgpu_bo_kmap (pt,NULL );if (r) { +amdgpu_bo_unref (&pt->shadow);amdgpu_bo_unref (&pt);return r; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx