View | Details | Raw Unified | Return to bug 273703 | Differences between
and this patch

Collapse All | Expand All

(-)b/graphics/libosmesa/Makefile (-5 / +7 lines)
Lines 8-17 WWW= https://www.mesa3d.org/ Link Here
8
LICENSE=	MIT
8
LICENSE=	MIT
9
LICENSE_FILE=	${WRKSRC}/docs/license.rst
9
LICENSE_FILE=	${WRKSRC}/docs/license.rst
10
10
11
LIB_DEPENDS+=	libLLVM-${LLVM_DEFAULT}.so:devel/llvm${LLVM_DEFAULT} \
11
LIB_DEPENDS+=	libglapi.so:graphics/mesa-libs
12
		libglapi.so:graphics/mesa-libs
13
12
14
USES=		xorg
13
USES=		llvm:lib,noexport xorg
15
USE_XORG=	xorgproto
14
USE_XORG=	xorgproto
16
USE_LDCONFIG=	yes
15
USE_LDCONFIG=	yes
17
16
Lines 19-28 USE_LDCONFIG= yes Link Here
19
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
18
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
20
19
21
# Disable some options
20
# Disable some options
22
MESON_ARGS+=	-Ddri-drivers="" \
21
MESON_ARGS+=	-Dgallium-drivers="swrast" \
23
		-Dgallium-drivers="swrast" \
24
		-Dvulkan-drivers="" \
22
		-Dvulkan-drivers="" \
25
		-Dplatforms="" \
23
		-Dplatforms="" \
24
		-Dandroid-libbacktrace=disabled \
26
		-Dgallium-vdpau=disabled \
25
		-Dgallium-vdpau=disabled \
27
		-Dgallium-omx=disabled \
26
		-Dgallium-omx=disabled \
28
		-Dgallium-va=disabled \
27
		-Dgallium-va=disabled \
Lines 31-42 MESON_ARGS+= -Ddri-drivers="" \ Link Here
31
		-Dgallium-nine=false \
30
		-Dgallium-nine=false \
32
		-Dgles1=disabled \
31
		-Dgles1=disabled \
33
		-Dgles2=disabled \
32
		-Dgles2=disabled \
33
		-Dlmsensors=disabled \
34
		-Dmicrosoft-clc=disabled \
34
		-Dmicrosoft-clc=disabled \
35
		-Dopengl=true \
35
		-Dopengl=true \
36
		-Dglx=disabled \
36
		-Dglx=disabled \
37
		-Degl=disabled \
37
		-Degl=disabled \
38
		-Dgbm=disabled \
38
		-Dgbm=disabled \
39
		-Dtools="" \
39
		-Dtools="" \
40
		-Dvalgrind=disabled \
41
		-Dxlib-lease=disabled \
40
		-Dzstd=disabled
42
		-Dzstd=disabled
41
LDFLAGS_i386=		-Wl,-znotext
43
LDFLAGS_i386=		-Wl,-znotext
42
44
(-)b/graphics/mesa-dri/Makefile (-5 / +8 lines)
Lines 1-13 Link Here
1
PORTNAME=	mesa-dri
1
PORTNAME=	mesa-dri
2
PORTVERSION=	${MESAVERSION}
2
PORTVERSION=	${MESAVERSION}
3
PORTREVISION=	3
4
CATEGORIES=	graphics
3
CATEGORIES=	graphics
5
4
6
COMMENT=	OpenGL hardware acceleration drivers for DRI2+
5
COMMENT=	OpenGL hardware acceleration drivers for DRI2+
7
WWW=		https://www.mesa3d.org/
6
WWW=		https://www.mesa3d.org/
8
7
9
LIB_DEPENDS+=	libLLVM-${LLVM_DEFAULT}.so:devel/llvm${LLVM_DEFAULT} \
8
LIB_DEPENDS+=	libglapi.so:graphics/mesa-libs
10
		libglapi.so:graphics/mesa-libs
9
10
USES+=		llvm:lib,noexport
11
11
12
OPTIONS_GROUP=			PLATFORM
12
OPTIONS_GROUP=			PLATFORM
13
OPTIONS_GROUP_PLATFORM=		PLATFORM_X11 PLATFORM_WAYLAND
13
OPTIONS_GROUP_PLATFORM=		PLATFORM_X11 PLATFORM_WAYLAND
Lines 73-86 MESON_ARGS+= -Dgallium-drivers="${GALLIUM_DRIVERS:ts,:tl}" \ Link Here
73
		-Dplatforms="${MESA_PLATFORMS:ts,:tl}"
73
		-Dplatforms="${MESA_PLATFORMS:ts,:tl}"
74
74
75
# Disable some options
75
# Disable some options
76
MESON_ARGS+=	-Dgallium-xa=disabled \
76
MESON_ARGS+=	-Dandroid-libbacktrace=disabled \
77
		-Dgallium-xa=disabled \
77
		-Dgallium-vdpau=disabled \
78
		-Dgallium-vdpau=disabled \
78
		-Dgallium-va=disabled \
79
		-Dgallium-va=disabled \
79
		-Dgles1=disabled \
80
		-Dgles1=disabled \
80
		-Dgles2=disabled \
81
		-Dgles2=disabled \
81
		-Dglx=disabled \
82
		-Dglx=disabled \
83
		-Dlmsensors=disabled \
82
		-Dmicrosoft-clc=disabled \
84
		-Dmicrosoft-clc=disabled \
83
		-Dosmesa=false
85
		-Dosmesa=false \
86
		-Dvalgrind=disabled
84
87
85
.for _gd in ${ALL_GALLIUM_DRIVERS}
88
.for _gd in ${ALL_GALLIUM_DRIVERS}
86
. if defined(GALLIUM_DRIVERS) && ${GALLIUM_DRIVERS:M${_gd}}
89
. if defined(GALLIUM_DRIVERS) && ${GALLIUM_DRIVERS:M${_gd}}
(-)b/graphics/mesa-dri/Makefile.common (-6 / +4 lines)
Lines 12-18 Link Here
12
MESAVERSION=	${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
12
MESAVERSION=	${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
13
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
13
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
14
14
15
MESABASEVERSION=	22.3.7
15
MESABASEVERSION=	23.1.7
16
# if there is a subversion, don't include the '-' between 7.11-rc2.
16
# if there is a subversion, don't include the '-' between 7.11-rc2.
17
MESASUBVERSION=
17
MESASUBVERSION=
18
18
Lines 47-53 LIB_DEPENDS+= libunwind.so:devel/libunwind Link Here
47
LIB_DEPENDS+=	libelf.so:devel/libelf
47
LIB_DEPENDS+=	libelf.so:devel/libelf
48
.endif
48
.endif
49
49
50
USES+=		compiler:c++11-lib bison meson pathfix pkgconfig \
50
USES+=		compiler:c++11-lib bison llvm:noexport meson pathfix pkgconfig \
51
		python:build shebangfix tar:xz
51
		python:build shebangfix tar:xz
52
52
53
.if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld
53
.if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld
Lines 82-90 PKGDEINSTALL= ${.CURDIR}/pkg-deinstall Link Here
82
82
83
BINARY_ALIAS+=	python3=${PYTHON_VERSION}
83
BINARY_ALIAS+=	python3=${PYTHON_VERSION}
84
84
85
LLVM_DEFAULT=	15
85
CONFIGURE_ENV+=	LLVM_CONFIG=llvm-config${LLVM_VERSION}
86
BUILD_DEPENDS+=	llvm-config${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT}
87
CONFIGURE_ENV+=	LLVM_CONFIG=llvm-config${LLVM_DEFAULT}
88
86
89
LDFLAGS+=	-Wl,-rpath=${LOCALBASE}/llvm${LLVM_DEFAULT}/lib
87
LDFLAGS+=	-Wl,-rpath=${LOCALBASE}/llvm${LLVM_VERSION}/lib
90
MESON_ARGS+=	-Dllvm=enabled
88
MESON_ARGS+=	-Dllvm=enabled
(-)b/graphics/mesa-dri/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1678348804
1
TIMESTAMP = 1694273655
2
SHA256 (mesa-22.3.7.tar.xz) = 894ce2f4a1c2e76177cdd2284620192d0da3066b243eec2fbb1d7cf37f13042c
2
SHA256 (mesa-23.1.7.tar.xz) = 409641eadf0ed1c7794797a6f5a0b0195b5580b282166e5ec5629c6bcda6acd3
3
SIZE (mesa-22.3.7.tar.xz) = 17136476
3
SIZE (mesa-23.1.7.tar.xz) = 18544916
(-)a/graphics/mesa-dri/files/patch-include_drm-uapi_dma-buf.h (-198 lines)
Removed Link Here
1
--- include/drm-uapi/dma-buf.h.orig	2022-10-14 14:21:26 UTC
2
+++ include/drm-uapi/dma-buf.h
3
@@ -0,0 +1,195 @@
4
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
5
+/*
6
+ * Framework for buffer objects that can be shared across devices/subsystems.
7
+ *
8
+ * Copyright(C) 2015 Intel Ltd
9
+ *
10
+ * This program is free software; you can redistribute it and/or modify it
11
+ * under the terms of the GNU General Public License version 2 as published by
12
+ * the Free Software Foundation.
13
+ *
14
+ * This program is distributed in the hope that it will be useful, but WITHOUT
15
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
17
+ * more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License along with
20
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+
23
+#ifndef _DMA_BUF_UAPI_H_
24
+#define _DMA_BUF_UAPI_H_
25
+
26
+#ifdef __linux__
27
+#include <linux/types.h>
28
+#else
29
+#include <sys/types.h>
30
+
31
+typedef int8_t   __s8;
32
+typedef uint8_t  __u8;
33
+typedef int16_t  __s16;
34
+typedef uint16_t __u16;
35
+typedef int32_t  __s32;
36
+typedef uint32_t __u32;
37
+typedef int64_t  __s64;
38
+typedef uint64_t __u64;
39
+#endif
40
+
41
+/**
42
+ * struct dma_buf_sync - Synchronize with CPU access.
43
+ *
44
+ * When a DMA buffer is accessed from the CPU via mmap, it is not always
45
+ * possible to guarantee coherency between the CPU-visible map and underlying
46
+ * memory.  To manage coherency, DMA_BUF_IOCTL_SYNC must be used to bracket
47
+ * any CPU access to give the kernel the chance to shuffle memory around if
48
+ * needed.
49
+ *
50
+ * Prior to accessing the map, the client must call DMA_BUF_IOCTL_SYNC
51
+ * with DMA_BUF_SYNC_START and the appropriate read/write flags.  Once the
52
+ * access is complete, the client should call DMA_BUF_IOCTL_SYNC with
53
+ * DMA_BUF_SYNC_END and the same read/write flags.
54
+ *
55
+ * The synchronization provided via DMA_BUF_IOCTL_SYNC only provides cache
56
+ * coherency.  It does not prevent other processes or devices from
57
+ * accessing the memory at the same time.  If synchronization with a GPU or
58
+ * other device driver is required, it is the client's responsibility to
59
+ * wait for buffer to be ready for reading or writing before calling this
60
+ * ioctl with DMA_BUF_SYNC_START.  Likewise, the client must ensure that
61
+ * follow-up work is not submitted to GPU or other device driver until
62
+ * after this ioctl has been called with DMA_BUF_SYNC_END?
63
+ *
64
+ * If the driver or API with which the client is interacting uses implicit
65
+ * synchronization, waiting for prior work to complete can be done via
66
+ * poll() on the DMA buffer file descriptor.  If the driver or API requires
67
+ * explicit synchronization, the client may have to wait on a sync_file or
68
+ * other synchronization primitive outside the scope of the DMA buffer API.
69
+ */
70
+struct dma_buf_sync {
71
+	/**
72
+	 * @flags: Set of access flags
73
+	 *
74
+	 * DMA_BUF_SYNC_START:
75
+	 *     Indicates the start of a map access session.
76
+	 *
77
+	 * DMA_BUF_SYNC_END:
78
+	 *     Indicates the end of a map access session.
79
+	 *
80
+	 * DMA_BUF_SYNC_READ:
81
+	 *     Indicates that the mapped DMA buffer will be read by the
82
+	 *     client via the CPU map.
83
+	 *
84
+	 * DMA_BUF_SYNC_WRITE:
85
+	 *     Indicates that the mapped DMA buffer will be written by the
86
+	 *     client via the CPU map.
87
+	 *
88
+	 * DMA_BUF_SYNC_RW:
89
+	 *     An alias for DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE.
90
+	 */
91
+	__u64 flags;
92
+};
93
+
94
+#define DMA_BUF_SYNC_READ      (1 << 0)
95
+#define DMA_BUF_SYNC_WRITE     (2 << 0)
96
+#define DMA_BUF_SYNC_RW        (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
97
+#define DMA_BUF_SYNC_START     (0 << 2)
98
+#define DMA_BUF_SYNC_END       (1 << 2)
99
+#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
100
+	(DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
101
+
102
+#define DMA_BUF_NAME_LEN	32
103
+
104
+/**
105
+ * struct dma_buf_export_sync_file - Get a sync_file from a dma-buf
106
+ *
107
+ * Userspace can perform a DMA_BUF_IOCTL_EXPORT_SYNC_FILE to retrieve the
108
+ * current set of fences on a dma-buf file descriptor as a sync_file.  CPU
109
+ * waits via poll() or other driver-specific mechanisms typically wait on
110
+ * whatever fences are on the dma-buf at the time the wait begins.  This
111
+ * is similar except that it takes a snapshot of the current fences on the
112
+ * dma-buf for waiting later instead of waiting immediately.  This is
113
+ * useful for modern graphics APIs such as Vulkan which assume an explicit
114
+ * synchronization model but still need to inter-operate with dma-buf.
115
+ *
116
+ * The intended usage pattern is the following:
117
+ *
118
+ *  1. Export a sync_file with flags corresponding to the expected GPU usage
119
+ *     via DMA_BUF_IOCTL_EXPORT_SYNC_FILE.
120
+ *
121
+ *  2. Submit rendering work which uses the dma-buf.  The work should wait on
122
+ *     the exported sync file before rendering and produce another sync_file
123
+ *     when complete.
124
+ *
125
+ *  3. Import the rendering-complete sync_file into the dma-buf with flags
126
+ *     corresponding to the GPU usage via DMA_BUF_IOCTL_IMPORT_SYNC_FILE.
127
+ *
128
+ * Unlike doing implicit synchronization via a GPU kernel driver's exec ioctl,
129
+ * the above is not a single atomic operation.  If userspace wants to ensure
130
+ * ordering via these fences, it is the respnosibility of userspace to use
131
+ * locks or other mechanisms to ensure that no other context adds fences or
132
+ * submits work between steps 1 and 3 above.
133
+ */
134
+struct dma_buf_export_sync_file {
135
+	/**
136
+	 * @flags: Read/write flags
137
+	 *
138
+	 * Must be DMA_BUF_SYNC_READ, DMA_BUF_SYNC_WRITE, or both.
139
+	 *
140
+	 * If DMA_BUF_SYNC_READ is set and DMA_BUF_SYNC_WRITE is not set,
141
+	 * the returned sync file waits on any writers of the dma-buf to
142
+	 * complete.  Waiting on the returned sync file is equivalent to
143
+	 * poll() with POLLIN.
144
+	 *
145
+	 * If DMA_BUF_SYNC_WRITE is set, the returned sync file waits on
146
+	 * any users of the dma-buf (read or write) to complete.  Waiting
147
+	 * on the returned sync file is equivalent to poll() with POLLOUT.
148
+	 * If both DMA_BUF_SYNC_WRITE and DMA_BUF_SYNC_READ are set, this
149
+	 * is equivalent to just DMA_BUF_SYNC_WRITE.
150
+	 */
151
+	__u32 flags;
152
+	/** @fd: Returned sync file descriptor */
153
+	__s32 fd;
154
+};
155
+
156
+/**
157
+ * struct dma_buf_import_sync_file - Insert a sync_file into a dma-buf
158
+ *
159
+ * Userspace can perform a DMA_BUF_IOCTL_IMPORT_SYNC_FILE to insert a
160
+ * sync_file into a dma-buf for the purposes of implicit synchronization
161
+ * with other dma-buf consumers.  This allows clients using explicitly
162
+ * synchronized APIs such as Vulkan to inter-op with dma-buf consumers
163
+ * which expect implicit synchronization such as OpenGL or most media
164
+ * drivers/video.
165
+ */
166
+struct dma_buf_import_sync_file {
167
+	/**
168
+	 * @flags: Read/write flags
169
+	 *
170
+	 * Must be DMA_BUF_SYNC_READ, DMA_BUF_SYNC_WRITE, or both.
171
+	 *
172
+	 * If DMA_BUF_SYNC_READ is set and DMA_BUF_SYNC_WRITE is not set,
173
+	 * this inserts the sync_file as a read-only fence.  Any subsequent
174
+	 * implicitly synchronized writes to this dma-buf will wait on this
175
+	 * fence but reads will not.
176
+	 *
177
+	 * If DMA_BUF_SYNC_WRITE is set, this inserts the sync_file as a
178
+	 * write fence.  All subsequent implicitly synchronized access to
179
+	 * this dma-buf will wait on this fence.
180
+	 */
181
+	__u32 flags;
182
+	/** @fd: Sync file descriptor */
183
+	__s32 fd;
184
+};
185
+
186
+#define DMA_BUF_BASE		'b'
187
+#define DMA_BUF_IOCTL_SYNC	_IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
188
+
189
+/* 32/64bitness of this uapi was botched in android, there's no difference
190
+ * between them in actual uapi, they're just different numbers.
191
+ */
192
+#define DMA_BUF_SET_NAME	_IOW(DMA_BUF_BASE, 1, const char *)
193
+#define DMA_BUF_SET_NAME_A	_IOW(DMA_BUF_BASE, 1, u32)
194
+#define DMA_BUF_SET_NAME_B	_IOW(DMA_BUF_BASE, 1, u64)
195
+#define DMA_BUF_IOCTL_EXPORT_SYNC_FILE	_IOWR(DMA_BUF_BASE, 2, struct dma_buf_export_sync_file)
196
+#define DMA_BUF_IOCTL_IMPORT_SYNC_FILE	_IOW(DMA_BUF_BASE, 3, struct dma_buf_import_sync_file)
197
+
198
+#endif
(-)a/graphics/mesa-dri/files/patch-src_gallium_include_pipe_p__compiler.h (-11 lines)
Removed Link Here
1
--- src/gallium/include/pipe/p_compiler.h.orig	2022-10-11 18:53:31 UTC
2
+++ src/gallium/include/pipe/p_compiler.h
3
@@ -125,7 +125,7 @@ typedef unsigned char boolean;
4
  *       aligned, but we only want to align the field.
5
  */
6
 #define EXCLUSIVE_CACHELINE(decl) \
7
-   union { char __cl_space[CACHE_LINE_SIZE]; \
8
+   union { char __cl_space[MESA_CACHE_LINE_SIZE]; \
9
            decl; }
10
 
11
 #if defined(__cplusplus)
(-)a/graphics/mesa-dri/files/patch-src_util_macros.h (-11 lines)
Removed Link Here
1
--- src/util/macros.h.orig	2022-10-11 18:53:31 UTC
2
+++ src/util/macros.h
3
@@ -448,7 +448,7 @@ typedef int lock_cap_t;
4
 #endif
5
 
6
 /* TODO: this could be different on non-x86 architectures. */
7
-#define CACHE_LINE_SIZE 64
8
+#define MESA_CACHE_LINE_SIZE 64
9
 
10
 #define DO_PRAGMA(X) _Pragma (#X)
11
 
(-)b/graphics/mesa-dri/files/patch-src_util_u__memory.h (-2 / +16 lines)
Lines 1-7 Link Here
1
--- src/util/u_memory.h.orig	2022-12-01 11:58:25 UTC
1
--- src/util/u_memory.h.orig	2023-09-06 23:29:52 UTC
2
+++ src/util/u_memory.h
2
+++ src/util/u_memory.h
3
@@ -91,8 +91,8 @@ mem_dup(const void *src, size_t size)
3
@@ -90,7 +90,7 @@ mem_dup(const void *src, size_t size)
4
 #define Offset(TYPE, MEMBER) ((uintptr_t)&(((TYPE *)NULL)->MEMBER))
4
 
5
 
6
 /* TODO: this could be different on non-x86 architectures. */
7
-#define CACHE_LINE_SIZE 64
8
+#define MESA_CACHE_LINE_SIZE 64
9
 
10
 /**
11
  * Declare a variable on its own cache line.
12
@@ -107,12 +107,12 @@ mem_dup(const void *src, size_t size)
13
  *       aligned, but we only want to align the field.
14
  */
15
 #define EXCLUSIVE_CACHELINE(decl) \
16
-   union { char __cl_space[CACHE_LINE_SIZE]; \
17
+   union { char __cl_space[MESA_CACHE_LINE_SIZE]; \
18
            decl; }
5
 
19
 
6
 /* Allocate a structure aligned to a cache line. (used to make atomic ops faster) */
20
 /* Allocate a structure aligned to a cache line. (used to make atomic ops faster) */
7
-#define MALLOC_STRUCT_CL(T) (struct T *)align_malloc(sizeof(struct T), CACHE_LINE_SIZE)
21
-#define MALLOC_STRUCT_CL(T) (struct T *)align_malloc(sizeof(struct T), CACHE_LINE_SIZE)
(-)a/graphics/mesa-dri/files/patch-src_vulkan_wsi_wsi__common__drm.c (-61 lines)
Removed Link Here
1
--- src/vulkan/wsi/wsi_common_drm.c.orig	2022-10-11 18:53:31 UTC
2
+++ src/vulkan/wsi/wsi_common_drm.c
3
@@ -30,29 +30,15 @@
4
 #include "vk_physical_device.h"
5
 #include "vk_util.h"
6
 #include "drm-uapi/drm_fourcc.h"
7
+#include "drm-uapi/dma-buf.h"
8
 
9
 #include <errno.h>
10
-#include <linux/dma-buf.h>
11
-#include <linux/sync_file.h>
12
 #include <time.h>
13
 #include <unistd.h>
14
 #include <stdlib.h>
15
 #include <stdio.h>
16
 #include <xf86drm.h>
17
 
18
-struct dma_buf_export_sync_file_wsi {
19
-   __u32 flags;
20
-   __s32 fd;
21
-};
22
-
23
-struct dma_buf_import_sync_file_wsi {
24
-   __u32 flags;
25
-   __s32 fd;
26
-};
27
-
28
-#define DMA_BUF_IOCTL_EXPORT_SYNC_FILE_WSI   _IOWR(DMA_BUF_BASE, 2, struct dma_buf_export_sync_file_wsi)
29
-#define DMA_BUF_IOCTL_IMPORT_SYNC_FILE_WSI   _IOW(DMA_BUF_BASE, 3, struct dma_buf_import_sync_file_wsi)
30
-
31
 static VkResult
32
 wsi_dma_buf_export_sync_file(int dma_buf_fd, int *sync_file_fd)
33
 {
34
@@ -61,11 +47,11 @@ wsi_dma_buf_export_sync_file(int dma_buf_fd, int *sync
35
    if (no_dma_buf_sync_file)
36
       return VK_ERROR_FEATURE_NOT_PRESENT;
37
 
38
-   struct dma_buf_export_sync_file_wsi export = {
39
+   struct dma_buf_export_sync_file export = {
40
       .flags = DMA_BUF_SYNC_RW,
41
       .fd = -1,
42
    };
43
-   int ret = drmIoctl(dma_buf_fd, DMA_BUF_IOCTL_EXPORT_SYNC_FILE_WSI, &export);
44
+   int ret = drmIoctl(dma_buf_fd, DMA_BUF_IOCTL_EXPORT_SYNC_FILE, &export);
45
    if (ret) {
46
       if (errno == ENOTTY || errno == EBADF || errno == ENOSYS) {
47
          no_dma_buf_sync_file = true;
48
@@ -88,11 +74,11 @@ wsi_dma_buf_import_sync_file(int dma_buf_fd, int sync_
49
    if (no_dma_buf_sync_file)
50
       return VK_ERROR_FEATURE_NOT_PRESENT;
51
 
52
-   struct dma_buf_import_sync_file_wsi import = {
53
+   struct dma_buf_import_sync_file import = {
54
       .flags = DMA_BUF_SYNC_RW,
55
       .fd = sync_file_fd,
56
    };
57
-   int ret = drmIoctl(dma_buf_fd, DMA_BUF_IOCTL_IMPORT_SYNC_FILE_WSI, &import);
58
+   int ret = drmIoctl(dma_buf_fd, DMA_BUF_IOCTL_IMPORT_SYNC_FILE, &import);
59
    if (ret) {
60
       if (errno == ENOTTY || errno == EBADF || errno == ENOSYS) {
61
          no_dma_buf_sync_file = true;
(-)a/graphics/mesa-dri/files/patch-wayland-1.22 (-44 lines)
Removed Link Here
1
https://gitlab.freedesktop.org/mesa/mesa/-/commit/ee5d2250fd15
2
https://gitlab.freedesktop.org/mesa/mesa/-/commit/689ce66a4332
3
4
--- src/egl/drivers/dri2/platform_wayland.c.orig	2023-03-08 18:37:09 UTC
5
+++ src/egl/drivers/dri2/platform_wayland.c
6
@@ -2789,10 +2789,10 @@ dri2_teardown_wayland(struct dri2_egl_display *dri2_dp
7
       wl_shm_destroy(dri2_dpy->wl_shm);
8
    if (dri2_dpy->wl_registry)
9
       wl_registry_destroy(dri2_dpy->wl_registry);
10
-   if (dri2_dpy->wl_queue)
11
-      wl_event_queue_destroy(dri2_dpy->wl_queue);
12
    if (dri2_dpy->wl_dpy_wrapper)
13
       wl_proxy_wrapper_destroy(dri2_dpy->wl_dpy_wrapper);
14
+   if (dri2_dpy->wl_queue)
15
+      wl_event_queue_destroy(dri2_dpy->wl_queue);
16
 
17
    if (dri2_dpy->own_device)
18
       wl_display_disconnect(dri2_dpy->wl_dpy);
19
--- src/vulkan/wsi/wsi_common_wayland.c.orig	2023-03-08 18:37:09 UTC
20
+++ src/vulkan/wsi/wsi_common_wayland.c
21
@@ -1156,17 +1156,17 @@ wsi_wl_surface_destroy(VkIcdSurfaceBase *icd_surface, 
22
    struct wsi_wl_surface *wsi_wl_surface =
23
       wl_container_of((VkIcdSurfaceWayland *)icd_surface, wsi_wl_surface, base);
24
 
25
-   if (wsi_wl_surface->surface)
26
-      wl_proxy_wrapper_destroy(wsi_wl_surface->surface);
27
-
28
-   if (wsi_wl_surface->display)
29
-      wsi_wl_display_destroy(wsi_wl_surface->display);
30
-
31
    if (wsi_wl_surface->wl_dmabuf_feedback) {
32
       zwp_linux_dmabuf_feedback_v1_destroy(wsi_wl_surface->wl_dmabuf_feedback);
33
       dmabuf_feedback_fini(&wsi_wl_surface->dmabuf_feedback);
34
       dmabuf_feedback_fini(&wsi_wl_surface->pending_dmabuf_feedback);
35
    }
36
+
37
+   if (wsi_wl_surface->surface)
38
+      wl_proxy_wrapper_destroy(wsi_wl_surface->surface);
39
+
40
+   if (wsi_wl_surface->display)
41
+      wsi_wl_display_destroy(wsi_wl_surface->display);
42
 
43
    vk_free2(&instance->alloc, pAllocator, wsi_wl_surface);
44
 }
(-)b/graphics/mesa-gallium-va/Makefile (-3 / +6 lines)
Lines 12-20 ONLY_FOR_ARCHS= aarch64 amd64 i386 powerpc64 powerpc64le Link Here
12
ONLY_FOR_ARCHS_REASON=	used only by AMD/Radeon hardware
12
ONLY_FOR_ARCHS_REASON=	used only by AMD/Radeon hardware
13
13
14
LIB_DEPENDS=	libva.so:multimedia/libva \
14
LIB_DEPENDS=	libva.so:multimedia/libva \
15
		libLLVM-${LLVM_DEFAULT}.so:devel/llvm${LLVM_DEFAULT} \
16
		libzstd.so:archivers/zstd
15
		libzstd.so:archivers/zstd
17
16
17
USES=		llvm:lib,noexport
18
18
OPTIONS_DEFINE=		X11
19
OPTIONS_DEFINE=		X11
19
OPTIONS_DEFAULT=	X11
20
OPTIONS_DEFAULT=	X11
20
X11_DESC=		Enable X11 support
21
X11_DESC=		Enable X11 support
Lines 24-33 X11_USE= xorg=xorgproto,x11,xcb,xdamage,xext,xfixes,xshmfence,xxf86vm,xrandr Link Here
24
.include <bsd.port.options.mk>
25
.include <bsd.port.options.mk>
25
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
26
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
26
27
27
MESON_ARGS+=	-Ddri-drivers="" \
28
MESON_ARGS+=	-Dvideo-codecs="vc1dec,h264dec,h264enc,h265dec,h265enc" \
28
		-Dvideo-codecs="vc1dec,h264dec,h264enc,h265dec,h265enc" \
29
		-Dgallium-drivers="radeonsi,r600" \
29
		-Dgallium-drivers="radeonsi,r600" \
30
		-Dvulkan-drivers="" \
30
		-Dvulkan-drivers="" \
31
		-Dandroid-libbacktrace=disabled \
31
		-Dgallium-vdpau=disabled \
32
		-Dgallium-vdpau=disabled \
32
		-Dgallium-omx=disabled \
33
		-Dgallium-omx=disabled \
33
		-Dgallium-xa=disabled \
34
		-Dgallium-xa=disabled \
Lines 36-43 MESON_ARGS+= -Ddri-drivers="" \ Link Here
36
		-Dgbm=disabled \
37
		-Dgbm=disabled \
37
		-Dgles1=disabled \
38
		-Dgles1=disabled \
38
		-Dgles2=disabled \
39
		-Dgles2=disabled \
40
		-Dlmsensors=disabled \
39
		-Dmicrosoft-clc=disabled \
41
		-Dmicrosoft-clc=disabled \
40
		-Dosmesa=false \
42
		-Dosmesa=false \
43
		-Dvalgrind=disabled \
41
		-Dglx=disabled \
44
		-Dglx=disabled \
42
		-Ddri3=enabled
45
		-Ddri3=enabled
43
46
(-)b/graphics/mesa-gallium-vdpau/Makefile (-3 / +6 lines)
Lines 12-21 ONLY_FOR_ARCHS= aarch64 amd64 i386 powerpc64 powerpc64le Link Here
12
ONLY_FOR_ARCHS_REASON=	used only by AMD/Radeon hardware
12
ONLY_FOR_ARCHS_REASON=	used only by AMD/Radeon hardware
13
13
14
LIB_DEPENDS=	libva.so:multimedia/libva \
14
LIB_DEPENDS=	libva.so:multimedia/libva \
15
		libLLVM-${LLVM_DEFAULT}.so:devel/llvm${LLVM_DEFAULT} \
16
		libvdpau.so:multimedia/libvdpau \
15
		libvdpau.so:multimedia/libvdpau \
17
		libzstd.so:archivers/zstd
16
		libzstd.so:archivers/zstd
18
17
18
USES=		llvm:lib,noexport
19
19
OPTIONS_DEFINE=		X11
20
OPTIONS_DEFINE=		X11
20
OPTIONS_DEFAULT=	X11
21
OPTIONS_DEFAULT=	X11
21
X11_DESC=		Enable X11 support
22
X11_DESC=		Enable X11 support
Lines 25-33 X11_USE= xorg=xorgproto,x11,xcb,xdamage,xext,xfixes,xshmfence,xxf86vm,xrandr Link Here
25
.include <bsd.port.options.mk>
26
.include <bsd.port.options.mk>
26
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
27
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
27
28
28
MESON_ARGS+=	-Ddri-drivers="" \
29
MESON_ARGS+=	-Dgallium-drivers="r300,r600,radeonsi" \
29
		-Dgallium-drivers="r300,r600,radeonsi" \
30
		-Dvulkan-drivers="" \
30
		-Dvulkan-drivers="" \
31
		-Dandroid-libbacktrace=disabled \
31
		-Dgallium-va=disabled \
32
		-Dgallium-va=disabled \
32
		-Dgallium-omx=disabled \
33
		-Dgallium-omx=disabled \
33
		-Dgallium-xa=disabled \
34
		-Dgallium-xa=disabled \
Lines 36-43 MESON_ARGS+= -Ddri-drivers="" \ Link Here
36
		-Dgbm=disabled \
37
		-Dgbm=disabled \
37
		-Dgles1=disabled \
38
		-Dgles1=disabled \
38
		-Dgles2=disabled \
39
		-Dgles2=disabled \
40
		-Dlmsensors=disabled \
39
		-Dmicrosoft-clc=disabled \
41
		-Dmicrosoft-clc=disabled \
40
		-Dosmesa=false \
42
		-Dosmesa=false \
43
		-Dvalgrind=disabled \
41
		-Dglx=disabled \
44
		-Dglx=disabled \
42
		-Ddri3=enabled
45
		-Ddri3=enabled
43
46
(-)b/graphics/mesa-gallium-vdpau/pkg-plist (-4 lines)
Lines 19-28 Link Here
19
@comment lib/libglapi.so
19
@comment lib/libglapi.so
20
@comment lib/libglapi.so.0
20
@comment lib/libglapi.so.0
21
@comment lib/libglapi.so.0.0.0
21
@comment lib/libglapi.so.0.0.0
22
lib/vdpau/libvdpau_r300.so
23
lib/vdpau/libvdpau_r300.so.1
24
lib/vdpau/libvdpau_r300.so.1.0
25
lib/vdpau/libvdpau_r300.so.1.0.0
26
lib/vdpau/libvdpau_r600.so
22
lib/vdpau/libvdpau_r600.so
27
lib/vdpau/libvdpau_r600.so.1
23
lib/vdpau/libvdpau_r600.so.1
28
lib/vdpau/libvdpau_r600.so.1.0
24
lib/vdpau/libvdpau_r600.so.1.0
(-)b/graphics/mesa-gallium-xa/Makefile (-6 / +7 lines)
Lines 11-28 LICENSE_FILE= ${WRKSRC}/docs/license.rst Link Here
11
ONLY_FOR_ARCHS=		amd64 i386
11
ONLY_FOR_ARCHS=		amd64 i386
12
ONLY_FOR_ARCHS_REASON=	used only by VMware supported architectures
12
ONLY_FOR_ARCHS_REASON=	used only by VMware supported architectures
13
13
14
LIB_DEPENDS=	libLLVM-${LLVM_DEFAULT}.so:devel/llvm${LLVM_DEFAULT}
14
USES=		llvm:lib,noexport xorg
15
16
USES=		xorg
17
USE_XORG=	xorgproto
15
USE_XORG=	xorgproto
18
16
19
.include <bsd.port.options.mk>
17
.include <bsd.port.options.mk>
20
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
18
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
21
19
22
MESON_ARGS+=	-Ddri-drivers="" \
20
MESON_ARGS+=	-Dgallium-drivers="svga" \
23
		-Dgallium-drivers="svga" \
24
		-Dvulkan-drivers="" \
21
		-Dvulkan-drivers="" \
25
		-Dplatforms="" \
22
		-Dplatforms="" \
23
		-Dandroid-libbacktrace=disabled \
26
		-Dgallium-vdpau=disabled \
24
		-Dgallium-vdpau=disabled \
27
		-Dgallium-omx=disabled \
25
		-Dgallium-omx=disabled \
28
		-Dgallium-va=disabled \
26
		-Dgallium-va=disabled \
Lines 33-42 MESON_ARGS+= -Ddri-drivers="" \ Link Here
33
		-Dgles1=disabled \
31
		-Dgles1=disabled \
34
		-Dgles2=disabled \
32
		-Dgles2=disabled \
35
		-Dglx=disabled \
33
		-Dglx=disabled \
34
		-Dlmsensors=disabled \
36
		-Dmicrosoft-clc=disabled \
35
		-Dmicrosoft-clc=disabled \
37
		-Dopengl=false \
36
		-Dopengl=false \
38
		-Dshared-glapi=disabled \
37
		-Dshared-glapi=disabled \
39
		-Dosmesa=false
38
		-Dosmesa=false \
39
		-Dvalgrind=disabled \
40
		-Dxlib-lease=disabled
40
41
41
LDFLAGS_i386=		-Wl,-znotext
42
LDFLAGS_i386=		-Wl,-znotext
42
43
(-)b/graphics/mesa-libs/Makefile (-2 / +4 lines)
Lines 1-6 Link Here
1
PORTNAME=	mesa-libs
1
PORTNAME=	mesa-libs
2
PORTVERSION=	${MESAVERSION}
2
PORTVERSION=	${MESAVERSION}
3
PORTREVISION=	2
4
CATEGORIES=	graphics
3
CATEGORIES=	graphics
5
4
6
COMMENT=	OpenGL libraries that support GLX and EGL clients
5
COMMENT=	OpenGL libraries that support GLX and EGL clients
Lines 35-48 USE_LDCONFIG= yes Link Here
35
.include <bsd.port.options.mk>
34
.include <bsd.port.options.mk>
36
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
35
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
37
36
38
MESON_ARGS+=	-Dgallium-vdpau=disabled \
37
MESON_ARGS+=	-Dandroid-libbacktrace=disabled \
38
		-Dgallium-vdpau=disabled \
39
		-Dgallium-omx=disabled \
39
		-Dgallium-omx=disabled \
40
		-Dgallium-va=disabled \
40
		-Dgallium-va=disabled \
41
		-Dgallium-xa=disabled \
41
		-Dgallium-xa=disabled \
42
		-Dgallium-nine=false \
42
		-Dgallium-nine=false \
43
		-Dlmsensors=disabled \
43
		-Dmicrosoft-clc=disabled \
44
		-Dmicrosoft-clc=disabled \
44
		-Dosmesa=false \
45
		-Dosmesa=false \
45
		-Dtools="" \
46
		-Dtools="" \
47
		-Dvalgrind=disabled \
46
		-Degl=enabled \
48
		-Degl=enabled \
47
		-Dgbm=enabled \
49
		-Dgbm=enabled \
48
		-Dvulkan-drivers="" \
50
		-Dvulkan-drivers="" \
(-)b/lang/clover/Makefile (-7 / +10 lines)
Lines 14-30 ONLY_FOR_ARCHS_REASON= needs a GPU supported by the Radeon KMS driver Link Here
14
BUILD_DEPENDS=	libclc>=0.3.0:devel/libclc \
14
BUILD_DEPENDS=	libclc>=0.3.0:devel/libclc \
15
		opencl>=0:devel/opencl
15
		opencl>=0:devel/opencl
16
LIB_DEPENDS=	libOpenCL.so:devel/ocl-icd \
16
LIB_DEPENDS=	libOpenCL.so:devel/ocl-icd \
17
		libLLVM-${LLVM_DEFAULT}.so:devel/llvm${LLVM_DEFAULT} \
18
		libzstd.so:archivers/zstd
17
		libzstd.so:archivers/zstd
19
RUN_DEPENDS=	libclc>=0.3.0:devel/libclc \
18
RUN_DEPENDS=	libclc>=0.3.0:devel/libclc \
20
		opencl>=0:devel/opencl
19
		opencl>=0:devel/opencl
21
20
21
USES=		llvm:lib,noexport
22
22
.include <bsd.port.options.mk>
23
.include <bsd.port.options.mk>
23
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
24
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
24
25
25
MESON_ARGS+=	-Ddri-drivers="" \
26
MESON_ARGS+=	-Dplatforms="" \
26
		-Dplatforms="" \
27
		-Dvulkan-drivers="" \
27
		-Dvulkan-drivers="" \
28
		-Dandroid-libbacktrace=disabled \
28
		-Dgallium-nine=false \
29
		-Dgallium-nine=false \
29
		-Dgallium-omx=disabled \
30
		-Dgallium-omx=disabled \
30
		-Dgallium-opencl=disabled \
31
		-Dgallium-opencl=disabled \
Lines 39-44 MESON_ARGS+= -Ddri-drivers="" \ Link Here
39
		-Degl=disabled \
40
		-Degl=disabled \
40
		-Dgbm=disabled \
41
		-Dgbm=disabled \
41
		-Dtools="" \
42
		-Dtools="" \
43
		-Dxlib-lease=disabled \
44
		-Dlmsensors=disabled \
45
		-Dvalgrind=disabled \
42
		-Dgallium-opencl=icd \
46
		-Dgallium-opencl=icd \
43
		-Dgallium-drivers=r600,radeonsi
47
		-Dgallium-drivers=r600,radeonsi
44
48
Lines 47-55 LDFLAGS_i386= -Wl,-znotext Link Here
47
.include "${MASTERDIR}/Makefile.targets"
51
.include "${MASTERDIR}/Makefile.targets"
48
52
49
pre-patch:
53
pre-patch:
50
	@if [ -e ${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT} ] && \
54
	@if [ -e ${LOCALBASE}/bin/llvm-config${LLVM_VERSION} ] && \
51
		! [ -e ${LOCALBASE}/bin/clang${LLVM_DEFAULT} ]; then \
55
		! [ -e ${LOCALBASE}/bin/clang${LLVM_VERSION} ]; then \
52
		${ECHO_MSG} "Your llvm${LLVM_DEFAULT} is not built with clang support, which is required."; \
56
		${ECHO_MSG} "Your llvm${LLVM_VERSION} is not built with clang support, which is required."; \
53
		${FALSE}; \
57
		${FALSE}; \
54
	fi
58
	fi
55
59
56
- 

Return to bug 273703