ports/x11-wm/magpie/files/patch-cogl_cogl_cogl-dma-buf-handle.c
Olivier Duchateau 9dfd97607b x11-wm/magpie: New port. X11 window manager and compositor library
Magpie is a new dependency for the upcoming x11/budgie update.

ChangeLog: https://github.com/BuddiesOfBudgie/magpie/releases/tag/v0.9.2

 * Add x11-wm/magpie (component for the new stable release of
   x11/budgie-desktop)
 * Add patches from bug #271823 and bug #271824 (tested with mutter 43.x and
   44.x)
 * Add support in Mk/Uses/budgie.mk

PR:		273268
Reported by:	duchateau.olivier@gmail.com (maintainer)
2023-08-25 08:44:08 +02:00

34 lines
1,004 B
C

$OpenBSD: patch-cogl_cogl_cogl-dma-buf-handle_c,v 1.2 2021/06/04 10:56:17 ajacoutot Exp $
Index: cogl/cogl/cogl-dma-buf-handle.c
--- cogl/cogl/cogl-dma-buf-handle.c.orig 2023-06-01 15:35:15 UTC
+++ cogl/cogl/cogl-dma-buf-handle.c
@@ -36,7 +36,28 @@
#include <errno.h>
#include <gio/gio.h>
+#ifdef __linux__
#include <linux/dma-buf.h>
+#else // bundle on BSDs
+typedef uint64_t __u64;
+
+// From https://github.com/evadot/drm-subtree or https://reviews.freebsd.org/D23085
+struct dma_buf_sync
+{
+ __u64 flags;
+};
+
+#define DMA_BUF_SYNC_READ (1 << 0)
+#define DMA_BUF_SYNC_WRITE (2 << 0)
+#define DMA_BUF_SYNC_RW (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
+#define DMA_BUF_SYNC_START (0 << 2)
+#define DMA_BUF_SYNC_END (1 << 2)
+#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
+ (DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
+
+#define DMA_BUF_BASE 'b'
+#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
+#endif
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>