Mesa (18.0): radv/winsys: fix leaking resources from bo's imported by fd

Juan Antonio Suárez Romero jasuarez at kemper.freedesktop.org
Thu May 3 16:52:06 UTC 2018


Module: Mesa
Branch: 18.0
Commit: 5a7de464926e71e8b257b24a7151d0613af23664
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a7de464926e71e8b257b24a7151d0613af23664

Author: Andres Rodriguez <andresx7 at gmail.com>
Date:   Mon Apr 30 18:05:49 2018 -0400

radv/winsys: fix leaking resources from bo's imported by fd

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>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
CC: 18.0 18.1 <mesa-stable at lists.freedesktop.org>
(cherry picked from commit f56e22e49673e8234a7fe0c241b4c3eae4752f34)

---

 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 603111d2eb..78bf454eca 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
@@ -450,6 +450,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-commit mailing list