So we can actually return errors.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14165>
++syncobj_idx;
}
- bool success = true;
+ VkResult result = VK_SUCCESS;
if (syncobj_idx > 0) {
- success = device->ws->wait_timeline_syncobj(device->ws, syncobj, points, syncobj_idx, true,
- true, timeout);
+ result = device->ws->wait_timeline_syncobj(device->ws, syncobj, points, syncobj_idx, true,
+ true, timeout);
}
free(points);
- return success ? VK_SUCCESS : VK_TIMEOUT;
+ return result;
}
static int
handles[i] = semaphore->permanent.syncobj;
}
- bool success =
+ VkResult result =
device->ws->wait_timeline_syncobj(device->ws, handles, pWaitInfo->pValues,
pWaitInfo->semaphoreCount, wait_all, false, abs_timeout);
free(handles);
- return success ? VK_SUCCESS : VK_TIMEOUT;
+ return result;
}
VKAPI_ATTR VkResult VKAPI_CALL
VkResult (*query_syncobj)(struct radeon_winsys *ws, uint32_t handle, uint64_t *point);
bool (*wait_syncobj)(struct radeon_winsys *ws, const uint32_t *handles, uint32_t handle_count,
bool wait_all, uint64_t timeout);
- bool (*wait_timeline_syncobj)(struct radeon_winsys *ws, const uint32_t *handles,
- const uint64_t *points, uint32_t handle_count, bool wait_all,
- bool available, uint64_t timeout);
+ VkResult (*wait_timeline_syncobj)(struct radeon_winsys *ws, const uint32_t *handles,
+ const uint64_t *points, uint32_t handle_count, bool wait_all,
+ bool available, uint64_t timeout);
int (*export_syncobj)(struct radeon_winsys *ws, uint32_t syncobj, int *fd);
int (*import_syncobj)(struct radeon_winsys *ws, int fd, uint32_t *syncobj);
}
}
-static bool
+static VkResult
radv_amdgpu_wait_timeline_syncobj(struct radeon_winsys *_ws, const uint32_t *handles,
const uint64_t *points, uint32_t handle_count, bool wait_all,
bool available, uint64_t timeout)
(available ? DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE : 0),
NULL);
if (ret == 0) {
- return true;
+ return VK_SUCCESS;
} else if (ret == -ETIME) {
- return false;
+ return VK_TIMEOUT;
} else {
fprintf(stderr, "amdgpu: radv_amdgpu_wait_timeline_syncobj failed! (%d)\n", ret);
- return false;
+ return VK_ERROR_UNKNOWN;
}
}