radv/winsys: Add binary syncobj ABI changes for timeline semaphores.
[mesa.git] / src / amd / vulkan / winsys / amdgpu / radv_amdgpu_winsys.c
index 29e7b20b886e2645bd37140733bd0a85b2641f37..c6deedcb32ccd4ff7fd9e6e047ef06ca89ae5528 100644 (file)
@@ -162,6 +162,10 @@ static void radv_amdgpu_winsys_destroy(struct radeon_winsys *rws)
 {
        struct radv_amdgpu_winsys *ws = (struct radv_amdgpu_winsys*)rws;
 
+       for (unsigned i = 0; i < ws->syncobj_count; ++i)
+               amdgpu_cs_destroy_syncobj(ws->dev, ws->syncobj[i]);
+       free(ws->syncobj);
+
        ac_addrlib_destroy(ws->addrlib);
        amdgpu_device_deinitialize(ws->dev);
        FREE(rws);
@@ -197,6 +201,7 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags)
        ws->use_llvm = debug_flags & RADV_DEBUG_LLVM;
        list_inithead(&ws->global_bo_list);
        pthread_mutex_init(&ws->global_bo_list_lock, NULL);
+       pthread_mutex_init(&ws->syncobj_lock, NULL);
        ws->base.query_info = radv_amdgpu_winsys_query_info;
        ws->base.query_value = radv_amdgpu_winsys_query_value;
        ws->base.read_registers = radv_amdgpu_winsys_read_registers;