[Mesa-stable] [Mesa-dev] [PATCH] radv/winsys: fix leaking resources from bo's imported by fd

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue May 1 11:21:08 UTC 2018


Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 05/01/2018 12:13 AM, Andres Rodriguez wrote:
> A bo's ref_count was not being initialized when imported from an fd.
> Therefore, we would fail to free the resource during VkFreeMemory().
> 
> This patch fixes applications like hifi VR in threaded mode, which
> perform frequent imports/releases of IPC shared memory.
> 
> Signed-off-by: Andres Rodriguez <andresx7 at gmail.com>
> CC: 18.0 18.1 <mesa-stable at lists.freedesktop.org>
> ---
>   src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
> index e2060651e4..8ed3e53e2d 100644
> --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
> +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
> @@ -501,6 +501,7 @@ radv_amdgpu_winsys_bo_from_fd(struct radeon_winsys *_ws,
>   	bo->size = result.alloc_size;
>   	bo->is_shared = true;
>   	bo->ws = ws;
> +	bo->ref_count = 1;
>   	radv_amdgpu_add_buffer_to_global_list(bo);
>   	return (struct radeon_winsys_bo *)bo;
>   error_va_map:
> 


More information about the mesa-stable mailing list