[PATCH] drm/amdgpu: fix fence handling in amdgpu_gem_object_close

Christian König ckoenig.leichtzumerken at gmail.com
Tue Mar 31 14:25:37 UTC 2020


The exclusive fence is only optional.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index a0be80513e96..77d988a0033f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -191,8 +191,10 @@ void amdgpu_gem_object_close(struct drm_gem_object *obj,
 		goto out_unlock;
 
 	fence = dma_resv_get_excl(bo->tbo.base.resv);
-	amdgpu_bo_fence(bo, fence, true);
-	fence = NULL;
+	if (fence) {
+		amdgpu_bo_fence(bo, fence, true);
+		fence = NULL;
+	}
 
 	r = amdgpu_vm_clear_freed(adev, vm, &fence);
 	if (r || !fence)
-- 
2.17.1



More information about the amd-gfx mailing list