From d5884a716f9c11b5e5cbf111f2b940e1abb657cd Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Thu, 30 Jun 2022 17:37:00 -0700 Subject: [PATCH] vulkan/wsi: Disable dma-buf sync file if ENOSYS is returned ENOSYS is commented as "Invalid system call number". This is returned by qemu-user for unbridged ioctls. Fixes: 30b57f10b36d ("vulkan/wsi: Signal semaphores and fences from the dma-buf") Signed-off-by: Jordan Justen Reviewed-by: Jason Ekstrand Part-of: --- src/vulkan/wsi/wsi_common_drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_drm.c b/src/vulkan/wsi/wsi_common_drm.c index 1e4fc51798e..b0e20239a73 100644 --- a/src/vulkan/wsi/wsi_common_drm.c +++ b/src/vulkan/wsi/wsi_common_drm.c @@ -68,7 +68,7 @@ wsi_dma_buf_export_sync_file(int dma_buf_fd, int *sync_file_fd) }; int ret = drmIoctl(dma_buf_fd, DMA_BUF_IOCTL_EXPORT_SYNC_FILE_WSI, &export); if (ret) { - if (errno == ENOTTY || errno == EBADF) { + if (errno == ENOTTY || errno == EBADF || errno == ENOSYS) { no_dma_buf_sync_file = true; return VK_ERROR_FEATURE_NOT_PRESENT; } else { @@ -95,7 +95,7 @@ wsi_dma_buf_import_sync_file(int dma_buf_fd, int sync_file_fd) }; int ret = drmIoctl(dma_buf_fd, DMA_BUF_IOCTL_IMPORT_SYNC_FILE_WSI, &import); if (ret) { - if (errno == ENOTTY || errno == EBADF) { + if (errno == ENOTTY || errno == EBADF || errno == ENOSYS) { no_dma_buf_sync_file = true; return VK_ERROR_FEATURE_NOT_PRESENT; } else {