Mesa (main): vulkan/wsi: treat EBADF as missing DMA_BUF_IOCTL_{EXPORT,IMPORT}_SYNC_FILE
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 16 02:57:19 UTC 2022
Module: Mesa
Branch: main
Commit: 78523eea2fa0f649179338ee2b5d89a66a8ed7fb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=78523eea2fa0f649179338ee2b5d89a66a8ed7fb
Author: Jan Beich <jbeich at FreeBSD.org>
Date: Sat Jun 11 06:05:17 2022 +0000
vulkan/wsi: treat EBADF as missing DMA_BUF_IOCTL_{EXPORT,IMPORT}_SYNC_FILE
FreeBSD supports DMA-BUF but not DMA_BUF_IOCTL_SYNC and similar yet.
As it returns EBADF instead of ENOTTY all consumers fail due to
VK_ERROR_OUT_OF_HOST_MEMORY.
Fixes: 30b57f10b36d ("vulkan/wsi: Signal semaphores and fences from the dma-buf")
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17070>
---
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 ed600606912..1e4fc51798e 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) {
+ if (errno == ENOTTY || errno == EBADF) {
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) {
+ if (errno == ENOTTY || errno == EBADF) {
no_dma_buf_sync_file = true;
return VK_ERROR_FEATURE_NOT_PRESENT;
} else {
More information about the mesa-commit
mailing list