git: 1d5af0b2f979 - 2024Q3 - x11-toolkits/gtk40: enable DMABUF support after 5d5b000e62a6
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Aug 2024 00:56:34 UTC
The branch 2024Q3 has been updated by jbeich: URL: https://cgit.FreeBSD.org/ports/commit/?id=1d5af0b2f979ca1e6894130be975710be38e9cb1 commit 1d5af0b2f979ca1e6894130be975710be38e9cb1 Author: Vasily Postnikov <shamaz.mazum@gmail.com> AuthorDate: 2024-08-27 18:37:53 +0000 Commit: Jan Beich <jbeich@FreeBSD.org> CommitDate: 2024-08-29 00:55:09 +0000 x11-toolkits/gtk40: enable DMABUF support after 5d5b000e62a6 PR: 281107 (cherry picked from commit 16e7d54a12bf07b70eff31fa44bbfd9001f9965c) --- x11-toolkits/gtk40/Makefile | 4 +- x11-toolkits/gtk40/files/patch-dmabuf | 70 +++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/x11-toolkits/gtk40/Makefile b/x11-toolkits/gtk40/Makefile index 04ebc8e3351e..679f7e153da2 100644 --- a/x11-toolkits/gtk40/Makefile +++ b/x11-toolkits/gtk40/Makefile @@ -1,5 +1,6 @@ PORTNAME= gtk PORTVERSION= 4.14.4 +PORTREVISION= 1 CATEGORIES= x11-toolkits MASTER_SITES= GNOME PKGNAMESUFFIX= 4 @@ -13,7 +14,8 @@ LICENSE= LGPL20 PORTSCOUT= limit:1,even -BUILD_DEPENDS= sassc>0:textproc/sassc +BUILD_DEPENDS= ${LOCALBASE}/include/libdrm/drm_fourcc.h:graphics/libdrm \ + sassc>0:textproc/sassc LIB_DEPENDS= libepoxy.so:graphics/libepoxy \ libpng.so:graphics/png \ libtiff.so:graphics/tiff \ diff --git a/x11-toolkits/gtk40/files/patch-dmabuf b/x11-toolkits/gtk40/files/patch-dmabuf new file mode 100644 index 000000000000..b1fa7e5a1c85 --- /dev/null +++ b/x11-toolkits/gtk40/files/patch-dmabuf @@ -0,0 +1,70 @@ +--- dma-buf-compat.h.orig 2024-08-27 18:15:44 UTC ++++ dma-buf-compat.h +@@ -0,0 +1,22 @@ ++#ifdef __linux__ ++#include <linux/dma-buf.h> ++#else ++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 +--- gdk/gdkdmabuf.c.orig 2024-08-27 18:17:03 UTC ++++ gdk/gdkdmabuf.c +@@ -28,8 +28,8 @@ + #ifdef HAVE_DMABUF + #include <sys/mman.h> + #include <sys/ioctl.h> +-#include <linux/dma-buf.h> + #include <epoxy/egl.h> ++#include "../dma-buf-compat.h" + + typedef struct _GdkDrmFormatInfo GdkDrmFormatInfo; + +--- gsk/gpu/gskgpudownloadop.c.orig 2024-08-27 18:18:39 UTC ++++ gsk/gpu/gskgpudownloadop.c +@@ -16,7 +16,7 @@ + #include "gdk/gdkglcontextprivate.h" + + #ifdef HAVE_DMABUF +-#include <linux/dma-buf.h> ++#include "../../dma-buf-compat.h" + #endif + + typedef struct _GskGpuDownloadOp GskGpuDownloadOp; +--- gsk/gpu/gskvulkanimage.c.orig 2024-08-27 18:18:26 UTC ++++ gsk/gpu/gskvulkanimage.c +@@ -15,7 +15,7 @@ + #include <fcntl.h> + #include <string.h> + #ifdef HAVE_DMABUF +-#include <linux/dma-buf.h> ++#include <../../dma-buf-compat.h> + #endif + + struct _GskVulkanImage +--- meson.build.orig 2024-08-27 18:19:59 UTC ++++ meson.build +@@ -636,7 +636,7 @@ cdata.set('HAVE_DRM_FOURCC_H', libdrm_dep.found()) + libdrm_dep = libdrm_dep.partial_dependency(includes: true, compile_args: true) + cdata.set('HAVE_DRM_FOURCC_H', libdrm_dep.found()) + +-cdata.set('HAVE_DMABUF', cc.has_header('linux/dma-buf.h')) ++cdata.set('HAVE_DMABUF', true) + + cloudproviders_dep = dependency('cloudproviders', + required: get_option('cloudproviders'),