venus: add vn_wsi_sync_wait to handle implicit sync workaround

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
This commit is contained in:
Yiwei Zhang 2026-01-04 22:14:21 -08:00 committed by Marge Bot
parent 37b95dc8d6
commit fdb2a8f88f
3 changed files with 17 additions and 5 deletions

View file

@ -10,7 +10,6 @@
#include "vn_queue.h"
#include "util/libsync.h"
#include "venus-protocol/vn_protocol_driver_event.h"
#include "venus-protocol/vn_protocol_driver_fence.h"
#include "venus-protocol/vn_protocol_driver_queue.h"
@ -2449,10 +2448,7 @@ vn_GetSemaphoreFdKHR(VkDevice device,
if (result != VK_SUCCESS)
return vn_error(dev->instance, result);
#ifdef VN_USE_WSI_PLATFORM
if (!dev->renderer->info.has_implicit_fencing)
sync_wait(fd, -1);
#endif
vn_wsi_sync_wait(dev, fd);
} else {
assert(payload->type == VN_SYNC_TYPE_IMPORTED_SYNC_FD);

View file

@ -252,6 +252,13 @@ vn_wsi_validate_image_format_info(struct vn_physical_device *physical_dev,
return true;
}
void
vn_wsi_sync_wait(struct vn_device *dev, int fd)
{
if (!dev->renderer->info.has_implicit_fencing)
sync_wait(fd, -1);
}
/* swapchain commands */
VKAPI_ATTR VkResult VKAPI_CALL

View file

@ -35,6 +35,9 @@ vn_wsi_validate_image_format_info(
struct vn_physical_device *physical_dev,
const VkPhysicalDeviceImageFormatInfo2 *info);
void
vn_wsi_sync_wait(struct vn_device *dev, int fd);
#else
static inline VkResult
@ -65,6 +68,12 @@ vn_wsi_validate_image_format_info(struct vn_physical_device *physical_dev,
return true;
}
static inline void
vn_wsi_sync_wait(struct vn_device *dev, int fd)
{
return;
}
#endif /* VN_USE_WSI_PLATFORM */
#endif /* VN_WSI_H */