summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2023-11-11 20:48:54 +0100
committerMatthieu Herrb <matthieu@herrb.eu>2023-11-11 20:48:54 +0100
commit739a9e86cbc750668b01e8c7be432d41203d4f72 (patch)
tree225a25d4c0883a530ecf7a2ded13a455b7f3461f
parente68fd556792e44b2e13f27fa044abb90d8042690 (diff)
graphics/mesa: update to 23.1.9 using jsg's github repository directly
-rw-r--r--graphics/mesa/Makefile64
-rw-r--r--graphics/mesa/distinfo5
-rw-r--r--graphics/mesa/patches/patch-_gitignore9
-rw-r--r--graphics/mesa/patches/patch-meson_build29
-rw-r--r--graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx10_gfx10_gb_reg_h20
-rw-r--r--graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx11_gfx11_gb_reg_h20
-rw-r--r--graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx9_gfx9_gb_reg_h20
-rw-r--r--graphics/mesa/patches/patch-src_amd_addrlib_src_chip_r800_si_gb_reg_h20
-rw-r--r--graphics/mesa/patches/patch-src_gallium_auxiliary_rtasm_rtasm_execmem_c32
-rw-r--r--graphics/mesa/patches/patch-src_gbm_backends_dri_gbm_dri_c15
-rw-r--r--graphics/mesa/patches/patch-src_glx_dri_common_c15
-rw-r--r--graphics/mesa/patches/patch-src_glx_meson_build27
-rw-r--r--graphics/mesa/patches/patch-src_loader_loader_c21
-rw-r--r--graphics/mesa/patches/patch-src_mapi_u_execmem_c20
-rw-r--r--graphics/mesa/patches/patch-src_mesa_main_execmem_c172
-rw-r--r--graphics/mesa/patches/patch-src_util_build_id_c12
-rw-r--r--graphics/mesa/patches/patch-src_util_build_id_h12
-rw-r--r--graphics/mesa/patches/patch-src_util_compiler_h37
-rw-r--r--graphics/mesa/patches/patch-src_util_disk_cache_c15
-rw-r--r--graphics/mesa/patches/patch-src_util_disk_cache_h12
-rw-r--r--graphics/mesa/patches/patch-src_util_rand_xor_c23
-rw-r--r--graphics/mesa/patches/patch-src_util_u_cpu_detect_c17
-rw-r--r--graphics/mesa/patches/patch-src_util_xmlconfig_h17
-rw-r--r--graphics/mesa/patches/patch-src_vulkan_wsi_wsi_common_drm_c19
-rw-r--r--graphics/mesa/pkg/PLIST4
25 files changed, 46 insertions, 611 deletions
diff --git a/graphics/mesa/Makefile b/graphics/mesa/Makefile
index 8237855..cfae01e 100644
--- a/graphics/mesa/Makefile
+++ b/graphics/mesa/Makefile
@@ -6,10 +6,13 @@ COMMENT = the Mesa 3D Graphics Library
DPB_PROPERTIES = parallel
-DISTNAME = mesa-22.3.7
+GH_ACCOUNT = jonathangray
+GH_PROJECT = mesa
+GH_COMMIT = 2589054cc7492ebee73122866c0958b784142ea2
+DISTNAME = mesa-23.1.9
-SHARED_LIBS = EGL 1.2 gbm 0.4 glapi 0.4 GL 17.2 GLESv1_CM 2.0 GLESv2 2.0 \
- OSMesa 12.1
+SHARED_LIBS = EGL 2.0 gbm 0.6 glapi 1.0 GL 19.0 GLESv1_CM 3.0 GLESv2 3.0 \
+ OSMesa 13.0
CATEGORIES = graphics
@@ -26,27 +29,26 @@ WANTLIB = drm drm_radeon m pthread z expat \
xcb xcb-shm X11-xcb X11 \
xcb-dri3 xcb-xfixes xcb-present xcb-sync \
xshmfence Xext Xfixes xcb-glx xcb-dri2 \
- Xxf86vm c++ c++abi LLVM elf xcb-randr drm_amdgpu \
- zstd
-
-MASTER_SITES = https://mesa.freedesktop.org/archive/
-EXTRACT_SUFX = .tar.xz
+ Xxf86vm c++ c++abi elf xcb-randr drm_amdgpu \
+ drm_intel udev wayland-client wayland-server
BUILD_DEPENDS = sysutils/libdrm \
devel/xorgproto \
+ graphics/pixman \
graphics/glslang \
www/py-mako,python3 \
- devel/bison
+ devel/bison \
+ x11/fontconfig
-LIB_DEPENDS = archivers/zstd \
- sysutils/libdrm \
+LIB_DEPENDS = sysutils/libdrm \
+ sysutils/libudev-openbsd \
+ wayland/wayland \
x11/libX11 \
x11/libxcb \
x11/libXext \
x11/libXfixes \
- x11/libXrandr \
x11/libXxf86vm \
- x11/libxshmfence \
+ x11/libxshmfence
SEPARATE_BUILD = Yes
@@ -55,8 +57,8 @@ GALLIUM_DRIVERS = swrast
WITH_LLVM = false
.if ${MACHINE} == i386 || ${MACHINE} == amd64
-GALLIUM_DRIVERS = swrast,r300,r600,iris,radeonsi
-VULKAN_DRIVERS = amd,intel
+GALLIUM_DRIVERS = swrast,r300,r600,radeonsi,i915,crocus,iris
+VULKAN_DRIVERS = intel,intel_hasvk,amd
WITH_LLVM = enabled
.endif
@@ -66,16 +68,28 @@ DRI_DRIVERS = r100,r200
GALLIUM_DRIVERS = swrast,r300,r600
.endif
+CONFIGURE_ENV = "MESA_GIT_SHA1_OVERRIDE=''"
+
CONFIGURE_ARGS = -Dgallium-drivers=${GALLIUM_DRIVERS} \
- -Dvulkan-drivers=${VULKAN_DRIVERS} \
- -Dplatforms=x11 \
- -Dgallium-vdpau=disabled \
- -Dmicrosoft-clc=disabled \
- -Dintel-clc=disabled \
- -Dcpp_rtti=false \
- -Dosmesa=true \
- -Ddri3=enabled \
- -Dllvm=${WITH_LLVM} \
- -Ddri-drivers-path=${X11BASE}/lib/modules/dri
+ -Dvulkan-drivers=${VULKAN_DRIVERS} \
+ -Dgallium-xa=disabled \
+ -Dgallium-va=disabled \
+ -Dgallium-vdpau=disabled \
+ -Dmicrosoft-clc=disabled \
+ -Dandroid-libbacktrace=disabled \
+ -Dlibunwind=disabled \
+ -Dlmsensors=disabled \
+ -Dplatforms=x11,wayland \
+ -Ddri3=enabled \
+ -Dgles1=enabled \
+ -Dgles2=enabled \
+ -Dgbm=enabled \
+ -Dosmesa=true \
+ -Dshared-glapi=enabled \
+ -Dzstd=disabled \
+ -Dexecmem=false \
+ -Db_ndebug=true \
+ -Ddri-drivers-path=${X11BASE}/lib/modules/dri \
+ -Ddri-search-path=${X11BASE}/lib/modules/dri
.include <bsd.port.mk>
diff --git a/graphics/mesa/distinfo b/graphics/mesa/distinfo
index 960eb00..390640f 100644
--- a/graphics/mesa/distinfo
+++ b/graphics/mesa/distinfo
@@ -1,2 +1,3 @@
-SHA256 (mesa-22.3.7.tar.xz) = iUzi9KHC52F3zdIoRiAZLQ2jBmskPuwvux18838TBCw=
-SIZE (mesa-22.3.7.tar.xz) = 17136476
+SHA256 (-2589054c.tar.gz) = acU419mXnpkU8pCu/9AM4kINjDpvya4wc/9bRoKQvEQ=
+SHA256 (mesa-23.1.9-2589054c.tar.gz) = acU419mXnpkU8pCu/9AM4kINjDpvya4wc/9bRoKQvEQ=
+SIZE (mesa-23.1.9-2589054c.tar.gz) = 29490858
diff --git a/graphics/mesa/patches/patch-_gitignore b/graphics/mesa/patches/patch-_gitignore
deleted file mode 100644
index 8b49dba..0000000
--- a/graphics/mesa/patches/patch-_gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-Index: .gitignore
---- .gitignore.orig
-+++ .gitignore
-@@ -1,4 +1,5 @@
- *.pyc
- *.pyo
- *.out
-+**/obj
- /build
diff --git a/graphics/mesa/patches/patch-meson_build b/graphics/mesa/patches/patch-meson_build
deleted file mode 100644
index cf6b5a0..0000000
--- a/graphics/mesa/patches/patch-meson_build
+++ /dev/null
@@ -1,29 +0,0 @@
-Index: meson.build
---- meson.build.orig
-+++ meson.build
-@@ -1151,7 +1151,6 @@ else
- '-Werror=empty-body',
- '-Werror=incompatible-pointer-types',
- '-Werror=int-conversion',
-- '-Wimplicit-fallthrough',
- '-Wno-missing-field-initializers',
- '-Wno-format-truncation',
- '-fno-math-errno',
-@@ -1418,6 +1417,7 @@ functions_to_detect = {
- 'timespec_get': '#include <time.h>',
- 'memfd_create': '',
- 'random_r': '',
-+ 'arc4random_buf': '',
- 'flock': '',
- 'strtok_r': '',
- 'getrandom': '',
-@@ -1549,6 +1549,9 @@ if cc.links('int main() { return 0; }',
- endif
-
- ld_args_build_id = cc.get_supported_link_arguments('-Wl,--build-id=sha1')
-+if ld_args_build_id.length() != 0
-+ pre_args += '-DHAVE_LD_BUILD_ID'
-+endif
-
- # check for dl support
- dep_dl = null_dep
diff --git a/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx10_gfx10_gb_reg_h b/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx10_gfx10_gb_reg_h
deleted file mode 100644
index bb79d84..0000000
--- a/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx10_gfx10_gb_reg_h
+++ /dev/null
@@ -1,20 +0,0 @@
-Index: src/amd/addrlib/src/chip/gfx10/gfx10_gb_reg.h
---- src/amd/addrlib/src/chip/gfx10/gfx10_gb_reg.h.orig
-+++ src/amd/addrlib/src/chip/gfx10/gfx10_gb_reg.h
-@@ -36,10 +36,12 @@
- //
- // Make sure the necessary endian defines are there.
- //
--#if defined(LITTLEENDIAN_CPU)
--#elif defined(BIGENDIAN_CPU)
--#else
--#error "BIGENDIAN_CPU or LITTLEENDIAN_CPU must be defined"
-+#include "util/u_endian.h"
-+
-+#if UTIL_ARCH_LITTLE_ENDIAN
-+#define LITTLEENDIAN_CPU
-+#elif UTIL_ARCH_BIG_ENDIAN
-+#define BIGENDIAN_CPU
- #endif
-
- union GB_ADDR_CONFIG_GFX10
diff --git a/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx11_gfx11_gb_reg_h b/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx11_gfx11_gb_reg_h
deleted file mode 100644
index 3e9d794..0000000
--- a/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx11_gfx11_gb_reg_h
+++ /dev/null
@@ -1,20 +0,0 @@
-Index: src/amd/addrlib/src/chip/gfx11/gfx11_gb_reg.h
---- src/amd/addrlib/src/chip/gfx11/gfx11_gb_reg.h.orig
-+++ src/amd/addrlib/src/chip/gfx11/gfx11_gb_reg.h
-@@ -36,10 +36,12 @@
- //
- // Make sure the necessary endian defines are there.
- //
--#if defined(LITTLEENDIAN_CPU)
--#elif defined(BIGENDIAN_CPU)
--#else
--#error "BIGENDIAN_CPU or LITTLEENDIAN_CPU must be defined"
-+#include "util/u_endian.h"
-+
-+#if UTIL_ARCH_LITTLE_ENDIAN
-+#define LITTLEENDIAN_CPU
-+#elif UTIL_ARCH_BIG_ENDIAN
-+#define BIGENDIAN_CPU
- #endif
-
- union GB_ADDR_CONFIG_GFX11
diff --git a/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx9_gfx9_gb_reg_h b/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx9_gfx9_gb_reg_h
deleted file mode 100644
index e63d4d1..0000000
--- a/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_gfx9_gfx9_gb_reg_h
+++ /dev/null
@@ -1,20 +0,0 @@
-Index: src/amd/addrlib/src/chip/gfx9/gfx9_gb_reg.h
---- src/amd/addrlib/src/chip/gfx9/gfx9_gb_reg.h.orig
-+++ src/amd/addrlib/src/chip/gfx9/gfx9_gb_reg.h
-@@ -36,10 +36,12 @@
- //
- // Make sure the necessary endian defines are there.
- //
--#if defined(LITTLEENDIAN_CPU)
--#elif defined(BIGENDIAN_CPU)
--#else
--#error "BIGENDIAN_CPU or LITTLEENDIAN_CPU must be defined"
-+#include "util/u_endian.h"
-+
-+#if UTIL_ARCH_LITTLE_ENDIAN
-+#define LITTLEENDIAN_CPU
-+#elif UTIL_ARCH_BIG_ENDIAN
-+#define BIGENDIAN_CPU
- #endif
-
- union GB_ADDR_CONFIG_GFX9 {
diff --git a/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_r800_si_gb_reg_h b/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_r800_si_gb_reg_h
deleted file mode 100644
index 1634f6e..0000000
--- a/graphics/mesa/patches/patch-src_amd_addrlib_src_chip_r800_si_gb_reg_h
+++ /dev/null
@@ -1,20 +0,0 @@
-Index: src/amd/addrlib/src/chip/r800/si_gb_reg.h
---- src/amd/addrlib/src/chip/r800/si_gb_reg.h.orig
-+++ src/amd/addrlib/src/chip/r800/si_gb_reg.h
-@@ -37,10 +37,12 @@
- //
- // Make sure the necessary endian defines are there.
- //
--#if defined(LITTLEENDIAN_CPU)
--#elif defined(BIGENDIAN_CPU)
--#else
--#error "BIGENDIAN_CPU or LITTLEENDIAN_CPU must be defined"
-+#include "util/u_endian.h"
-+
-+#if UTIL_ARCH_LITTLE_ENDIAN
-+#define LITTLEENDIAN_CPU
-+#elif UTIL_ARCH_BIG_ENDIAN
-+#define BIGENDIAN_CPU
- #endif
-
- /*
diff --git a/graphics/mesa/patches/patch-src_gallium_auxiliary_rtasm_rtasm_execmem_c b/graphics/mesa/patches/patch-src_gallium_auxiliary_rtasm_rtasm_execmem_c
deleted file mode 100644
index db2f222..0000000
--- a/graphics/mesa/patches/patch-src_gallium_auxiliary_rtasm_rtasm_execmem_c
+++ /dev/null
@@ -1,32 +0,0 @@
-Index: src/gallium/auxiliary/rtasm/rtasm_execmem.c
---- src/gallium/auxiliary/rtasm/rtasm_execmem.c.orig
-+++ src/gallium/auxiliary/rtasm/rtasm_execmem.c
-@@ -66,9 +66,19 @@ static struct mem_block *exec_heap = NULL;
- static unsigned char *exec_mem = NULL;
-
-
-+#ifdef __OpenBSD__
-+
- static int
- init_heap(void)
- {
-+ return 0;
-+}
-+
-+#else
-+
-+static int
-+init_heap(void)
-+{
- if (!exec_heap)
- exec_heap = u_mmInit( 0, EXEC_HEAP_SIZE );
-
-@@ -79,6 +89,8 @@ init_heap(void)
-
- return (exec_mem != MAP_FAILED);
- }
-+
-+#endif
-
-
- void *
diff --git a/graphics/mesa/patches/patch-src_gbm_backends_dri_gbm_dri_c b/graphics/mesa/patches/patch-src_gbm_backends_dri_gbm_dri_c
deleted file mode 100644
index afb0edf..0000000
--- a/graphics/mesa/patches/patch-src_gbm_backends_dri_gbm_dri_c
+++ /dev/null
@@ -1,15 +0,0 @@
-Index: src/gbm/backends/dri/gbm_dri.c
---- src/gbm/backends/dri/gbm_dri.c.orig
-+++ src/gbm/backends/dri/gbm_dri.c
-@@ -349,7 +349,11 @@ dri_open_driver(struct gbm_dri_device *dri)
- /* XXX: Library name differs on per platforms basis. Update this as
- * osx/cygwin/windows/bsd gets support for GBM..
- */
-+#ifdef __OpenBSD__
-+ dlopen("libglapi.so", RTLD_LAZY | RTLD_GLOBAL);
-+#else
- dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL);
-+#endif
-
- static const char *search_path_vars[] = {
- /* Read GBM_DRIVERS_PATH first for compatibility, but LIBGL_DRIVERS_PATH
diff --git a/graphics/mesa/patches/patch-src_glx_dri_common_c b/graphics/mesa/patches/patch-src_glx_dri_common_c
deleted file mode 100644
index ab08f47..0000000
--- a/graphics/mesa/patches/patch-src_glx_dri_common_c
+++ /dev/null
@@ -1,15 +0,0 @@
-Index: src/glx/dri_common.c
---- src/glx/dri_common.c.orig
-+++ src/glx/dri_common.c
-@@ -52,7 +52,11 @@
- #endif
-
- #ifndef GL_LIB_NAME
-+#ifdef __OpenBSD__
-+#define GL_LIB_NAME "libGL.so"
-+#else
- #define GL_LIB_NAME "libGL.so.1"
-+#endif
- #endif
-
- /**
diff --git a/graphics/mesa/patches/patch-src_glx_meson_build b/graphics/mesa/patches/patch-src_glx_meson_build
deleted file mode 100644
index 437f498..0000000
--- a/graphics/mesa/patches/patch-src_glx_meson_build
+++ /dev/null
@@ -1,27 +0,0 @@
-Index: src/glx/meson.build
---- src/glx/meson.build.orig
-+++ src/glx/meson.build
-@@ -122,12 +122,22 @@ else
- )
- endif
-
-+if host_machine.system() != 'openbsd'
-+ gl_lib_define = [
-+ '-DGL_LIB_NAME="lib@0@.so.@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0]),
-+ ]
-+else
-+ gl_lib_define = [
-+ '-DGL_LIB_NAME="lib@0@.so"'.format(gl_lib_name )
-+ ]
-+endif
-+
- libglx = static_library(
- 'glx',
- [files_libglx, glx_generated],
- include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_glapi, inc_loader],
- c_args : [
-- '-DGL_LIB_NAME="lib@0@.so.@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0]),
-+ gl_lib_define,
- ],
- gnu_symbol_visibility : 'hidden',
- link_with : [
diff --git a/graphics/mesa/patches/patch-src_loader_loader_c b/graphics/mesa/patches/patch-src_loader_loader_c
deleted file mode 100644
index c917f92..0000000
--- a/graphics/mesa/patches/patch-src_loader_loader_c
+++ /dev/null
@@ -1,21 +0,0 @@
-Index: src/loader/loader.c
---- src/loader/loader.c.orig
-+++ src/loader/loader.c
-@@ -561,7 +561,7 @@ loader_get_driver_for_fd(int fd)
- * user's problem, but this allows vc4 simulator to run on an i965 host,
- * and may be useful for some touch testing of i915 on an i965 host.
- */
-- if (geteuid() == getuid()) {
-+ if (issetugid() == 0 && geteuid() == getuid()) {
- const char *override = os_get_option("MESA_LOADER_DRIVER_OVERRIDE");
- if (override)
- return strdup(override);
-@@ -625,7 +625,7 @@ loader_open_driver_lib(const char *driver_name,
- const char *search_paths, *next, *end;
-
- search_paths = NULL;
-- if (geteuid() == getuid() && search_path_vars) {
-+ if (issetugid() == 0 && geteuid() == getuid() && search_path_vars) {
- for (int i = 0; search_path_vars[i] != NULL; i++) {
- search_paths = getenv(search_path_vars[i]);
- if (search_paths)
diff --git a/graphics/mesa/patches/patch-src_mapi_u_execmem_c b/graphics/mesa/patches/patch-src_mapi_u_execmem_c
deleted file mode 100644
index c2466f0..0000000
--- a/graphics/mesa/patches/patch-src_mapi_u_execmem_c
+++ /dev/null
@@ -1,20 +0,0 @@
-Index: src/mapi/u_execmem.c
---- src/mapi/u_execmem.c.orig
-+++ src/mapi/u_execmem.c
-@@ -45,8 +45,15 @@ static unsigned int head = 0;
-
- static unsigned char *exec_mem = (unsigned char *)0;
-
-+#if defined(__OpenBSD__)
-
--#if defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__sun) || defined(__HAIKU__)
-+static int
-+init_map(void)
-+{
-+ return 0;
-+}
-+
-+#elif defined(__linux__) || defined(__NetBSD__) || defined(__sun) || defined(__HAIKU__)
-
- #include <unistd.h>
- #include <sys/mman.h>
diff --git a/graphics/mesa/patches/patch-src_mesa_main_execmem_c b/graphics/mesa/patches/patch-src_mesa_main_execmem_c
deleted file mode 100644
index d5f8f17..0000000
--- a/graphics/mesa/patches/patch-src_mesa_main_execmem_c
+++ /dev/null
@@ -1,172 +0,0 @@
-Index: src/mesa/main/execmem.c
---- src/mesa/main/execmem.c.orig
-+++ src/mesa/main/execmem.c
-@@ -0,0 +1,168 @@
-+/*
-+ * Mesa 3-D graphics library
-+ *
-+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included
-+ * in all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-+ * OTHER DEALINGS IN THE SOFTWARE.
-+ */
-+
-+
-+/**
-+ * \file execmem.c
-+ * Functions for allocating executable memory.
-+ *
-+ * \author Keith Whitwell
-+ */
-+
-+
-+#include <stdio.h>
-+#include "main/glheader.h"
-+#include "execmem.h"
-+#include "c11/threads.h"
-+
-+
-+#if defined(__OpenBSD__)
-+
-+void *
-+_mesa_exec_malloc(GLuint size)
-+{
-+ return NULL;
-+}
-+
-+void
-+_mesa_exec_free(void *addr)
-+{
-+}
-+
-+#elif defined(__linux__) || defined(__NetBSD__) || defined(__sun) || defined(__HAIKU__)
-+
-+/*
-+ * Allocate a large block of memory which can hold code then dole it out
-+ * in pieces by means of the generic memory manager code.
-+*/
-+
-+#include <unistd.h>
-+#include <sys/mman.h>
-+#include "util/u_mm.h"
-+
-+#ifdef MESA_SELINUX
-+#include <selinux/selinux.h>
-+#endif
-+
-+
-+#ifndef MAP_ANONYMOUS
-+#define MAP_ANONYMOUS MAP_ANON
-+#endif
-+
-+
-+#define EXEC_HEAP_SIZE (10*1024*1024)
-+
-+static mtx_t exec_mutex = _MTX_INITIALIZER_NP;
-+
-+static struct mem_block *exec_heap = NULL;
-+static unsigned char *exec_mem = NULL;
-+
-+
-+static int
-+init_heap(void)
-+{
-+#ifdef MESA_SELINUX
-+ if (is_selinux_enabled()) {
-+ if (!security_get_boolean_active("allow_execmem") ||
-+ !security_get_boolean_pending("allow_execmem"))
-+ return 0;
-+ }
-+#endif
-+
-+ if (!exec_heap)
-+ exec_heap = u_mmInit( 0, EXEC_HEAP_SIZE );
-+
-+ if (!exec_mem)
-+ exec_mem = mmap(NULL, EXEC_HEAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE,
-+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-+
-+ return (exec_mem != MAP_FAILED);
-+}
-+
-+
-+void *
-+_mesa_exec_malloc(unsigned size)
-+{
-+ struct mem_block *block = NULL;
-+ void *addr = NULL;
-+
-+ mtx_lock(&exec_mutex);
-+
-+ if (!init_heap())
-+ goto bail;
-+
-+ if (exec_heap) {
-+ size = (size + 31) & ~31;
-+ block = u_mmAllocMem(exec_heap, size, 5, 0);
-+ }
-+
-+ if (block)
-+ addr = exec_mem + block->ofs;
-+ else
-+ printf("_mesa_exec_malloc failed\n");
-+
-+bail:
-+ mtx_unlock(&exec_mutex);
-+
-+ return addr;
-+}
-+
-+
-+void
-+_mesa_exec_free(void *addr)
-+{
-+ mtx_lock(&exec_mutex);
-+
-+ if (exec_heap) {
-+ struct mem_block *block = u_mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem);
-+
-+ if (block)
-+ u_mmFreeMem(block);
-+ }
-+
-+ mtx_unlock(&exec_mutex);
-+}
-+
-+
-+#else
-+
-+/*
-+ * Just use regular memory.
-+ */
-+
-+void *
-+_mesa_exec_malloc(unsigned size)
-+{
-+ return malloc( size );
-+}
-+
-+
-+void
-+_mesa_exec_free(void *addr)
-+{
-+ free(addr);
-+}
-+
-+
-+#endif
diff --git a/graphics/mesa/patches/patch-src_util_build_id_c b/graphics/mesa/patches/patch-src_util_build_id_c
deleted file mode 100644
index 3c778b9..0000000
--- a/graphics/mesa/patches/patch-src_util_build_id_c
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: src/util/build_id.c
---- src/util/build_id.c.orig
-+++ src/util/build_id.c
-@@ -21,7 +21,7 @@
- * IN THE SOFTWARE.
- */
-
--#ifdef HAVE_DL_ITERATE_PHDR
-+#if defined(HAVE_DL_ITERATE_PHDR) && defined(HAVE_LD_BUILD_ID)
- #include <dlfcn.h>
- #include <link.h>
- #include <stddef.h>
diff --git a/graphics/mesa/patches/patch-src_util_build_id_h b/graphics/mesa/patches/patch-src_util_build_id_h
deleted file mode 100644
index 582ca9b..0000000
--- a/graphics/mesa/patches/patch-src_util_build_id_h
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: src/util/build_id.h
---- src/util/build_id.h.orig
-+++ src/util/build_id.h
-@@ -28,7 +28,7 @@
- extern "C" {
- #endif
-
--#ifdef HAVE_DL_ITERATE_PHDR
-+#if defined(HAVE_DL_ITERATE_PHDR) && defined(HAVE_LD_BUILD_ID)
-
- #include <stdint.h>
-
diff --git a/graphics/mesa/patches/patch-src_util_compiler_h b/graphics/mesa/patches/patch-src_util_compiler_h
deleted file mode 100644
index 17385bc..0000000
--- a/graphics/mesa/patches/patch-src_util_compiler_h
+++ /dev/null
@@ -1,37 +0,0 @@
-Index: src/util/compiler.h
---- src/util/compiler.h.orig
-+++ src/util/compiler.h
-@@ -45,28 +45,16 @@
- * Try to use a runtime test instead.
- * For now, only used by some DRI hardware drivers for color/texel packing.
- */
--#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
--#if defined(__linux__)
--#include <byteswap.h>
--#define CPU_TO_LE32( x ) bswap_32( x )
--#elif defined(__APPLE__)
--#include <CoreFoundation/CFByteOrder.h>
--#define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x )
--#elif defined(__OpenBSD__)
--#include <sys/types.h>
-+#ifdef __OpenBSD__
-+#include <endian.h>
- #define CPU_TO_LE32( x ) htole32( x )
--#else /*__linux__ */
--#include <sys/endian.h>
--#define CPU_TO_LE32( x ) bswap32( x )
--#endif /*__linux__*/
-+#define LE32_TO_CPU( x ) letoh32( x )
-+#if BYTE_ORDER == BIG_ENDIAN
- #define MESA_BIG_ENDIAN 1
- #else
--#define CPU_TO_LE32( x ) ( x )
- #define MESA_LITTLE_ENDIAN 1
- #endif
--#define LE32_TO_CPU( x ) CPU_TO_LE32( x )
--
--
-+#endif /* __OpenBSD__ */
-
- #define IEEE_ONE 0x3f800000
-
diff --git a/graphics/mesa/patches/patch-src_util_disk_cache_c b/graphics/mesa/patches/patch-src_util_disk_cache_c
deleted file mode 100644
index 785798e..0000000
--- a/graphics/mesa/patches/patch-src_util_disk_cache_c
+++ /dev/null
@@ -1,15 +0,0 @@
-Index: src/util/disk_cache.c
---- src/util/disk_cache.c.orig
-+++ src/util/disk_cache.c
-@@ -80,6 +80,11 @@ disk_cache_create(const char *gpu_name, const char *dr
- uint8_t cache_version = CACHE_VERSION;
- size_t cv_size = sizeof(cache_version);
-
-+#ifdef __OpenBSD__
-+ /* default to no disk shader cache to avoid pledge violations in chromium */
-+ return NULL;
-+#endif
-+
- if (!disk_cache_enabled())
- return NULL;
-
diff --git a/graphics/mesa/patches/patch-src_util_disk_cache_h b/graphics/mesa/patches/patch-src_util_disk_cache_h
deleted file mode 100644
index b4c437a..0000000
--- a/graphics/mesa/patches/patch-src_util_disk_cache_h
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: src/util/disk_cache.h
---- src/util/disk_cache.h.orig
-+++ src/util/disk_cache.h
-@@ -123,7 +123,7 @@ disk_cache_get_function_identifier(void *ptr, struct m
- {
- uint32_t timestamp;
-
--#ifdef HAVE_DL_ITERATE_PHDR
-+#if defined(HAVE_DL_ITERATE_PHDR) && defined(HAVE_LD_BUILD_ID)
- const struct build_id_note *note = NULL;
- if ((note = build_id_find_nhdr_for_addr(ptr))) {
- _mesa_sha1_update(ctx, build_id_data(note), build_id_length(note));
diff --git a/graphics/mesa/patches/patch-src_util_rand_xor_c b/graphics/mesa/patches/patch-src_util_rand_xor_c
deleted file mode 100644
index 97480e8..0000000
--- a/graphics/mesa/patches/patch-src_util_rand_xor_c
+++ /dev/null
@@ -1,23 +0,0 @@
-Index: src/util/rand_xor.c
---- src/util/rand_xor.c.orig
-+++ src/util/rand_xor.c
-@@ -33,6 +33,7 @@
- #endif
-
- #include <time.h>
-+#include <stdlib.h>
-
- #include "rand_xor.h"
-
-@@ -68,7 +69,10 @@ s_rand_xorshift128plus(uint64_t seed[2], bool randomis
- #if !DETECT_OS_WINDOWS
- size_t seed_size = sizeof(uint64_t) * 2;
-
--#if defined(HAVE_GETRANDOM)
-+#ifdef HAVE_ARC4RANDOM_BUF
-+ arc4random_buf(seed, seed_size);
-+ return;
-+#elif defined(HAVE_GETRANDOM)
- ssize_t ret = getrandom(seed, seed_size, GRND_NONBLOCK);
- if (ret == seed_size)
- return;
diff --git a/graphics/mesa/patches/patch-src_util_u_cpu_detect_c b/graphics/mesa/patches/patch-src_util_u_cpu_detect_c
deleted file mode 100644
index 4eedf07..0000000
--- a/graphics/mesa/patches/patch-src_util_u_cpu_detect_c
+++ /dev/null
@@ -1,17 +0,0 @@
-Index: src/util/u_cpu_detect.c
---- src/util/u_cpu_detect.c.orig
-+++ src/util/u_cpu_detect.c
-@@ -224,10 +224,13 @@ check_os_altivec_support(void)
-
- util_cpu_caps.has_altivec = 1;
-
-+/* no support for POWER7 VSX instructions in binutils 2.17 */
-+#ifndef __OpenBSD__
- if (enable_vsx) {
- __asm __volatile("xxland %vs0, %vs0, %vs0");
- util_cpu_caps.has_vsx = 1;
- }
-+#endif
- signal(SIGILL, SIG_DFL);
- } else {
- util_cpu_caps.has_altivec = 0;
diff --git a/graphics/mesa/patches/patch-src_util_xmlconfig_h b/graphics/mesa/patches/patch-src_util_xmlconfig_h
deleted file mode 100644
index c67594b..0000000
--- a/graphics/mesa/patches/patch-src_util_xmlconfig_h
+++ /dev/null
@@ -1,17 +0,0 @@
-Index: src/util/xmlconfig.h
---- src/util/xmlconfig.h.orig
-+++ src/util/xmlconfig.h
-@@ -39,7 +39,12 @@
- extern "C" {
- #endif
-
--#if defined(ANDROID) || defined(_WIN32)
-+/*
-+ * Opening drirc files is disabled by default so sandboxed
-+ * browser processes with OpenGL contexts can drop the ability
-+ * to read files.
-+ */
-+#if defined(ANDROID) || defined(_WIN32) || defined(__OpenBSD__)
- #define WITH_XMLCONFIG 0
- #else
- #define WITH_XMLCONFIG 1
diff --git a/graphics/mesa/patches/patch-src_vulkan_wsi_wsi_common_drm_c b/graphics/mesa/patches/patch-src_vulkan_wsi_wsi_common_drm_c
deleted file mode 100644
index 21f1b3c..0000000
--- a/graphics/mesa/patches/patch-src_vulkan_wsi_wsi_common_drm_c
+++ /dev/null
@@ -1,19 +0,0 @@
-Index: src/vulkan/wsi/wsi_common_drm.c
---- src/vulkan/wsi/wsi_common_drm.c.orig
-+++ src/vulkan/wsi/wsi_common_drm.c
-@@ -32,8 +32,15 @@
- #include "drm-uapi/drm_fourcc.h"
-
- #include <errno.h>
-+
-+#ifdef __linux__
- #include <linux/dma-buf.h>
- #include <linux/sync_file.h>
-+#else
-+#define DMA_BUF_SYNC_RW 1
-+#define DMA_BUF_BASE 'b'
-+#endif
-+
- #include <time.h>
- #include <unistd.h>
- #include <stdlib.h>
diff --git a/graphics/mesa/pkg/PLIST b/graphics/mesa/pkg/PLIST
index ab784f3..5c02582 100644
--- a/graphics/mesa/pkg/PLIST
+++ b/graphics/mesa/pkg/PLIST
@@ -32,7 +32,10 @@ include/gbm.h
@lib lib/libgbm.so.${LIBgbm_VERSION}
@lib lib/libglapi.so.${LIBglapi_VERSION}
@so lib/libvulkan_intel.so
+@so lib/libvulkan_intel_hasvk.so
@so lib/libvulkan_radeon.so
+@so lib/modules/dri/crocus_dri.so
+@so lib/modules/dri/i915_dri.so
@so lib/modules/dri/iris_dri.so
@so lib/modules/dri/kms_swrast_dri.so
@so lib/modules/dri/r300_dri.so
@@ -49,5 +52,6 @@ lib/pkgconfig/osmesa.pc
share/drirc.d/
share/drirc.d/00-mesa-defaults.conf
share/drirc.d/00-radv-defaults.conf
+share/vulkan/icd.d/intel_hasvk_icd.x86_64.json
share/vulkan/icd.d/intel_icd.x86_64.json
share/vulkan/icd.d/radeon_icd.x86_64.json