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

Pan, Xinhui Xinhui.Pan at amd.com
Tue Mar 31 14:40:51 UTC 2020


Reviewed-by: xinhui pan <xinhui.pan at amd.com>

> 2020年3月31日 22:25,Christian König <ckoenig.leichtzumerken at gmail.com> 写道:
> 
> 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
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cxinhui.pan%40amd.com%7Cd59da038993e43160f6608d7d57f6535%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637212615519082332&sdata=kLCEV01aoJ6%2BrWD7yRBN1NB3b%2FJRyYA0TpV%2FGoATB0c%3D&reserved=0



More information about the amd-gfx mailing list