From 2e9ce1152e7205116050c5d7da58a2a66d0ed909 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 10 Jun 2022 20:43:51 -0500 Subject: [PATCH] vulkan/wsi: Use the newly imported dma-buf.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Acked-by: Daniel Stone Reviewed-by: José Roberto de Souza Part-of: --- src/vulkan/wsi/wsi_common_drm.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_drm.c b/src/vulkan/wsi/wsi_common_drm.c index b3269566e04..43c380cc966 100644 --- a/src/vulkan/wsi/wsi_common_drm.c +++ b/src/vulkan/wsi/wsi_common_drm.c @@ -30,29 +30,15 @@ #include "vk_physical_device.h" #include "vk_util.h" #include "drm-uapi/drm_fourcc.h" +#include "drm-uapi/dma-buf.h" #include -#include -#include #include #include #include #include #include -struct dma_buf_export_sync_file_wsi { - __u32 flags; - __s32 fd; -}; - -struct dma_buf_import_sync_file_wsi { - __u32 flags; - __s32 fd; -}; - -#define DMA_BUF_IOCTL_EXPORT_SYNC_FILE_WSI _IOWR(DMA_BUF_BASE, 2, struct dma_buf_export_sync_file_wsi) -#define DMA_BUF_IOCTL_IMPORT_SYNC_FILE_WSI _IOW(DMA_BUF_BASE, 3, struct dma_buf_import_sync_file_wsi) - static VkResult wsi_dma_buf_export_sync_file(int dma_buf_fd, int *sync_file_fd) { @@ -61,11 +47,11 @@ wsi_dma_buf_export_sync_file(int dma_buf_fd, int *sync_file_fd) if (no_dma_buf_sync_file) return VK_ERROR_FEATURE_NOT_PRESENT; - struct dma_buf_export_sync_file_wsi export = { + struct dma_buf_export_sync_file export = { .flags = DMA_BUF_SYNC_RW, .fd = -1, }; - int ret = drmIoctl(dma_buf_fd, DMA_BUF_IOCTL_EXPORT_SYNC_FILE_WSI, &export); + int ret = drmIoctl(dma_buf_fd, DMA_BUF_IOCTL_EXPORT_SYNC_FILE, &export); if (ret) { if (errno == ENOTTY || errno == EBADF || errno == ENOSYS) { no_dma_buf_sync_file = true; @@ -88,11 +74,11 @@ wsi_dma_buf_import_sync_file(int dma_buf_fd, int sync_file_fd) if (no_dma_buf_sync_file) return VK_ERROR_FEATURE_NOT_PRESENT; - struct dma_buf_import_sync_file_wsi import = { + struct dma_buf_import_sync_file import = { .flags = DMA_BUF_SYNC_RW, .fd = sync_file_fd, }; - int ret = drmIoctl(dma_buf_fd, DMA_BUF_IOCTL_IMPORT_SYNC_FILE_WSI, &import); + int ret = drmIoctl(dma_buf_fd, DMA_BUF_IOCTL_IMPORT_SYNC_FILE, &import); if (ret) { if (errno == ENOTTY || errno == EBADF || errno == ENOSYS) { no_dma_buf_sync_file = true;