xwayland: switch to drm-uapi headers

Always build DMA_BUF_IOCTL_*_SYNC_FILE code.

Fixes: 6f85ce4d4e ("xwayland: support DRI3 1.4 and Present 1.4")
Fixes: 3df236a3d5 ("xwayland: add functions to import and export dma-buf implicit fences")
This commit is contained in:
Jan Beich 2024-05-04 21:52:41 +02:00 committed by Alan Coopersmith
parent 992f4c1fd8
commit b6e8c7e337

View file

@ -39,11 +39,9 @@
#include <sys/stat.h>
#include <xf86drm.h>
#include <drm_fourcc.h>
#if defined(__linux__)
#include <linux/dma-buf.h>
#include <linux/sync_file.h>
#include "drm-uapi/dma-buf.h"
#include "drm-uapi/sync_file.h"
#include <sys/ioctl.h>
#endif
#define MESA_EGL_NO_X11_HEADERS
#define EGL_NO_X11
@ -912,7 +910,6 @@ xwl_glamor_dmabuf_export_sync_file(PixmapPtr pixmap)
if (!xwl_screen->glamor)
return -1;
#ifdef DMA_BUF_IOCTL_EXPORT_SYNC_FILE
xwl_pixmap = xwl_pixmap_get(pixmap);
num_planes = gbm_bo_get_plane_count(xwl_pixmap->bo);
@ -947,7 +944,6 @@ xwl_glamor_dmabuf_export_sync_file(PixmapPtr pixmap)
sync_file = merge_args.fence;
}
}
#endif /* DMA_BUF_IOCTL_EXPORT_SYNC_FILE */
return sync_file;
}
@ -965,7 +961,6 @@ xwl_glamor_dmabuf_import_sync_file(PixmapPtr pixmap, int sync_file)
if (!xwl_screen->glamor)
return;
#ifdef DMA_BUF_IOCTL_IMPORT_SYNC_FILE
xwl_pixmap = xwl_pixmap_get(pixmap);
num_planes = gbm_bo_get_plane_count(xwl_pixmap->bo);
@ -990,7 +985,6 @@ xwl_glamor_dmabuf_import_sync_file(PixmapPtr pixmap, int sync_file)
drmIoctl(plane_fd, DMA_BUF_IOCTL_IMPORT_SYNC_FILE, &import_args);
close(plane_fd);
}
#endif /* DMA_BUF_IOCTL_IMPORT_SYNC_FILE */
close(sync_file);
}
@ -1234,12 +1228,7 @@ xwl_gbm_supports_syncobjs(struct xwl_screen *xwl_screen)
if (errno != ENOENT)
return FALSE;
#if !defined(DMA_BUF_IOCTL_EXPORT_SYNC_FILE) || \
!defined(DMA_BUF_IOCTL_IMPORT_SYNC_FILE)
return FALSE;
#else
return TRUE;
#endif
}
static dri3_screen_info_rec xwl_dri3_info = {