git: 4a0ff775305d - main - multimedia/ffmpeg: speed up DRM (kmsgrab), OPENCL, VAAPI, VULKAN

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Wed, 08 Mar 2023 00:11:56 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4a0ff775305d09bc059b1dc0b95c333b29bf1197

commit 4a0ff775305d09bc059b1dc0b95c333b29bf1197
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-03-07 23:44:50 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-03-08 00:10:41 +0000

    multimedia/ffmpeg: speed up DRM (kmsgrab), OPENCL, VAAPI, VULKAN
    
    https://github.com/ffmpeg/ffmpeg/commit/993d8d94296e
---
 multimedia/ffmpeg/Makefile                         |  2 +-
 .../ffmpeg/files/patch-libavutil_hwcontext__drm.c  | 24 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile
index ddb89d4904b3..00a9897694df 100644
--- a/multimedia/ffmpeg/Makefile
+++ b/multimedia/ffmpeg/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	ffmpeg
 PORTVERSION=	4.4.3
-PORTREVISION=	5
+PORTREVISION=	6
 PORTEPOCH=	1
 CATEGORIES=	multimedia audio net
 MASTER_SITES=	https://ffmpeg.org/releases/
diff --git a/multimedia/ffmpeg/files/patch-libavutil_hwcontext__drm.c b/multimedia/ffmpeg/files/patch-libavutil_hwcontext__drm.c
new file mode 100644
index 000000000000..f5e186300975
--- /dev/null
+++ b/multimedia/ffmpeg/files/patch-libavutil_hwcontext__drm.c
@@ -0,0 +1,24 @@
+drm-kmod doesn't expose uAPI yet, so bundle like Mesa
+
+--- libavutil/hwcontext_drm.c.orig	2022-07-22 17:58:39 UTC
++++ libavutil/hwcontext_drm.c
+@@ -28,6 +28,19 @@
+ #if HAVE_LINUX_DMA_BUF_H
+ #include <linux/dma-buf.h>
+ #include <sys/ioctl.h>
++#else // BSDs
++#undef HAVE_LINUX_DMA_BUF_H
++#define HAVE_LINUX_DMA_BUF_H 1
++#include <sys/ioctl.h>
++struct dma_buf_sync {
++	uint64_t flags;
++};
++#define DMA_BUF_BASE		'b'
++#define DMA_BUF_IOCTL_SYNC	_IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
++#define DMA_BUF_SYNC_READ      (1 << 0)
++#define DMA_BUF_SYNC_WRITE     (2 << 0)
++#define DMA_BUF_SYNC_START     (0 << 2)
++#define DMA_BUF_SYNC_END       (1 << 2)
+ #endif
+ 
+ #include <drm.h>