Page MenuHomeFreeBSD

D23161.diff
No OneTemporary

D23161.diff

Index: MOVED
===================================================================
--- MOVED
+++ MOVED
@@ -13748,3 +13748,5 @@
sysutils/docker-freebsd||2020-01-11|Has expired: Broken for more than 9 months
science/molden|biology/molden|2020-01-12|The duplicate port was removed in rev.505268
www/web2ldap||2020-01-13|Broken: unfechable and missing dependencies
+graphics/mesa-dri|graphics/mesa|2020-01-14|Merged for simplicity into graphics/mesa
+graphics/mesa-libs|graphics/mesa|2020-01-14|Merged for simplicity into graphics/mesa
Index: Mk/Uses/gl.mk
===================================================================
--- Mk/Uses/gl.mk
+++ Mk/Uses/gl.mk
@@ -15,11 +15,11 @@
.if !defined(_INCLUDE_USES_GL_MK)
_INCLUDE_USES_GL_MK=yes
-_GL_egl_LIB_DEPENDS= libEGL.so:graphics/mesa-libs
-_GL_gbm_LIB_DEPENDS= libgbm.so:graphics/mesa-libs
-_GL_gl_LIB_DEPENDS= libGL.so:graphics/mesa-libs
+_GL_egl_LIB_DEPENDS= libEGL.so:graphics/mesa
+_GL_gbm_LIB_DEPENDS= libgbm.so:graphics/mesa
+_GL_gl_LIB_DEPENDS= libGL.so:graphics/mesa
_GL_gl_USE_XORG= xorgproto
-_GL_glesv2_LIB_DEPENDS= libGLESv2.so:graphics/mesa-libs
+_GL_glesv2_LIB_DEPENDS= libGLESv2.so:graphics/mesa
_GL_glew_LIB_DEPENDS= libGLEW.so:graphics/glew
_GL_glu_LIB_DEPENDS= libGLU.so:graphics/libGLU
_GL_glu_USE_XORG= xorgproto
Index: Mk/Uses/xorg-cat.mk
===================================================================
--- Mk/Uses/xorg-cat.mk
+++ Mk/Uses/xorg-cat.mk
@@ -172,7 +172,7 @@
CONFIGURE_ARGS+= --with-xkb-path=${LOCALBASE}/share/X11/xkb \
--with-fontrootdir=${LOCALBASE}/share/fonts
. endif
-LIB_PC_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri
+LIB_PC_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa
USE_XORG+= fontutil
. endif # ${_XORG_CAT} == <category>
Index: comms/cubicsdr/Makefile
===================================================================
--- comms/cubicsdr/Makefile
+++ comms/cubicsdr/Makefile
@@ -2,7 +2,7 @@
PORTNAME= cubicsdr
DISTVERSION= 0.2.5
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= comms hamradio
MAINTAINER= hamradio@FreeBSD.org
@@ -12,13 +12,13 @@
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= ${PYNUMPY} \
- ${LOCALBASE}/lib/libEGL.so:graphics/mesa-libs \
- ${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri
+ ${LOCALBASE}/lib/libEGL.so:graphics/mesa \
+ ${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa
LIB_DEPENDS= libSoapySDR.so:misc/soapysdr \
libliquid.so:comms/liquid-dsp \
libpulse.so:audio/pulseaudio \
libhamlib.so:comms/hamlib \
- libEGL.so:graphics/mesa-libs \
+ libEGL.so:graphics/mesa \
libwx_gtk3u_core-3.1.so:x11-toolkits/wxgtk31
USES= cmake compiler:c++0x gl python
Index: devel/sdl20/Makefile
===================================================================
--- devel/sdl20/Makefile
+++ devel/sdl20/Makefile
@@ -2,7 +2,7 @@
PORTNAME= sdl2
PORTVERSION= 2.0.10
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= devel
MASTER_SITES= https://www.libsdl.org/release/
DISTNAME= SDL2-${PORTVERSION}
@@ -193,7 +193,7 @@
.endif
CONFIGURE_ARGS+= --enable-video-kmsdrm --enable-kmsdrm-shared
BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/libdrm.pc:graphics/libdrm \
- ${LOCALBASE}/libdata/pkgconfig/gbm.pc:graphics/mesa-libs
+ ${LOCALBASE}/libdata/pkgconfig/gbm.pc:graphics/mesa
.else
CONFIGURE_ARGS+= --disable-video-kmsdrm --disable-video-kmsdrm
.endif
Index: emulators/i386-wine/Makefile.i386
===================================================================
--- emulators/i386-wine/Makefile.i386
+++ emulators/i386-wine/Makefile.i386
@@ -12,7 +12,7 @@
PKGINSTALL= ${SLAVEDIR}/files/pkg-install
PKGDEINSTALL= ${PKGINSTALL}
-RUN_DEPENDS= mesa-dri>0:graphics/mesa-dri
+RUN_DEPENDS= mesa>0:graphics/mesa
CONFLICTS_INSTALL?= wine-[0-9]* wine-staging-[0-9]* wine-devel-[0-9]* \
i386-wine-staging-[0-9]* i386-wine-devel-[0-9]*
Index: graphics/Makefile
===================================================================
--- graphics/Makefile
+++ graphics/Makefile
@@ -529,8 +529,7 @@
SUBDIR += mapyrus
SUBDIR += megapov
SUBDIR += mesa-demos
- SUBDIR += mesa-dri
- SUBDIR += mesa-libs
+ SUBDIR += mesa
SUBDIR += metacam
SUBDIR += metapixel
SUBDIR += mhgui
Index: graphics/libosmesa/Makefile
===================================================================
--- graphics/libosmesa/Makefile
+++ graphics/libosmesa/Makefile
@@ -3,7 +3,6 @@
PORTNAME= libosmesa
PORTVERSION= ${MESAVERSION}
-PORTREVISION= 6
CATEGORIES= graphics
COMMENT= Off-Screen Mesa implementation of the OpenGL API
@@ -11,27 +10,19 @@
USE_XORG= xorgproto
.include <bsd.port.options.mk>
-.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
+.include "${.CURDIR:H:H}/graphics/mesa/Makefile.common"
-CONFIGURE_ARGS+= --disable-dri --disable-egl --disable-gbm \
- --disable-gles2 --with-gallium-drivers=swrast
-MESA_BUILD_WRKSRC= src/util src/compiler src/mapi src/mesa
-LDFLAGS_i386= -Wl,-znotext
+MESON_ARGS+= -Ddri-drivers="" -Degl=false -Dgbm=false \
+ -Dgles2=false -Dgallium-drivers=swrast
+LDFLAGS_i386= -Wl,-znotext
.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*}
-CONFIGURE_ARGS+= --enable-osmesa-gallium
-MESA_BUILD_WRKSRC+= src/gallium
-MESA_INSTALL_WRKSRC= src/gallium/state_trackers/osmesa src/gallium/targets/osmesa
+MESON_ARGS+= -Dosmesa=gallium
.else
-CONFIGURE_ARGS+= --enable-osmesa
-MESA_INSTALL_WRKSRC= src/mesa/drivers/osmesa
+MESON_ARGS+= -Dosmesa=classic
.endif
-.include "${MASTERDIR}/Makefile.targets"
-
post-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/include/GL
${INSTALL_DATA} ${WRKSRC}/include/GL/osmesa.h \
${STAGEDIR}${PREFIX}/include/GL
-
-.include <bsd.port.post.mk>
Index: graphics/libxatracker/Makefile
===================================================================
--- graphics/libxatracker/Makefile
+++ graphics/libxatracker/Makefile
@@ -3,7 +3,6 @@
PORTNAME= libxatracker
PORTVERSION= ${MESAVERSION}
-PORTREVISION= 2
CATEGORIES= graphics
COMMENT= Mesa XA state tracker
@@ -11,27 +10,21 @@
USE_XORG= xorgproto
.include <bsd.port.options.mk>
-.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
+.include "${.CURDIR:H:H}/graphics/mesa/Makefile.common"
ONLY_FOR_ARCHS= i386 amd64
ONLY_FOR_ARCHS_REASON= Used only by VMWare supported architectures
-CONFIGURE_ARGS+= --disable-dri \
- --disable-egl \
- --disable-gbm \
- --disable-gles2 \
- --disable-glx \
- --disable-opengl \
- --disable-shared-glapi \
- --with-gallium-drivers= \
- --with-platforms=
+MESON_ARGS+= -Ddri-drivers="" \
+ -Dvulkan-drivers="" \
+ -Degl=false \
+ -Dgbm=false \
+ -Dgles2=false \
+ -Dglx=disabled \
+ -Dopengl=false \
+ -Dshared-glapi=false \
+ -Dgallium-drivers=svga \
+ -Dplatforms="" \
+ -Dgallium-xa=true
-MESA_BUILD_WRKSRC= src/util src/compiler
-LDFLAGS_i386= -Wl,-znotext
-
-CONFIGURE_ARGS+= --enable-xa
-MESA_BUILD_WRKSRC+= src/gallium
-MESA_INSTALL_WRKSRC= src/gallium/state_trackers/xa src/gallium/targets/xa
-
-.include "${MASTERDIR}/Makefile.targets"
-.include <bsd.port.post.mk>
+LDFLAGS_i386= -Wl,-znotext
Index: graphics/libxatracker/pkg-plist
===================================================================
--- graphics/libxatracker/pkg-plist
+++ graphics/libxatracker/pkg-plist
@@ -3,5 +3,5 @@
include/xa_tracker.h
lib/libxatracker.so
lib/libxatracker.so.2
-lib/libxatracker.so.2.4.0
+lib/libxatracker.so.2.5.0
libdata/pkgconfig/xatracker.pc
Index: graphics/mesa-dri/Makefile
===================================================================
--- graphics/mesa-dri/Makefile
+++ graphics/mesa-dri/Makefile
@@ -1,115 +0,0 @@
-# Created by: Eric Anholt <anholt@FreeBSD.org>
-# $FreeBSD$
-
-PORTNAME= mesa-dri
-PORTVERSION= ${MESAVERSION}
-PORTREVISION= 9
-CATEGORIES= graphics
-
-COMMENT= OpenGL hardware acceleration drivers for DRI2+
-
-USE_XORG= xorgproto x11 xdamage xext xfixes xshmfence xv xvmc
-
-OPTIONS_DEFINE= VAAPI VDPAU WAYLAND
-OPTIONS_DEFAULT=WAYLAND
-OPTIONS_SUB= yes
-
-VAAPI_CONFIGURE_ENABLE= va
-VAAPI_LIB_DEPENDS= libva.so:multimedia/libva
-VAAPI_USE= XORG=xcb
-
-VDPAU_CONFIGURE_ENABLE= vdpau
-VDPAU_LIB_DEPENDS= libvdpau.so:multimedia/libvdpau
-
-WAYLAND_DESC= Enable support for the Wayland platform in Vulkan drivers
-WAYLAND_BUILD_DEPENDS= wayland-protocols>=1.8:graphics/wayland-protocols
-WAYLAND_LIB_DEPENDS= libwayland-client.so:graphics/wayland
-
-.include <bsd.port.options.mk>
-.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
-
-ALL_DRI_DRIVERS= I915 I965 RADEON R200 SWRAST
-ALL_GALLIUM_DRIVERS= FREEDRENO R300 R600 RADEONSI SVGA SWRAST VC4
-ALL_VULKAN_DRIVERS= INTEL RADEON
-
-DRI_DRIVERS= SWRAST # classic swrast
-.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*}
-GALLIUM_DRIVERS= SWRAST # llvmpipe
-.else
-GALLIUM_DRIVERS= ""
-.endif
-VULKAN_DRIVERS= #
-
-.if ${ARCH} == amd64 || ${ARCH} == i386 \
- || ${ARCH} == powerpc || ${ARCH} == powerpc64
-DRI_DRIVERS+= RADEON R200
-GALLIUM_DRIVERS+= R300 R600 RADEONSI
-VULKAN_DRIVERS+= RADEON
-.endif
-.if ${ARCH} == amd64 || ${ARCH} == i386
-DRI_DRIVERS+= I915 I965
-GALLIUM_DRIVERS+= SVGA
-. if ${OPSYS} == FreeBSD
-EXTRA_PATCHES+= ${PATCHDIR}/extra-src_mesa_drivers_dri_i965_intel__screen.c
-. endif
-VULKAN_DRIVERS+= INTEL
-.elif ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7
-GALLIUM_DRIVERS+= FREEDRENO VC4
-. if ${ARCH} == armv6 || ${ARCH} == armv7
-EXTRA_PATCHES+= ${PATCHDIR}/extra-src_gallium_drivers_vc4_Makefile.in
-. endif
-.endif
-
-.if ${VULKAN_DRIVERS}
-BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR}
-USE_XORG+= xcb xrandr
-.endif
-
-LDFLAGS_i386= -Wl,-znotext
-.if ${DRI_DRIVERS} || ${VULKAN_DRIVERS:MINTEL}
-. if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld
-# --build-id isn't supported by old GNU ld.bfd in base
-USE_BINUTILS= yes
-LDFLAGS+= -B${LOCALBASE}/bin
-. endif
-.endif
-
-# enables VK_KHR_wayland_surface in Vulkan drivers
-.if ${PORT_OPTIONS:MWAYLAND} && !empty(VULKAN_DRIVERS)
-CONFIGURE_ARGS+= --with-platforms=x11,surfaceless,drm,wayland
-.endif
-
-CONFIGURE_ARGS+= --with-dri-drivers="${DRI_DRIVERS:tl}" \
- --with-gallium-drivers="${GALLIUM_DRIVERS:tl}" \
- --with-vulkan-drivers="${VULKAN_DRIVERS:tl}"
-
-.for _d in ${ALL_DRI_DRIVERS}
-. if ${DRI_DRIVERS:M${_d}}
-PLIST_SUB+= ${_d}_DRIVER=""
-. else
-PLIST_SUB+= ${_d}_DRIVER="@comment "
-. endif
-.endfor
-
-.for _gd in ${ALL_GALLIUM_DRIVERS}
-. if ${GALLIUM_DRIVERS:M${_gd}}
-PLIST_SUB+= ${_gd}_GDRIVER=""
-. else
-PLIST_SUB+= ${_gd}_GDRIVER="@comment "
-. endif
-.endfor
-
-.for _vd in ${ALL_VULKAN_DRIVERS}
-. if ${VULKAN_DRIVERS:M${_vd}}
-PLIST_SUB+= ${_vd}_VDRIVER="" ARCH="${ARCH}"
-. else
-PLIST_SUB+= ${_vd}_VDRIVER="@comment "
-. endif
-.endfor
-
-.include "${MASTERDIR}/Makefile.targets"
-
-post-install:
- @${RM} -r ${STAGEDIR}/etc/OpenCL
-
-.include <bsd.port.post.mk>
Index: graphics/mesa-dri/Makefile.common
===================================================================
--- graphics/mesa-dri/Makefile.common
+++ graphics/mesa-dri/Makefile.common
@@ -1,106 +0,0 @@
-# Makefile.common - shared code between MesaLib ports.
-#
-# !!! Here be dragons !!! (they seem to be everywhere these days)
-#
-# Remember to upgrade the following ports everytime you bump MESAVERSION:
-#
-# - graphics/libosmesa
-# - graphics/mesa-dri
-# - graphics/mesa-libs
-# - lang/clover
-#
-# $FreeBSD$
-
-MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
-MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
-
-MESABASEVERSION= 18.3.2
-# if there is a subversion, don't include the '-' between 7.11-rc2.
-MESASUBVERSION=
-
-MASTER_SITES= https://mesa.freedesktop.org/archive/ \
- https://mesa.freedesktop.org/archive/${MESABASEVERSION}/ \
- ftp://ftp.freedesktop.org/pub/mesa/ \
- ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/
-
-DISTFILES= mesa-${MESADISTVERSION}${EXTRACT_SUFX}
-
-MAINTAINER= x11@FreeBSD.org
-
-COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//}
-
-BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
-LIB_DEPENDS+= libexpat.so:textproc/expat2
-.if ${COMPONENT} != clover
-USES+= xorg
-.endif
-.if ${COMPONENT} != osmesa
-LIB_DEPENDS+= libdrm.so:graphics/libdrm
-.endif
-.if ${COMPONENT} != libs
-LIB_DEPENDS+= libglapi.so:graphics/mesa-libs
-.endif
-.if ${ARCH} == amd64 || ${ARCH} == i386
-LIB_DEPENDS+= libunwind.so:devel/libunwind
-.endif
-.if ${OPSYS} == DragonFly
-LIB_DEPENDS+= libelf.so:devel/libelf
-.endif
-
-USES+= compiler:c++11-lib bison gettext-tools gmake libtool \
- localbase pathfix pkgconfig python:2.7,build shebangfix tar:xz
-USE_LDCONFIG= yes
-GNU_CONFIGURE= yes
-
-# only have one port to check with portscout.
-.if ${PORTNAME} != mesa-dri
-PORTSCOUT= ignore:1
-.endif
-
-python_OLD_CMD= /usr/bin/env[[:space:]]python2 /usr/bin/python2 /bin/env[[:space:]]python
-SHEBANG_FILES= src/gallium/*/*/*.py src/gallium/tools/trace/*.py \
- src/gallium/drivers/svga/svgadump/svga_dump.py \
- src/mapi/glapi/gen/*.py src/mapi/mapi_abi.py \
- src/util/xmlpool/gen_xmlpool.py \
- src/mesa/main/get_*.py src/util/format_srgb.py \
- src/amd/*/*.py src/intel/genxml/gen_pack_header.py
-
-MASTERDIR= ${.CURDIR:H:H}/graphics/mesa-dri
-PATCHDIR= ${MASTERDIR}/files
-WRKSRC= ${WRKDIR}/mesa-${MESADISTVERSION}
-DESCR= ${.CURDIR}/pkg-descr
-PLIST= ${.CURDIR}/pkg-plist
-PKGHELP= ${.CURDIR}/pkg-help
-PKGINSTALL= ${.CURDIR}/pkg-install
-PKGDEINSTALL= ${.CURDIR}/pkg-deinstall
-INSTALL_TARGET= install-strip
-
-.include <bsd.port.pre.mk>
-
-.if ${LLVM_DEFAULT:S,-devel,990,} >= 90
-LLVM_DEFAULT= 80
-.endif
-
-.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*}
-BUILD_DEPENDS+= llvm${LLVM_DEFAULT}>=3.9.0_4:devel/llvm${LLVM_DEFAULT}
-.if ${COMPONENT} != libs
-RUN_DEPENDS+= llvm${LLVM_DEFAULT}>=3.9.0_4:devel/llvm${LLVM_DEFAULT}
-.endif
-CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT}
-LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${LLVM_DEFAULT}/lib
-CONFIGURE_ARGS+= --enable-llvm
-.else
-CONFIGURE_ARGS+= --disable-llvm
-.endif
-
-# There are issues that need to be fixed to use TLS model "initial-exec"
-# So stick with "global-dynamic"'s model for now. kan@ is working on a
-# patch for rtld. We might want to backport global-dynamic or
-# pthread_setspecific which it uses now by default. But since this
-# configure switch is going away ...
-# https://lists.freebsd.org/pipermail/freebsd-arch/2016-February/017699.html
-CONFIGURE_ARGS+= --disable-glx-tls
-
-# we don't care about GLes v1
-CONFIGURE_ARGS+= --disable-gles1
-
Index: graphics/mesa-dri/Makefile.targets
===================================================================
--- graphics/mesa-dri/Makefile.targets
+++ graphics/mesa-dri/Makefile.targets
@@ -1,36 +0,0 @@
-# $FreeBSD$
-#
-# this file holds common targets
-
-post-patch:
-.if ${OPSYS} == FreeBSD
- @${REINPLACE_CMD} -e 's|x86_64|amd64|' ${WRKSRC}/configure
-.endif
- @${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \
- ${WRKSRC}/src/util/xmlconfig.c
-
-pre-build: mesa-pre-build
-
-#custom targets so we can build parts of Mesa
-mesa-pre-build:
-# do propper gmake target.
- @cd ${WRKSRC}/src && ${MAKE_CMD} git_sha1.h libglsl_util.la
- @cd ${WRKSRC}/src/mesa/drivers/dri/common/ && ${MAKE_CMD}
- @cd ${WRKSRC}/src/loader && ${MAKE_CMD}
-# libloader.la
-
-.if defined(MESA_BUILD_WRKSRC)
-do-build:
-. for dir in ${MESA_BUILD_WRKSRC}
- (cd ${WRKSRC}/${dir}; ${DO_MAKE_BUILD} ${ALL_TARGET};)
-. endfor
-.endif
-
-.if defined(MESA_INSTALL_WRKSRC)
-do-install:
-. for dir in ${MESA_INSTALL_WRKSRC}
- (cd ${WRKSRC}/${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
- ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
-. endfor
-.endif
-
Index: graphics/mesa-dri/distinfo
===================================================================
--- graphics/mesa-dri/distinfo
+++ graphics/mesa-dri/distinfo
@@ -1,3 +0,0 @@
-TIMESTAMP = 1547724382
-SHA256 (mesa-18.3.2.tar.xz) = f7ce7181c07b6d8e0132da879af1729523a6c8aa87f79a9d59dfd064024cfb35
-SIZE (mesa-18.3.2.tar.xz) = 11868440
Index: graphics/mesa-dri/files/configure.ac
===================================================================
--- graphics/mesa-dri/files/configure.ac
+++ graphics/mesa-dri/files/configure.ac
@@ -1,66 +0,0 @@
---- configure.ac.orig 2018-11-09 11:03:00 UTC
-+++ configure.ac
-@@ -931,7 +931,7 @@ case "$host_os" in
- darwin*)
- ;;
- *)
-- AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
-+ AC_CHECK_FUNCS([clock_gettime clock_nanosleep], [CLOCK_LIB=],
- [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
- [AC_MSG_ERROR([Could not find clock_gettime])])])
- AC_SUBST([CLOCK_LIB])
-@@ -982,8 +982,12 @@ save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS"
- AC_MSG_CHECKING(whether pthread_setaffinity_np is supported)
- AC_LINK_IFELSE([AC_LANG_SOURCE([[
-+ #if defined(__DragonFly__) || defined(__FreeBSD__)
-+ #include <pthread_np.h>
-+ #else
- #define _GNU_SOURCE
- #include <pthread.h>
-+ #endif
- int main() {
- void *a = (void*) &pthread_setaffinity_np;
- long b = (long) a;
-@@ -995,7 +999,10 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([[
- LIBS="$save_LIBS"
-
- dnl Check for futex for fast inline simple_mtx_t.
--AC_CHECK_HEADER([linux/futex.h], [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"])
-+AC_CHECK_HEADERS([linux/futex.h sys/umtx.h],
-+ [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"],,
-+ [#include <errno.h>
-+ #include <sys/types.h>])
-
- dnl SELinux awareness.
- AC_ARG_ENABLE([selinux],
-@@ -1278,7 +1285,7 @@ fi
- AC_SUBST(LIBSENSORS_LIBS)
-
- case "$host_os" in
--linux*)
-+linux* | freebsd*)
- dri3_default=yes
- ;;
- *)
-@@ -1932,9 +1939,9 @@ fi
-
- if test x"$have_xlease" = xyes; then
- randr_modules="x11-xcb xcb-randr"
-- PKG_CHECK_MODULES([XCB_RANDR], [$randr_modules])
-+ PKG_CHECK_MODULES([XCB_RANDR], [$randr_modules],, [have_xlease=no])
- xlib_randr_modules="xrandr"
-- PKG_CHECK_MODULES([XLIB_RANDR], [$xlib_randr_modules])
-+ PKG_CHECK_MODULES([XLIB_RANDR], [$xlib_randr_modules],, [have_xlease=no])
- fi
-
- AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$platforms" | grep -q 'x11')
-@@ -2515,8 +2522,6 @@ if test "x$enable_opencl" = xyes; then
- CLANG_LIBDIR=${LLVM_LIBDIR}
- fi
- CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
-- AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
-- [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
- fi
- AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
- AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
Index: graphics/mesa-dri/files/extra-src_gallium_drivers_vc4_Makefile.in
===================================================================
--- graphics/mesa-dri/files/extra-src_gallium_drivers_vc4_Makefile.in
+++ graphics/mesa-dri/files/extra-src_gallium_drivers_vc4_Makefile.in
@@ -1,11 +0,0 @@
---- src/gallium/drivers/vc4/Makefile.in.orig 2017-10-02 15:49:15 UTC
-+++ src/gallium/drivers/vc4/Makefile.in
-@@ -677,7 +677,7 @@ noinst_LTLIBRARIES = libvc4.la $(am__app
- libvc4_la_SOURCES = $(C_SOURCES)
- libvc4_la_LIBADD = $(SIM_LIB) $(am__append_5)
- @HAVE_ARM_ASM_TRUE@libvc4_neon_la_SOURCES = $(NEON_C_SOURCES)
--@HAVE_ARM_ASM_TRUE@libvc4_neon_la_CFLAGS = $(AM_CFLAGS) -mfpu=neon
-+@HAVE_ARM_ASM_TRUE@libvc4_neon_la_CFLAGS = $(AM_CFLAGS) -march=armv7-a -mfpu=neon
- libvc4_la_LDFLAGS = $(SIM_LDFLAGS)
- EXTRA_DIST = kernel/README
- all: all-am
Index: graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c
===================================================================
--- graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c
+++ graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c
@@ -1,37 +0,0 @@
-# Partial revert of the following commit because the feature check fails on 10.x
-# which disables HW accel on gen4+ (the new check occurs for gen6+ as well)
-
-From 088449487ebcb72561d73ffb91c96302583445a8 Mon Sep 17 00:00:00 2001
-From: Kenneth Graunke <kenneth@whitecape.org>
-Date: Wed, 22 Mar 2017 15:20:51 -0700
-Subject: i965: Require Kernel 3.6 for Gen4-5 platforms.
-
-We've already required Kernel 3.6 on Gen6+ since Mesa 9.2 (May 2013,
-commit 92d2f5acfadea672417b6785710c9e8b7f605e41). It seems reasonable
-to require it for Gen4-5 as well, bumping the requirement from 2.6.39.
-
-This is necessary for glClientWaitSync with a timeout to work, which
-is a feature we expose on Gen4-5. Without it, we would fall back to an
-infinite wait, which is pretty bad.
-
-See kernel commit 172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+.
-
-Reviewed-by: Matt Turner <mattst88@gmail.com>
-
-diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
-index c7f111d..bc998ab 100644
---- src/mesa/drivers/dri/i965/intel_screen.c
-+++ src/mesa/drivers/dri/i965/intel_screen.c
-@@ -1776,8 +1776,8 @@ intel_init_bufmgr(struct intel_screen *screen)
- return false;
- }
-
-- if (!intel_get_boolean(screen, I915_PARAM_HAS_EXEC_NO_RELOC)) {
-- fprintf(stderr, "[%s: %u] Kernel 3.9 required.\n", __func__, __LINE__);
-+ if (!intel_get_boolean(screen, I915_PARAM_HAS_RELAXED_DELTA)) {
-+ fprintf(stderr, "[%s: %u] Kernel 2.6.39 required.\n", __func__, __LINE__);
- return false;
- }
-
---
-cgit v0.10.2
Index: graphics/mesa-dri/files/patch-9cab8cc.c
===================================================================
--- graphics/mesa-dri/files/patch-9cab8cc.c
+++ graphics/mesa-dri/files/patch-9cab8cc.c
@@ -1,17 +0,0 @@
-amd: Make vgpr-spilling depend on llvm version
-
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230789#c14
-diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c
-index 69d9f7b9f3fe9e5feb07b32c35cbcf1206a14ca8..dc9b684e9dd287d5bb558d9ad3868a9d0975228d 100644
---- src/amd/common/ac_llvm_util.c
-+++ src/amd/common/ac_llvm_util.c
-@@ -153,7 +153,8 @@ static LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family,
- LLVMTargetRef target = ac_get_llvm_target(triple);
-
- snprintf(features, sizeof(features),
-- "+DumpCode,+vgpr-spilling,-fp32-denormals,+fp64-denormals%s%s%s%s",
-+ "+DumpCode,-fp32-denormals,+fp64-denormals%s%s%s%s%s",
-+ HAVE_LLVM >= 0x0800 ? "" : ",+vgpr-spilling",
- tm_options & AC_TM_SISCHED ? ",+si-scheduler" : "",
- tm_options & AC_TM_FORCE_ENABLE_XNACK ? ",+xnack" : "",
- tm_options & AC_TM_FORCE_DISABLE_XNACK ? ",-xnack" : "",
Index: graphics/mesa-dri/files/patch-compat-include-guards
===================================================================
--- graphics/mesa-dri/files/patch-compat-include-guards
+++ graphics/mesa-dri/files/patch-compat-include-guards
@@ -1,64 +0,0 @@
-Partially revert https://cgit.freedesktop.org/mesa/mesa/commit/?id=f7d42ee7d319
-in order to allow ports like devel/allegro, devel/sdl{12,20}, graphics/glew,
-graphics/libepoxy, x11-toolkits/qt5-gui to skip <GL/glext.h> inclusion via <GL/gl.h>.
-
---- include/GLES2/gl2.h.orig 2018-11-09 11:03:00 UTC
-+++ include/GLES2/gl2.h
-@@ -1,5 +1,5 @@
--#ifndef __gles2_gl2_h_
--#define __gles2_gl2_h_ 1
-+#ifndef __gl2_h_
-+#define __gl2_h_ 1
-
- #ifdef __cplusplus
- extern "C" {
---- include/GLES2/gl2ext.h.orig 2018-11-09 11:03:00 UTC
-+++ include/GLES2/gl2ext.h
-@@ -1,5 +1,5 @@
--#ifndef __gles2_gl2ext_h_
--#define __gles2_gl2ext_h_ 1
-+#ifndef __gl2ext_h_
-+#define __gl2ext_h_ 1
-
- #ifdef __cplusplus
- extern "C" {
---- include/GLES3/gl3.h.orig 2018-11-09 11:03:00 UTC
-+++ include/GLES3/gl3.h
-@@ -1,5 +1,5 @@
--#ifndef __gles2_gl3_h_
--#define __gles2_gl3_h_ 1
-+#ifndef __gl3_h_
-+#define __gl3_h_ 1
-
- #ifdef __cplusplus
- extern "C" {
---- include/GL/glcorearb.h.orig 2018-11-09 11:03:00 UTC
-+++ include/GL/glcorearb.h
-@@ -1,5 +1,5 @@
--#ifndef __gl_glcorearb_h_
--#define __gl_glcorearb_h_ 1
-+#ifndef __glcorearb_h_
-+#define __glcorearb_h_ 1
-
- #ifdef __cplusplus
- extern "C" {
---- include/GL/glext.h.orig 2018-11-09 11:03:00 UTC
-+++ include/GL/glext.h
-@@ -1,5 +1,5 @@
--#ifndef __gl_glext_h_
--#define __gl_glext_h_ 1
-+#ifndef __glext_h_
-+#define __glext_h_ 1
-
- #ifdef __cplusplus
- extern "C" {
---- include/GL/glxext.h.orig 2018-11-09 11:03:00 UTC
-+++ include/GL/glxext.h
-@@ -1,5 +1,5 @@
--#ifndef __glx_glxext_h_
--#define __glx_glxext_h_ 1
-+#ifndef __glxext_h_
-+#define __glxext_h_ 1
-
- #ifdef __cplusplus
- extern "C" {
Index: graphics/mesa-dri/files/patch-configure
===================================================================
--- graphics/mesa-dri/files/patch-configure
+++ graphics/mesa-dri/files/patch-configure
@@ -1,153 +0,0 @@
---- configure.orig 2019-01-17 11:26:29 UTC
-+++ configure
-@@ -20767,7 +20767,7 @@ case "$host_os" in
- *-android*)
- android=yes
- ;;
--linux*|*-gnu*|gnu*|cygwin*)
-+linux*|*-gnu*|gnu*|cygwin*|freebsd*)
- DEFINES="$DEFINES -D_GNU_SOURCE"
- ;;
- solaris*)
-@@ -22648,12 +22648,13 @@ case "$host_os" in
- darwin*)
- ;;
- *)
-- for ac_func in clock_gettime
-+ for ac_func in clock_gettime clock_nanosleep
- do :
-- ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"
--if test "x$ac_cv_func_clock_gettime" = xyes; then :
-+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
--#define HAVE_CLOCK_GETTIME 1
-+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
- _ACEOF
- CLOCK_LIB=
- else
-@@ -23319,8 +23320,12 @@ $as_echo_n "checking whether pthread_setaffinity_np is
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
-+ #if defined(__DragonFly__) || defined(__FreeBSD__)
-+ #include <pthread_np.h>
-+ #else
- #define _GNU_SOURCE
- #include <pthread.h>
-+ #endif
- int main() {
- void *a = (void*) &pthread_setaffinity_np;
- long b = (long) a;
-@@ -23339,11 +23344,20 @@ rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS="$save_LIBS"
-
--ac_fn_c_check_header_mongrel "$LINENO" "linux/futex.h" "ac_cv_header_linux_futex_h" "$ac_includes_default"
--if test "x$ac_cv_header_linux_futex_h" = xyes; then :
-- DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"
-+for ac_header in linux/futex.h sys/umtx.h
-+do :
-+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include <errno.h>
-+ #include <sys/types.h>
-+"
-+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-+_ACEOF
-+ DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"
- fi
-
-+done
-
-
- # Check whether --enable-selinux was given.
-@@ -24241,7 +24255,7 @@ fi
-
-
- case "$host_os" in
--linux*)
-+linux* | freebsd*)
- dri3_default=yes
- ;;
- *)
-@@ -26542,31 +26556,11 @@ fi
- # Put the nasty error message in config.log where it belongs
- echo "$XCB_RANDR_PKG_ERRORS" >&5
-
-- as_fn_error $? "Package requirements ($randr_modules) were not met:
--
--$XCB_RANDR_PKG_ERRORS
--
--Consider adjusting the PKG_CONFIG_PATH environment variable if you
--installed software in a non-standard prefix.
--
--Alternatively, you may set the environment variables XCB_RANDR_CFLAGS
--and XCB_RANDR_LIBS to avoid the need to call pkg-config.
--See the pkg-config man page for more details." "$LINENO" 5
-+ have_xlease=no
- elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
- $as_echo "no" >&6; }
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
--$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
--as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
--is in your PATH or set the PKG_CONFIG environment variable to the full
--path to pkg-config.
--
--Alternatively, you may set the environment variables XCB_RANDR_CFLAGS
--and XCB_RANDR_LIBS to avoid the need to call pkg-config.
--See the pkg-config man page for more details.
--
--To get pkg-config, see <http://pkg-config.freedesktop.org/>.
--See \`config.log' for more details" "$LINENO" 5; }
-+ have_xlease=no
- else
- XCB_RANDR_CFLAGS=$pkg_cv_XCB_RANDR_CFLAGS
- XCB_RANDR_LIBS=$pkg_cv_XCB_RANDR_LIBS
-@@ -26634,31 +26628,11 @@ fi
- # Put the nasty error message in config.log where it belongs
- echo "$XLIB_RANDR_PKG_ERRORS" >&5
-
-- as_fn_error $? "Package requirements ($xlib_randr_modules) were not met:
--
--$XLIB_RANDR_PKG_ERRORS
--
--Consider adjusting the PKG_CONFIG_PATH environment variable if you
--installed software in a non-standard prefix.
--
--Alternatively, you may set the environment variables XLIB_RANDR_CFLAGS
--and XLIB_RANDR_LIBS to avoid the need to call pkg-config.
--See the pkg-config man page for more details." "$LINENO" 5
-+ have_xlease=no
- elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
- $as_echo "no" >&6; }
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
--$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
--as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
--is in your PATH or set the PKG_CONFIG environment variable to the full
--path to pkg-config.
--
--Alternatively, you may set the environment variables XLIB_RANDR_CFLAGS
--and XLIB_RANDR_LIBS to avoid the need to call pkg-config.
--See the pkg-config man page for more details.
--
--To get pkg-config, see <http://pkg-config.freedesktop.org/>.
--See \`config.log' for more details" "$LINENO" 5; }
-+ have_xlease=no
- else
- XLIB_RANDR_CFLAGS=$pkg_cv_XLIB_RANDR_CFLAGS
- XLIB_RANDR_LIBS=$pkg_cv_XLIB_RANDR_LIBS
-@@ -28694,9 +28668,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$
- CLANG_LIBDIR=${LLVM_LIBDIR}
- fi
- CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
-- if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then :
-- as_fn_error $? "Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries." "$LINENO" 5
--fi
- fi
- if test "x$enable_opencl" = xyes; then
- HAVE_CLOVER_TRUE=
Index: graphics/mesa-dri/files/patch-include_GL_internal_dri__interface.h
===================================================================
--- graphics/mesa-dri/files/patch-include_GL_internal_dri__interface.h
+++ graphics/mesa-dri/files/patch-include_GL_internal_dri__interface.h
@@ -1,19 +0,0 @@
-GCC on 9.x doesn't allow types to be overwritten, these types are defined
-in drm.h also, which causes build issues in xorg-server.
-
---- include/GL/internal/dri_interface.h.orig 2017-12-21 17:31:21 UTC
-+++ include/GL/internal/dri_interface.h
-@@ -40,13 +40,7 @@
- #ifndef DRI_INTERFACE_H
- #define DRI_INTERFACE_H
-
--#ifdef HAVE_LIBDRM
- #include <drm.h>
--#else
--typedef unsigned int drm_context_t;
--typedef unsigned int drm_drawable_t;
--typedef struct drm_clip_rect drm_clip_rect_t;
--#endif
-
- #include <stdint.h>
-
Index: graphics/mesa-dri/files/patch-src_amd_vulkan_radv__device.c
===================================================================
--- graphics/mesa-dri/files/patch-src_amd_vulkan_radv__device.c
+++ graphics/mesa-dri/files/patch-src_amd_vulkan_radv__device.c
@@ -1,19 +0,0 @@
-- Define CLOCK_MONOTONIC_RAW if missing
-
---- src/amd/vulkan/radv_device.c.orig 2018-11-06 16:16:02 UTC
-+++ src/amd/vulkan/radv_device.c
-@@ -50,6 +50,14 @@
- #include "util/debug.h"
- #include "util/mesa-sha1.h"
-
-+#ifndef CLOCK_MONOTONIC_RAW
-+# ifdef CLOCK_MONOTONIC_FAST
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
-+# else
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
-+# endif
-+#endif
-+
- static int
- radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
- {
Index: graphics/mesa-dri/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
===================================================================
--- graphics/mesa-dri/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
+++ graphics/mesa-dri/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
@@ -1,14 +0,0 @@
-- Define ETIME if missing
-
---- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig 2018-01-23 18:08:49 UTC
-+++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
-@@ -33,6 +33,9 @@
- #include "radv_amdgpu_bo.h"
- #include "sid.h"
-
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
-
- enum {
- VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024
Index: graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c
===================================================================
--- graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c
+++ graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c
@@ -1,16 +0,0 @@
-# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
-#
---- src/egl/drivers/dri2/platform_x11.c.orig 2018-01-23 18:08:49 UTC
-+++ src/egl/drivers/dri2/platform_x11.c
-@@ -1466,7 +1466,11 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp
-
- if (!disp->Options.ForceSoftware) {
- #ifdef HAVE_DRI3
-+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)
-+ if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false) && !env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
-+#else
- if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
-+#endif
- initialized = dri2_initialize_x11_dri3(drv, disp);
- #endif
-
Index: graphics/mesa-dri/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
===================================================================
--- graphics/mesa-dri/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
+++ graphics/mesa-dri/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
@@ -1,118 +0,0 @@
-Revert the following commit.
-
-FreeBSD and DragonFly don't have the required render nodes.
-
--------
-
-From 69a1b9959e59653da262185c4e2cf57d24939b19 Mon Sep 17 00:00:00 2001
-From: Emil Velikov <emil.l.velikov@gmail.com>
-Date: Mon, 29 Jun 2015 12:36:45 +0100
-Subject: pipe-loader: drop support for non-render node devices
-
-Render nodes have been around for quite some time. Removing support via
-the master/primary node allows us to clean up the conditional
-compilation and simplify the build greatly.
-
-For example currently we the pipe-loader, which explicitly links against
-xcb and friends (for X auth) if found at compile-time. That
-would cause problems as one will be forced to use X/xcb, even if it's a
-headless system that is used for opencl.
-
-v2: Clarify the linking topic in the commit message.
-
-Cc: Tom Stellard <thomas.stellard@amd.com>
-Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-Reviewed-by: Francisco Jerez <currojerez@riseup.net>
-
-
---- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2017-12-21 17:31:21 UTC
-+++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
-@@ -207,6 +207,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa
- }
-
- static int
-+open_drm_minor(int minor)
-+{
-+ char path[PATH_MAX];
-+ snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor);
-+ return open(path, O_RDWR, 0);
-+}
-+
-+static int
- open_drm_render_node_minor(int minor)
- {
- char path[PATH_MAX];
-@@ -218,8 +226,15 @@ open_drm_render_node_minor(int minor)
- int
- pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
- {
-- int i, j, fd;
-+ int i, k, fd, num_render_node_devs;
-+ int j = 0;
-+
-+ struct {
-+ unsigned vendor_id;
-+ unsigned chip_id;
-+ } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
-
-+ /* Look for render nodes first */
- for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
- i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
- struct pipe_loader_device *dev;
-@@ -233,6 +248,9 @@ pipe_loader_drm_probe(struct pipe_loader
- continue;
- }
-
-+ render_node_devs[j].vendor_id = dev->u.pci.vendor_id;
-+ render_node_devs[j].chip_id = dev->u.pci.chip_id;
-+
- if (j < ndev) {
- devs[j] = dev;
- } else {
-@@ -242,6 +260,46 @@ pipe_loader_drm_probe(struct pipe_loader
- j++;
- }
-
-+ num_render_node_devs = j;
-+
-+ /* Next look for drm devices. */
-+ for (i = 0; i < DRM_MAX_MINOR; i++) {
-+ struct pipe_loader_device *dev;
-+ boolean duplicate = FALSE;
-+ fd = open_drm_minor(i);
-+ if (fd < 0)
-+ continue;
-+
-+ if (!pipe_loader_drm_probe_fd(&dev, fd)) {
-+ close(fd);
-+ continue;
-+ }
-+
-+ /* Check to make sure we aren't already accessing this device via
-+ * render nodes.
-+ */
-+ for (k = 0; k < num_render_node_devs; k++) {
-+ if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id &&
-+ dev->u.pci.chip_id == render_node_devs[k].chip_id) {
-+ close(fd);
-+ dev->ops->release(&dev);
-+ duplicate = TRUE;
-+ break;
-+ }
-+ }
-+
-+ if (duplicate)
-+ continue;
-+
-+ if (j < ndev) {
-+ devs[j] = dev;
-+ } else {
-+ dev->ops->release(&dev);
-+ }
-+
-+ j++;
-+ }
-+
- return j;
- }
-
Index: graphics/mesa-dri/files/patch-src_gallium_drivers_freedreno_freedreno__screen.c
===================================================================
--- graphics/mesa-dri/files/patch-src_gallium_drivers_freedreno_freedreno__screen.c
+++ graphics/mesa-dri/files/patch-src_gallium_drivers_freedreno_freedreno__screen.c
@@ -1,30 +0,0 @@
-- Without sysinfo() fall back to sysconf()
-
---- src/gallium/drivers/freedreno/freedreno_screen.c.orig 2018-04-21 05:48:24 UTC
-+++ src/gallium/drivers/freedreno/freedreno_screen.c
-@@ -43,7 +43,11 @@
- #include <errno.h>
- #include <stdio.h>
- #include <stdlib.h>
-+#ifdef __GLIBC__
- #include <sys/sysinfo.h>
-+#else
-+#include <unistd.h>
-+#endif
-
- #include "freedreno_screen.h"
- #include "freedreno_resource.h"
-@@ -837,9 +841,13 @@ fd_screen_create(struct fd_device *dev)
- screen->priority_mask = (1 << val) - 1;
- }
-
-+#ifdef __GLIBC__
- struct sysinfo si;
- sysinfo(&si);
- screen->ram_size = si.totalram;
-+#else
-+ screen->ram_size = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
-+#endif
-
- DBG("Pipe Info:");
- DBG(" GPU-id: %d", screen->gpu_id);
Index: graphics/mesa-dri/files/patch-src_gallium_drivers_vc4_vc4__bufmgr.c
===================================================================
--- graphics/mesa-dri/files/patch-src_gallium_drivers_vc4_vc4__bufmgr.c
+++ graphics/mesa-dri/files/patch-src_gallium_drivers_vc4_vc4__bufmgr.c
@@ -1,14 +0,0 @@
-# define ETIME as ETIMEOUT same as in intel driver
-#
---- src/gallium/drivers/vc4/vc4_bufmgr.c.orig 2017-05-10 14:13:57 UTC
-+++ src/gallium/drivers/vc4/vc4_bufmgr.c
-@@ -27,6 +27,9 @@
- #include <fcntl.h>
- #include <xf86drm.h>
- #include <xf86drmMode.h>
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
-
- #include "util/u_hash_table.h"
- #include "util/u_memory.h"
Index: graphics/mesa-dri/files/patch-src_gallium_include_pipe_p__config.h
===================================================================
--- graphics/mesa-dri/files/patch-src_gallium_include_pipe_p__config.h
+++ graphics/mesa-dri/files/patch-src_gallium_include_pipe_p__config.h
@@ -1,38 +0,0 @@
---- src/gallium/include/pipe/p_config.h.orig 2017-10-02 15:49:02 UTC
-+++ src/gallium/include/pipe/p_config.h
-@@ -77,6 +77,13 @@
- #define PIPE_CC_ICL
- #endif
-
-+#if defined(__sparc__) || defined(__sparc64__)
-+#define PIPE_ARCH_SPARC
-+#if defined(__sparc64__)
-+#define PIPE_ARCH_SPARC_64
-+#endif
-+#endif
-+
-
- /*
- * Processor architecture
-@@ -131,7 +138,7 @@
-
- #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
- #define PIPE_ARCH_LITTLE_ENDIAN
--#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390)
-+#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_SPARC) || defined(PIPE_ARCH_SPARC_64)
- #define PIPE_ARCH_BIG_ENDIAN
- #endif
-
-@@ -160,6 +167,12 @@
- #define PIPE_OS_ANDROID
- #endif
-
-+#if defined(__DragonFly__)
-+#define PIPE_OS_DRAGONFLY
-+#define PIPE_OS_BSD
-+#define PIPE_OS_UNIX
-+#endif
-+
- #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
- #define PIPE_OS_FREEBSD
- #define PIPE_OS_BSD
Index: graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
===================================================================
--- graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
+++ graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
@@ -1,30 +0,0 @@
-# fix errors like the following
-#
-# llvm/invocation.cpp:(.text+0x1275): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::c_str()
- const'
-# /usr/bin/ld: ../../../../src/gallium/state_trackers/clover/.libs/libclover.a(libclllvm_la-invocation.o): relocation R_X86_64_PC32 against `_ZNKSt3__112bas
-ic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv' can not be used when making a shared object; recompile with -fPIC
-# /usr/bin/ld: final link failed: Bad value
-#
---- src/gallium/state_trackers/clover/llvm/invocation.cpp.orig 2017-04-01 15:33:37 UTC
-+++ src/gallium/state_trackers/clover/llvm/invocation.cpp
-@@ -93,6 +93,8 @@ namespace {
- return ctx;
- }
-
-+ const char* cstr(const std::string& str) { return str.c_str(); }
-+
- std::unique_ptr<clang::CompilerInstance>
- create_compiler_instance(const target &target,
- const std::vector<std::string> &opts,
-@@ -105,8 +107,8 @@ namespace {
- // Parse the compiler options. A file name should be present at the end
- // and must have the .cl extension in order for the CompilerInvocation
- // class to recognize it as an OpenCL source file.
-- const std::vector<const char *> copts =
-- map(std::mem_fn(&std::string::c_str), opts);
-+ std::vector<const char *> copts(opts.size());
-+ std::transform(opts.begin(), opts.end(), copts.begin(), cstr);
-
- if (!clang::CompilerInvocation::CreateFromArgs(
- c->getInvocation(), copts.data(), copts.data() + copts.size(), diag))
Index: graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp
===================================================================
--- graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp
+++ graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp
@@ -1,13 +0,0 @@
-# Fix error: no matching constructor for initialization of 'std::vector<const ::llvm::MDNode *>'
-#
---- src/gallium/state_trackers/clover/llvm/metadata.hpp.orig 2016-11-10 22:05:17 UTC
-+++ src/gallium/state_trackers/clover/llvm/metadata.hpp
-@@ -42,7 +42,7 @@ namespace clover {
- get_kernel_nodes(const ::llvm::Module &mod) {
- if (const ::llvm::NamedMDNode *n =
- mod.getNamedMetadata("opencl.kernels"))
-- return { n->op_begin(), n->op_end() };
-+ return { n->getOperand(0), n->getOperand(n->getNumOperands()) };
- else
- return {};
- }
Index: graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_util_range.hpp
===================================================================
--- graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_util_range.hpp
+++ graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_util_range.hpp
@@ -1,31 +0,0 @@
-From b95533b981af9a6687b41418e7cc2a5652fc2bdb Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= <dumbbell@FreeBSD.org>
-Date: Fri, 7 Mar 2014 15:16:08 +0100
-Subject: [PATCH 3/3] Work around for clang 3.4 which fails to build Clover
-
-See:
- https://bugs.freedesktop.org/show_bug.cgi?id=74098#c3
---- src/gallium/state_trackers/clover/util/range.hpp.orig 2016-11-10 22:05:17 UTC
-+++ src/gallium/state_trackers/clover/util/range.hpp
-@@ -362,6 +362,12 @@ namespace clover {
- return { i, i + n };
- }
-
-+ namespace detail {
-+ template<typename T>
-+ using fixup_function_type =
-+ typename std::conditional<std::is_function<T>::value, T &, T>::type;
-+ }
-+
- ///
- /// Create a range by transforming the contents of a number of
- /// source ranges \a rs element-wise using a provided functor \a f.
-@@ -369,7 +375,7 @@ namespace clover {
- /// \sa adaptor_range.
- ///
- template<typename F, typename... Rs>
-- adaptor_range<F, Rs...>
-+ adaptor_range<detail::fixup_function_type<F>, Rs...>
- map(F &&f, Rs &&... rs) {
- return { std::forward<F>(f), std::forward<Rs>(rs)... };
- }
Index: graphics/mesa-dri/files/patch-src_gallium_state__trackers_xvmc_Makefile.in
===================================================================
--- graphics/mesa-dri/files/patch-src_gallium_state__trackers_xvmc_Makefile.in
+++ graphics/mesa-dri/files/patch-src_gallium_state__trackers_xvmc_Makefile.in
@@ -1,11 +0,0 @@
---- src/gallium/state_trackers/xvmc/Makefile.in.orig 2019-10-21 15:12:43 UTC
-+++ src/gallium/state_trackers/xvmc/Makefile.in
-@@ -674,7 +674,7 @@ AM_CFLAGS = \
- noinst_LTLIBRARIES = libxvmctracker.la
- libxvmctracker_la_SOURCES = $(C_SOURCES)
- noinst_HEADERS = tests/testlib.h
--TEST_LIBS = $(XVMC_LIBS) -lXvMCW $(VL_LIBS) $(XCB_DRI3_LIBS)
-+TEST_LIBS = $(XVMC_LIBS) -lXv -lXvMCW $(VL_LIBS) $(XCB_DRI3_LIBS)
- tests_test_context_SOURCES = tests/test_context.c tests/testlib.c
- tests_test_context_LDADD = $(TEST_LIBS)
- tests_test_surface_SOURCES = tests/test_surface.c tests/testlib.c
Index: graphics/mesa-dri/files/patch-src_gallium_targets_xvmc_Makefile.in
===================================================================
--- graphics/mesa-dri/files/patch-src_gallium_targets_xvmc_Makefile.in
+++ graphics/mesa-dri/files/patch-src_gallium_targets_xvmc_Makefile.in
@@ -1,11 +0,0 @@
---- src/gallium/targets/xvmc/Makefile.in.orig 2019-10-21 16:05:11 UTC
-+++ src/gallium/targets/xvmc/Makefile.in
-@@ -718,7 +718,7 @@ libXvMCgallium_la_LIBADD = $(top_builddir)/src/gallium
- $(top_builddir)/src/gallium/auxiliary/libgalliumvlwinsys.la \
- $(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
- $(top_builddir)/src/gallium/auxiliary/libgallium.la \
-- $(top_builddir)/src/util/libmesautil.la $(XVMC_LIBS) \
-+ $(top_builddir)/src/util/libmesautil.la $(XVMC_LIBS) -lXv \
- $(VL_LIBS) $(XCB_DRI3_LIBS) $(LIBDRM_LIBS) \
- $(GALLIUM_COMMON_LIB_DEPS) $(am__append_13) $(am__append_14) \
- $(am__append_15)
Index: graphics/mesa-dri/files/patch-src_glx_glxext.c
===================================================================
--- graphics/mesa-dri/files/patch-src_glx_glxext.c
+++ graphics/mesa-dri/files/patch-src_glx_glxext.c
@@ -1,16 +0,0 @@
-# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
-#
---- src/glx/glxext.c.orig 2017-12-21 17:31:21 UTC
-+++ src/glx/glxext.c
-@@ -920,7 +920,11 @@ __glXInitialize(Display * dpy)
- #if defined(GLX_USE_DRM)
- if (glx_direct && glx_accel) {
- #if defined(HAVE_DRI3)
-+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)
-+ if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false) && !env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
-+#else
- if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
-+#endif
- dpyPriv->dri3Display = dri3_create_display(dpy);
- #endif /* HAVE_DRI3 */
- dpyPriv->dri2Display = dri2CreateDisplay(dpy);
Index: graphics/mesa-dri/files/patch-src_intel_Makefile.in
===================================================================
--- graphics/mesa-dri/files/patch-src_intel_Makefile.in
+++ graphics/mesa-dri/files/patch-src_intel_Makefile.in
@@ -1,18 +0,0 @@
-../../src/util/.libs/libmesautil.a(libmesautil_la-half_float.o): In function `_mesa_float_to_half':
-half_float.c:(.text+0x94): undefined reference to `lrintf'
-half_float.c:(.text+0xbf): undefined reference to `lrintf'
-cc: error: linker command failed with exit code 1 (use -v to see invocation)
-gmake[5]: *** [Makefile:2706: tools/aubinator_error_decode] Error 1
-
---- src/intel/Makefile.in.orig 2017-12-24 10:29:12 UTC
-+++ src/intel/Makefile.in
-@@ -1977,7 +1977,8 @@ tools_aubinator_error_decode_LDADD = \
- compiler/libintel_compiler.la \
- $(top_builddir)/src/util/libmesautil.la \
- $(PTHREAD_LIBS) \
-- $(ZLIB_LIBS)
-+ $(ZLIB_LIBS) \
-+ -lm
-
- tools_aubinator_error_decode_CFLAGS = \
- $(AM_CFLAGS) \
Index: graphics/mesa-dri/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
===================================================================
--- graphics/mesa-dri/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
+++ graphics/mesa-dri/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
@@ -1,18 +0,0 @@
-compiler/brw_fs_bank_conflicts.cpp:719:25: error: scalar initializer cannot be empty
- vector_type s_p = {}, s_n = {};
- ^~
-compiler/brw_fs_bank_conflicts.cpp:719:35: error: scalar initializer cannot be empty
- vector_type s_p = {}, s_n = {};
- ^~
-
---- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig 2018-01-23 18:08:50 UTC
-+++ src/intel/compiler/brw_fs_bank_conflicts.cpp
-@@ -716,7 +716,7 @@ namespace {
- const weight_vector_type &conflicts)
- {
- const unsigned m = DIV_ROUND_UP(conflicts.size, vector_width);
-- vector_type s_p = {}, s_n = {};
-+ vector_type s_p = {0}, s_n = {0};
-
- for (unsigned r = 0; r < m; r++) {
- s_p = adds(s_p, mask(bank_mask_p.v[r], conflicts.v[r]));
Index: graphics/mesa-dri/files/patch-src_intel_tools_aub__mem.c
===================================================================
--- graphics/mesa-dri/files/patch-src_intel_tools_aub__mem.c
+++ graphics/mesa-dri/files/patch-src_intel_tools_aub__mem.c
@@ -1,39 +0,0 @@
-- Partially implement memfd_create() via mkostemp()
-
---- src/intel/tools/aub_mem.c.orig 2018-11-06 16:16:02 UTC
-+++ src/intel/tools/aub_mem.c
-@@ -30,11 +30,34 @@
-
- #ifndef HAVE_MEMFD_CREATE
- #include <sys/syscall.h>
-+#include <fcntl.h>
-
- static inline int
- memfd_create(const char *name, unsigned int flags)
- {
-+#if defined(__linux__)
- return syscall(SYS_memfd_create, name, flags);
-+#elif defined(__FreeBSD__)
-+ return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600);
-+#else /* DragonFly, NetBSD, OpenBSD, Solaris */
-+ char template[] = "/tmp/shmfd-XXXXXX";
-+#ifdef HAVE_MKOSTEMP
-+ int fd = mkostemp(template, flags);
-+#else
-+ int fd = mkstemp(template);
-+ if (flags & O_CLOEXEC) {
-+ int flags = fcntl(fd, F_GETFD);
-+ if (flags != -1) {
-+ flags |= FD_CLOEXEC;
-+ (void) fcntl(fd, F_SETFD, &flags);
-+ }
-+ }
-+#endif /* HAVE_MKOSTEMP */
-+ if (fd >= 0)
-+ unlink(template);
-+
-+ return fd;
-+#endif /* __linux__ */
- }
- #endif
-
Index: graphics/mesa-dri/files/patch-src_intel_tools_aubinator__error__decode.c
===================================================================
--- graphics/mesa-dri/files/patch-src_intel_tools_aubinator__error__decode.c
+++ graphics/mesa-dri/files/patch-src_intel_tools_aubinator__error__decode.c
@@ -1,14 +0,0 @@
-# expose getline in FreeBSD's stdio.h
-#
---- src/intel/tools/aubinator_error_decode.c.orig 2017-05-10 14:13:57 UTC
-+++ src/intel/tools/aubinator_error_decode.c
-@@ -22,6 +22,9 @@
- *
- */
-
-+#if defined(__FreeBSD__) && __FreeBSD__ < 12
-+#define _WITH_GETLINE
-+#endif
- #include <stdbool.h>
- #include <stdio.h>
- #include <stdlib.h>
Index: graphics/mesa-dri/files/patch-src_intel_tools_error2aub.c
===================================================================
--- graphics/mesa-dri/files/patch-src_intel_tools_error2aub.c
+++ graphics/mesa-dri/files/patch-src_intel_tools_error2aub.c
@@ -1,14 +0,0 @@
-# expose getline in FreeBSD's stdio.h
-#
---- src/intel/tools/error2aub.c.orig 2018-08-09 00:34:30 UTC
-+++ src/intel/tools/error2aub.c
-@@ -26,6 +26,9 @@
- #include <getopt.h>
- #include <inttypes.h>
- #include <signal.h>
-+#if defined(__FreeBSD__) && __FreeBSD__ < 12
-+#define _WITH_GETLINE
-+#endif
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
Index: graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c
===================================================================
--- graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c
+++ graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c
@@ -1,57 +0,0 @@
-- Partially implement memfd_create() via mkostemp()
-- Ignore MAP_POPULATE if unsupported
-
---- src/intel/vulkan/anv_allocator.c.orig 2018-01-23 18:08:50 UTC
-+++ src/intel/vulkan/anv_allocator.c
-@@ -25,9 +25,21 @@
- #include <unistd.h>
- #include <limits.h>
- #include <assert.h>
-+#ifdef __linux__
- #include <linux/memfd.h>
-+#else
-+#include <fcntl.h>
-+#endif
- #include <sys/mman.h>
-
-+#ifndef MAP_POPULATE
-+#define MAP_POPULATE 0
-+#endif
-+
-+#ifndef MFD_CLOEXEC
-+#define MFD_CLOEXEC O_CLOEXEC
-+#endif
-+
- #include "anv_private.h"
-
- #include "util/hash_table.h"
-@@ -113,7 +125,29 @@ struct anv_mmap_cleanup {
- static inline int
- memfd_create(const char *name, unsigned int flags)
- {
-+#if defined(__linux__)
- return syscall(SYS_memfd_create, name, flags);
-+#elif defined(__FreeBSD__)
-+ return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600);
-+#else /* DragonFly, NetBSD, OpenBSD, Solaris */
-+ char template[] = "/tmp/shmfd-XXXXXX";
-+#ifdef HAVE_MKOSTEMP
-+ int fd = mkostemp(template, flags);
-+#else
-+ int fd = mkstemp(template);
-+ if (flags & O_CLOEXEC) {
-+ int flags = fcntl(fd, F_GETFD);
-+ if (flags != -1) {
-+ flags |= FD_CLOEXEC;
-+ (void) fcntl(fd, F_SETFD, &flags);
-+ }
-+ }
-+#endif /* HAVE_MKOSTEMP */
-+ if (fd >= 0)
-+ unlink(template);
-+
-+ return fd;
-+#endif /* __linux__ */
- }
- #endif
-
Index: graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c
===================================================================
--- graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c
+++ graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c
@@ -1,50 +0,0 @@
-- Without sysinfo() fall back to sysconf()
-- Define ETIME if missing
-- Define CLOCK_MONOTONIC_RAW if missing
-
---- src/intel/vulkan/anv_device.c.orig 2018-11-06 16:16:02 UTC
-+++ src/intel/vulkan/anv_device.c
-@@ -25,7 +25,9 @@
- #include <stdbool.h>
- #include <string.h>
- #include <sys/mman.h>
-+#ifdef __GLIBC__
- #include <sys/sysinfo.h>
-+#endif
- #include <unistd.h>
- #include <fcntl.h>
- #include <xf86drm.h>
-@@ -44,6 +46,17 @@
-
- #include "genxml/gen7_pack.h"
-
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
-+#ifndef CLOCK_MONOTONIC_RAW
-+# ifdef CLOCK_MONOTONIC_FAST
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
-+# else
-+# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
-+# endif
-+#endif
-+
- static void
- compiler_debug_log(void *data, const char *fmt, ...)
- { }
-@@ -64,10 +73,15 @@ static VkResult
- anv_compute_heap_size(int fd, uint64_t gtt_size, uint64_t *heap_size)
- {
- /* Query the total ram from the system */
-+#ifdef __GLIBC__
- struct sysinfo info;
- sysinfo(&info);
-
- uint64_t total_ram = (uint64_t)info.totalram * (uint64_t)info.mem_unit;
-+#else
-+ uint64_t total_ram = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
-+#endif
-+
-
- /* We don't want to burn too much ram with the GPU. If the user has 4GiB
- * or less, we use at most half. If they have more than 4GiB, we use 3/4.
Index: graphics/mesa-dri/files/patch-src_intel_vulkan_anv__gem.c
===================================================================
--- graphics/mesa-dri/files/patch-src_intel_vulkan_anv__gem.c
+++ graphics/mesa-dri/files/patch-src_intel_vulkan_anv__gem.c
@@ -1,14 +0,0 @@
-- Define ETIME if missing
-
---- src/intel/vulkan/anv_gem.c.orig 2017-10-23 13:21:18 UTC
-+++ src/intel/vulkan/anv_gem.c
-@@ -26,6 +26,9 @@
- #include <sys/mman.h>
- #include <string.h>
- #include <errno.h>
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
- #include <unistd.h>
- #include <fcntl.h>
-
Index: graphics/mesa-dri/files/patch-src_intel_vulkan_anv__queue.c
===================================================================
--- graphics/mesa-dri/files/patch-src_intel_vulkan_anv__queue.c
+++ graphics/mesa-dri/files/patch-src_intel_vulkan_anv__queue.c
@@ -1,18 +0,0 @@
-- Define ETIME if missing
-- Drop header that was never used
-
---- src/intel/vulkan/anv_queue.c.orig 2017-10-23 13:21:18 UTC
-+++ src/intel/vulkan/anv_queue.c
-@@ -26,8 +26,11 @@
- */
-
- #include <fcntl.h>
-+#include <errno.h>
-+#ifndef ETIME
-+#define ETIME ETIMEDOUT
-+#endif
- #include <unistd.h>
--#include <sys/eventfd.h>
-
- #include "anv_private.h"
- #include "vk_util.h"
Index: graphics/mesa-dri/files/patch-src_mapi_glapi_gen_gl__gentable.py
===================================================================
--- graphics/mesa-dri/files/patch-src_mapi_glapi_gen_gl__gentable.py
+++ graphics/mesa-dri/files/patch-src_mapi_glapi_gen_gl__gentable.py
@@ -1,11 +0,0 @@
---- src/mapi/glapi/gen/gl_gentable.py.orig 2017-05-15 12:05:59 UTC
-+++ src/mapi/glapi/gen/gl_gentable.py
-@@ -43,7 +43,7 @@ header = """/* GLXEXT is the define used
- #endif
-
- #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
-- || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__))
-+ || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__))
- #define USE_BACKTRACE
- #endif
-
Index: graphics/mesa-dri/files/patch-src_util_build__id.c
===================================================================
--- graphics/mesa-dri/files/patch-src_util_build__id.c
+++ graphics/mesa-dri/files/patch-src_util_build__id.c
@@ -1,15 +0,0 @@
-# Elf_ doesn't exist, use Elf32_ or Elf64_
-#
---- src/util/build_id.c.orig 2017-12-21 17:31:22 UTC
-+++ src/util/build_id.c
-@@ -38,6 +38,10 @@
- #define ElfW(type) Elf_##type
- #endif
-
-+#if defined(__FreeBSD__) && __FreeBSD__ < 12
-+typedef Elf_Note Elf_Nhdr;
-+#endif
-+
- struct build_id_note {
- ElfW(Nhdr) nhdr;
-
Index: graphics/mesa-dri/files/patch-src_util_futex.h
===================================================================
--- graphics/mesa-dri/files/patch-src_util_futex.h
+++ graphics/mesa-dri/files/patch-src_util_futex.h
@@ -1,45 +0,0 @@
-- Implement futex_wake() and futex_wait() via _umtx_op()
-
---- src/util/futex.h.orig 2018-09-24 16:00:57 UTC
-+++ src/util/futex.h
-@@ -29,10 +29,32 @@
- #include <limits.h>
- #include <stdint.h>
- #include <unistd.h>
-+#if defined(__FreeBSD__)
-+#include <errno.h>
-+#include <sys/umtx.h>
-+#else
- #include <linux/futex.h>
- #include <sys/syscall.h>
-+#endif
- #include <sys/time.h>
-
-+#if defined(__FreeBSD__)
-+static inline int futex_wake(uint32_t *addr, int count)
-+{
-+ return _umtx_op(addr, UMTX_OP_WAKE, (uint32_t)count, NULL, NULL) == -1 ? errno : 0;
-+}
-+
-+static inline int futex_wait(uint32_t *addr, int32_t value, struct timespec *timeout)
-+{
-+ void *uaddr = NULL, *uaddr2 = NULL;
-+ if (timeout != NULL) {
-+ const struct _umtx_time tmo = { ._timeout = *timeout, ._flags = UMTX_ABSTIME, ._clockid = CLOCK_MONOTONIC };
-+ uaddr = (void *)(uintptr_t)sizeof(tmo);
-+ uaddr2 = (void *)&tmo;
-+ }
-+ return _umtx_op(addr, UMTX_OP_WAIT_UINT, (uint32_t)value, uaddr, uaddr2) == -1 ? errno : 0;
-+}
-+#else
- static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3)
- {
- return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
-@@ -50,6 +72,7 @@ static inline int futex_wait(uint32_t *addr, int32_t v
- return sys_futex(addr, FUTEX_WAIT_BITSET, value, timeout, NULL,
- FUTEX_BITSET_MATCH_ANY);
- }
-+#endif
-
- #endif
-
Index: graphics/mesa-dri/files/patch-src_util_os__time.c
===================================================================
--- graphics/mesa-dri/files/patch-src_util_os__time.c
+++ graphics/mesa-dri/files/patch-src_util_os__time.c
@@ -1,13 +0,0 @@
-- Use monotonic clock for timeouts
-
---- src/util/os_time.c.orig 2018-04-21 05:48:25 UTC
-+++ src/util/os_time.c
-@@ -95,7 +95,7 @@ os_time_get_nano(void)
- void
- os_time_sleep(int64_t usecs)
- {
--#if defined(PIPE_OS_LINUX)
-+#if defined(HAVE_CLOCK_NANOSLEEP)
- struct timespec time;
- time.tv_sec = usecs / 1000000;
- time.tv_nsec = (usecs % 1000000) * 1000;
Index: graphics/mesa-dri/files/patch-src_util_u__thread.h
===================================================================
--- graphics/mesa-dri/files/patch-src_util_u__thread.h
+++ graphics/mesa-dri/files/patch-src_util_u__thread.h
@@ -1,42 +0,0 @@
-- Implement setting thread name
-- Use monotonic clock for timeouts
-
---- src/util/u_thread.h.orig 2018-11-09 11:03:00 UTC
-+++ src/util/u_thread.h
-@@ -34,7 +34,14 @@
-
- #ifdef HAVE_PTHREAD
- #include <signal.h>
-+#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
-+#include <pthread_np.h>
-+# if !defined(__DragonFly__)
-+# define cpu_set_t cpuset_t
-+# endif
-+#undef ALIGN /* Avoid conflict on FreeBSD in main/macros.h */
- #endif
-+#endif
-
- static inline thrd_t u_thread_create(int (*routine)(void *), void *param)
- {
-@@ -64,6 +69,12 @@ static inline void u_thread_setname( const char *name
- (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12)) && \
- defined(__linux__)
- pthread_setname_np(pthread_self(), name);
-+# elif defined(__sun)
-+ pthread_setname_np(pthread_self(), name);
-+# elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
-+ pthread_set_name_np(pthread_self(), name);
-+# elif defined(__NetBSD__)
-+ pthread_setname_np(pthread_self(), "%s", (void*)name);
- # endif
- #endif
- (void)name;
-@@ -134,7 +145,7 @@ util_get_L3_for_pinned_thread(thrd_t thread, unsigned
- static inline int64_t
- u_thread_get_time_nano(thrd_t thread)
- {
--#if defined(__linux__) && defined(HAVE_PTHREAD)
-+#if defined(HAVE_PTHREAD)
- struct timespec ts;
- clockid_t cid;
-
Index: graphics/mesa-dri/pkg-descr
===================================================================
--- graphics/mesa-dri/pkg-descr
+++ graphics/mesa-dri/pkg-descr
@@ -1,7 +0,0 @@
-This package contains the current stable release of the client drivers for DRI2+
-
-With a X Server configured for DRI, they allow direct rendering of hardware-
-accelerated OpenGL. This package also includes the software renderer, either
-llvmpipe or classic SWrast.
-
-WWW: https://www.mesa3d.org/
Index: graphics/mesa-dri/pkg-help
===================================================================
--- graphics/mesa-dri/pkg-help
+++ graphics/mesa-dri/pkg-help
@@ -1,5 +0,0 @@
-VAAPI and VDPAU options enable building Gallium based VA-API and VDPAU
-drivers to decode video on the GPU via libva and libvdpau, respectively.
-Gallium based VAAPI and VDPAU drivers are only available for Radeon GPUs.
-
-VAAPI and VDPAU on FreeBSD require graphics/drm-kmod.
Index: graphics/mesa-dri/pkg-plist
===================================================================
--- graphics/mesa-dri/pkg-plist
+++ graphics/mesa-dri/pkg-plist
@@ -1,93 +0,0 @@
-@comment include/EGL/egl.h
-@comment include/EGL/eglext.h
-@comment include/EGL/eglextchromium.h
-@comment include/EGL/eglmesaext.h
-@comment include/EGL/eglplatform.h
-@comment include/GL/gl.h
-@comment include/GL/gl_mangle.h
-@comment include/GL/glcorearb.h
-@comment include/GL/glext.h
-@comment include/GL/glx.h
-@comment include/GL/glx_mangle.h
-@comment include/GL/glxext.h
-include/GL/internal/dri_interface.h
-@comment include/GL/osmesa.h
-@comment include/GLES2/gl2.h
-@comment include/GLES2/gl2ext.h
-@comment include/GLES2/gl2platform.h
-@comment include/GLES3/gl3.h
-@comment include/GLES3/gl31.h
-@comment include/GLES3/gl32.h
-@comment include/GLES3/gl3ext.h
-@comment include/GLES3/gl3platform.h
-@comment include/KHR/khrplatform.h
-@comment include/gbm.h
-%%INTEL_VDRIVER%%include/vulkan/vulkan_intel.h
-%%I915_DRIVER%%lib/dri/i915_dri.so
-%%I965_DRIVER%%lib/dri/i965_dri.so
-%%FREEDRENO_GDRIVER%%lib/dri/kgsl_dri.so
-%%SWRAST_GDRIVER%%lib/dri/kms_swrast_dri.so
-%%FREEDRENO_GDRIVER%%lib/dri/msm_dri.so
-%%R200_DRIVER%%lib/dri/r200_dri.so
-%%R300_GDRIVER%%lib/dri/r300_dri.so
-%%R600_GDRIVER%%lib/dri/r600_dri.so
-%%VAAPI%%%%R600_GDRIVER%%lib/dri/r600_drv_video.so
-%%RADEON_DRIVER%%lib/dri/radeon_dri.so
-%%RADEONSI_GDRIVER%%lib/dri/radeonsi_dri.so
-%%VAAPI%%%%RADEONSI_GDRIVER%%lib/dri/radeonsi_drv_video.so
-%%SWRAST_DRIVER%%lib/dri/swrast_dri.so
-%%VC4_GDRIVER%%lib/dri/vc4_dri.so
-%%SVGA_GDRIVER%%lib/dri/vmwgfx_dri.so
-@comment lib/gallium-pipe/pipe_r300.so
-@comment lib/gallium-pipe/pipe_r600.so
-@comment lib/gallium-pipe/pipe_radeonsi.so
-@comment lib/gallium-pipe/pipe_swrast.so
-@comment lib/gallium-pipe/pipe_vmwgfx.so
-@comment lib/libEGL.so
-@comment lib/libEGL.so.1
-@comment lib/libEGL.so.1.0.0
-@comment lib/libGL.so
-@comment lib/libGL.so.1
-@comment lib/libGL.so.1.2.0
-@comment lib/libGLESv2.so
-@comment lib/libGLESv2.so.2
-@comment lib/libGLESv2.so.2.0.0
-@comment lib/libMesaOpenCL.so
-@comment lib/libMesaOpenCL.so.1
-@comment lib/libMesaOpenCL.so.1.0.0
-@comment lib/libOSMesa.so
-@comment lib/libOSMesa.so.8
-@comment lib/libOSMesa.so.8.0.0
-%%R600_GDRIVER%%lib/libXvMCr600.so
-%%R600_GDRIVER%%lib/libXvMCr600.so.1
-%%R600_GDRIVER%%lib/libXvMCr600.so.1.0
-%%R600_GDRIVER%%lib/libXvMCr600.so.1.0.0
-@comment lib/libgbm.so
-@comment lib/libgbm.so.1
-@comment lib/libgbm.so.1.0.0
-@comment lib/libglapi.so
-@comment lib/libglapi.so.0
-@comment lib/libglapi.so.0.0.0
-%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so
-%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1
-%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1.0
-%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1.0.0
-%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so
-%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1
-%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1.0
-%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1.0.0
-%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so
-%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1
-%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0
-%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0.0
-%%INTEL_VDRIVER%%lib/libvulkan_intel.so
-%%RADEON_VDRIVER%%lib/libvulkan_radeon.so
-libdata/pkgconfig/dri.pc
-@comment libdata/pkgconfig/egl.pc
-@comment libdata/pkgconfig/gbm.pc
-@comment libdata/pkgconfig/gl.pc
-@comment libdata/pkgconfig/glesv2.pc
-@comment libdata/pkgconfig/osmesa.pc
-share/drirc.d/00-mesa-defaults.conf
-%%INTEL_VDRIVER%%share/vulkan/icd.d/intel_icd.%%ARCH%%.json
-%%RADEON_VDRIVER%%share/vulkan/icd.d/radeon_icd.%%ARCH%%.json
Index: graphics/mesa-libs/Makefile
===================================================================
--- graphics/mesa-libs/Makefile
+++ graphics/mesa-libs/Makefile
@@ -1,55 +0,0 @@
-# Created by: Eric Anholt <anholt@FreeBSD.org>
-# $FreeBSD$
-
-PORTNAME= mesa-libs
-PORTVERSION= ${MESAVERSION}
-PORTREVISION= 3
-CATEGORIES= graphics
-
-COMMENT= OpenGL libraries that support GLX and EGL clients
-
-USE_XORG= xorgproto x11 xcb xdamage xext \
- xfixes xshmfence xxf86vm
-
-OPTIONS_DEFINE= WAYLAND
-OPTIONS_DEFAULT=WAYLAND
-OPTIONS_SUB= yes
-
-WAYLAND_DESC= Enable support for the Wayland platform in EGL
-WAYLAND_BUILD_DEPENDS= wayland-protocols>=1.8:graphics/wayland-protocols
-WAYLAND_LIB_DEPENDS= libwayland-egl.so:graphics/wayland
-
-.include <bsd.port.options.mk>
-.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
-
-CONFIGURE_ARGS+= --with-dri-drivers="" --with-gallium-drivers=""
-
-.if ${PORT_OPTIONS:MWAYLAND}
-CONFIGURE_ARGS+= --with-platforms=x11,surfaceless,drm,wayland
-.endif
-
-MESA_BUILD_WRKSRC= src/mapi src/util
-MESA_INSTALL_WRKSRC= src/mapi
-
-.if ${PORT_OPTIONS:MWAYLAND}
-MESA_BUILD_WRKSRC+= src/egl/wayland/wayland-drm
-.endif
-
-MESA_BUILD_WRKSRC+= src/gbm src/glx
-MESA_INSTALL_WRKSRC+= src/gbm src/glx
-
-MESA_BUILD_WRKSRC+= src/egl
-MESA_INSTALL_WRKSRC+= src/egl
-
-.if ${ARCH} == "i386"
-# PR230239 Fix the build for i386 when WITH_LLD_IS_LD is set
-LDFLAGS+=-Wl,-z,notext
-.endif
-
-.include "${MASTERDIR}/Makefile.targets"
-
-post-install:
- @cd ${WRKSRC}/src && ${SETENV} DESTDIR=${STAGEDIR} \
- ${MAKE_CMD} install-pkgconfigDATA install-glHEADERS install-glxHEADERS
-
-.include <bsd.port.post.mk>
Index: graphics/mesa-libs/pkg-descr
===================================================================
--- graphics/mesa-libs/pkg-descr
+++ graphics/mesa-libs/pkg-descr
@@ -1,5 +0,0 @@
-This package contains the Mesa OpenGL libraries for GLX and EGL clients.
-These include libEGL, libGL, and libglesv2 as well as utlity libraries
-libglapi and gbm.
-
-WWW: https://www.mesa3d.org/
Index: graphics/mesa-libs/pkg-plist
===================================================================
--- graphics/mesa-libs/pkg-plist
+++ graphics/mesa-libs/pkg-plist
@@ -1,42 +0,0 @@
-@comment etc/drirc
-include/EGL/egl.h
-include/EGL/eglext.h
-include/EGL/eglextchromium.h
-include/EGL/eglmesaext.h
-include/EGL/eglplatform.h
-include/GL/gl.h
-include/GL/gl_mangle.h
-include/GL/glcorearb.h
-include/GL/glext.h
-include/GL/glx.h
-include/GL/glx_mangle.h
-include/GL/glxext.h
-include/GLES2/gl2.h
-include/GLES2/gl2ext.h
-include/GLES2/gl2platform.h
-include/GLES3/gl3.h
-include/GLES3/gl31.h
-include/GLES3/gl32.h
-include/GLES3/gl3ext.h
-include/GLES3/gl3platform.h
-include/KHR/khrplatform.h
-include/gbm.h
-lib/libEGL.so
-lib/libEGL.so.1
-lib/libEGL.so.1.0.0
-lib/libGL.so
-lib/libGL.so.1
-lib/libGL.so.1.2.0
-lib/libGLESv2.so
-lib/libGLESv2.so.2
-lib/libGLESv2.so.2.0.0
-lib/libgbm.so
-lib/libgbm.so.1
-lib/libgbm.so.1.0.0
-lib/libglapi.so
-lib/libglapi.so.0
-lib/libglapi.so.0.0.0
-libdata/pkgconfig/egl.pc
-libdata/pkgconfig/gbm.pc
-libdata/pkgconfig/gl.pc
-libdata/pkgconfig/glesv2.pc
Index: graphics/mesa/Makefile
===================================================================
--- graphics/mesa/Makefile
+++ graphics/mesa/Makefile
@@ -1,24 +1,22 @@
# Created by: Eric Anholt <anholt@FreeBSD.org>
# $FreeBSD$
-PORTNAME= mesa-dri
+PORTNAME= mesa
PORTVERSION= ${MESAVERSION}
-PORTREVISION= 9
CATEGORIES= graphics
COMMENT= OpenGL hardware acceleration drivers for DRI2+
-USE_XORG= xorgproto x11 xdamage xext xfixes xshmfence xv xvmc
+USE_XORG= xorgproto x11 xdamage xext xfixes xshmfence xv xvmc xrandr xxf86vm xcb
OPTIONS_DEFINE= VAAPI VDPAU WAYLAND
OPTIONS_DEFAULT=WAYLAND
OPTIONS_SUB= yes
-VAAPI_CONFIGURE_ENABLE= va
+VAAPI_MESON_TRUE= gallium-va
VAAPI_LIB_DEPENDS= libva.so:multimedia/libva
-VAAPI_USE= XORG=xcb
-VDPAU_CONFIGURE_ENABLE= vdpau
+VDPAU_MESON_TRUE= gallium-vdpau
VDPAU_LIB_DEPENDS= libvdpau.so:multimedia/libvdpau
WAYLAND_DESC= Enable support for the Wayland platform in Vulkan drivers
@@ -26,45 +24,43 @@
WAYLAND_LIB_DEPENDS= libwayland-client.so:graphics/wayland
.include <bsd.port.options.mk>
-.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
+.include "${.CURDIR:H:H}/graphics/mesa/Makefile.common"
-ALL_DRI_DRIVERS= I915 I965 RADEON R200 SWRAST
-ALL_GALLIUM_DRIVERS= FREEDRENO R300 R600 RADEONSI SVGA SWRAST VC4
-ALL_VULKAN_DRIVERS= INTEL RADEON
+# Mesa only understands x86_64 and x86 as arches, let it choose for Vulkan in PLIST
+.if ${ARCH} == amd64
+MESA_ARCH= x86_64
+.elif ${ARCH} == i386
+MESA_ARCH= x86
+.endif
-DRI_DRIVERS= SWRAST # classic swrast
+ALL_DRI_DRIVERS= i915 i965 r100 r200
+ALL_GALLIUM_DRIVERS= freedreno r300 r600 radeonsi svga swrast vc4
+ALL_VULKAN_DRIVERS= intel amd
+
+DRI_DRIVERS= #
+# Use Gallium as default provider for swrast
.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*}
-GALLIUM_DRIVERS= SWRAST # llvmpipe
+GALLIUM_DRIVERS= swrast
.else
-GALLIUM_DRIVERS= ""
+GALLIUM_DRIVERS= #
.endif
VULKAN_DRIVERS= #
-.if ${ARCH} == amd64 || ${ARCH} == i386 \
- || ${ARCH} == powerpc || ${ARCH} == powerpc64
-DRI_DRIVERS+= RADEON R200
-GALLIUM_DRIVERS+= R300 R600 RADEONSI
-VULKAN_DRIVERS+= RADEON
+.if ${ARCH} == amd64 || ${ARCH} == i386 || ${ARCH} == powerpc || ${ARCH} == powerpc64
+DRI_DRIVERS+= r100 r200
+GALLIUM_DRIVERS+= r300 r600 radeonsi
+VULKAN_DRIVERS+= amd
.endif
+
.if ${ARCH} == amd64 || ${ARCH} == i386
-DRI_DRIVERS+= I915 I965
-GALLIUM_DRIVERS+= SVGA
-. if ${OPSYS} == FreeBSD
-EXTRA_PATCHES+= ${PATCHDIR}/extra-src_mesa_drivers_dri_i965_intel__screen.c
-. endif
-VULKAN_DRIVERS+= INTEL
+DRI_DRIVERS+= i965 i915
+GALLIUM_DRIVERS+= svga
+VULKAN_DRIVERS+= intel
+
.elif ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7
-GALLIUM_DRIVERS+= FREEDRENO VC4
-. if ${ARCH} == armv6 || ${ARCH} == armv7
-EXTRA_PATCHES+= ${PATCHDIR}/extra-src_gallium_drivers_vc4_Makefile.in
-. endif
+GALLIUM_DRIVERS+= freedreno vc4
.endif
-.if ${VULKAN_DRIVERS}
-BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR}
-USE_XORG+= xcb xrandr
-.endif
-
LDFLAGS_i386= -Wl,-znotext
.if ${DRI_DRIVERS} || ${VULKAN_DRIVERS:MINTEL}
. if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld
@@ -74,15 +70,18 @@
. endif
.endif
-# enables VK_KHR_wayland_surface in Vulkan drivers
+# Enables VK_KHR_wayland_surface in Vulkan drivers
.if ${PORT_OPTIONS:MWAYLAND} && !empty(VULKAN_DRIVERS)
-CONFIGURE_ARGS+= --with-platforms=x11,surfaceless,drm,wayland
+MESON_ARGS+= -Dplatforms=x11,surfaceless,drm,wayland
.endif
-CONFIGURE_ARGS+= --with-dri-drivers="${DRI_DRIVERS:tl}" \
- --with-gallium-drivers="${GALLIUM_DRIVERS:tl}" \
- --with-vulkan-drivers="${VULKAN_DRIVERS:tl}"
+# XA is tracked by graphics/libxatracker
+MESON_ARGS+= -Dgallium-xa=false
+MESON_ARGS+= -Ddri-drivers="${DRI_DRIVERS:ts,}" \
+ -Dgallium-drivers="${GALLIUM_DRIVERS:ts,}" \
+ -Dvulkan-drivers="${VULKAN_DRIVERS:ts,}"
+
.for _d in ${ALL_DRI_DRIVERS}
. if ${DRI_DRIVERS:M${_d}}
PLIST_SUB+= ${_d}_DRIVER=""
@@ -101,15 +100,13 @@
.for _vd in ${ALL_VULKAN_DRIVERS}
. if ${VULKAN_DRIVERS:M${_vd}}
-PLIST_SUB+= ${_vd}_VDRIVER="" ARCH="${ARCH}"
+PLIST_SUB+= ${_vd}_VDRIVER="" ARCH="${MESA_ARCH}"
. else
PLIST_SUB+= ${_vd}_VDRIVER="@comment "
. endif
.endfor
-.include "${MASTERDIR}/Makefile.targets"
-
post-install:
@${RM} -r ${STAGEDIR}/etc/OpenCL
-
-.include <bsd.port.post.mk>
+ @${MKDIR} ${STAGEDIR}${PREFIX}/share/drirc.d
+ @${CP} ${WRKSRC}/src/util/00-mesa-defaults.conf ${STAGEDIR}/share/drirc.d
Index: graphics/mesa/Makefile.common
===================================================================
--- graphics/mesa/Makefile.common
+++ graphics/mesa/Makefile.common
@@ -5,8 +5,7 @@
# Remember to upgrade the following ports everytime you bump MESAVERSION:
#
# - graphics/libosmesa
-# - graphics/mesa-dri
-# - graphics/mesa-libs
+# - graphics/mesa
# - lang/clover
#
# $FreeBSD$
@@ -14,14 +13,12 @@
MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
-MESABASEVERSION= 18.3.2
+MESABASEVERSION= 19.2.8
# if there is a subversion, don't include the '-' between 7.11-rc2.
MESASUBVERSION=
MASTER_SITES= https://mesa.freedesktop.org/archive/ \
- https://mesa.freedesktop.org/archive/${MESABASEVERSION}/ \
- ftp://ftp.freedesktop.org/pub/mesa/ \
- ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/
+ https://mesa.freedesktop.org/archive/${MESABASEVERSION}/
DISTFILES= mesa-${MESADISTVERSION}${EXTRACT_SUFX}
@@ -29,7 +26,8 @@
COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//}
-BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
+BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs \
+ ${PYTHON_PKGNAMEPREFIX}mako>=0.8.0:textproc/py-mako@${PY_FLAVOR}
LIB_DEPENDS+= libexpat.so:textproc/expat2
.if ${COMPONENT} != clover
USES+= xorg
@@ -37,9 +35,7 @@
.if ${COMPONENT} != osmesa
LIB_DEPENDS+= libdrm.so:graphics/libdrm
.endif
-.if ${COMPONENT} != libs
-LIB_DEPENDS+= libglapi.so:graphics/mesa-libs
-.endif
+
.if ${ARCH} == amd64 || ${ARCH} == i386
LIB_DEPENDS+= libunwind.so:devel/libunwind
.endif
@@ -47,17 +43,16 @@
LIB_DEPENDS+= libelf.so:devel/libelf
.endif
-USES+= compiler:c++11-lib bison gettext-tools gmake libtool \
- localbase pathfix pkgconfig python:2.7,build shebangfix tar:xz
+USES+= bison compiler:c++11-lib gettext-tools localbase \
+ meson pathfix pkgconfig python:3.6+,build shebangfix tar:xz
USE_LDCONFIG= yes
-GNU_CONFIGURE= yes
# only have one port to check with portscout.
-.if ${PORTNAME} != mesa-dri
+.if ${PORTNAME} != mesa
PORTSCOUT= ignore:1
.endif
-python_OLD_CMD= /usr/bin/env[[:space:]]python2 /usr/bin/python2 /bin/env[[:space:]]python
+BINARY_ALIAS= python3=${PYTHON_CMD}
SHEBANG_FILES= src/gallium/*/*/*.py src/gallium/tools/trace/*.py \
src/gallium/drivers/svga/svgadump/svga_dump.py \
src/mapi/glapi/gen/*.py src/mapi/mapi_abi.py \
@@ -65,7 +60,7 @@
src/mesa/main/get_*.py src/util/format_srgb.py \
src/amd/*/*.py src/intel/genxml/gen_pack_header.py
-MASTERDIR= ${.CURDIR:H:H}/graphics/mesa-dri
+MASTERDIR= ${.CURDIR:H:H}/graphics/mesa
PATCHDIR= ${MASTERDIR}/files
WRKSRC= ${WRKDIR}/mesa-${MESADISTVERSION}
DESCR= ${.CURDIR}/pkg-descr
@@ -75,12 +70,6 @@
PKGDEINSTALL= ${.CURDIR}/pkg-deinstall
INSTALL_TARGET= install-strip
-.include <bsd.port.pre.mk>
-
-.if ${LLVM_DEFAULT:S,-devel,990,} >= 90
-LLVM_DEFAULT= 80
-.endif
-
.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*}
BUILD_DEPENDS+= llvm${LLVM_DEFAULT}>=3.9.0_4:devel/llvm${LLVM_DEFAULT}
.if ${COMPONENT} != libs
@@ -88,9 +77,9 @@
.endif
CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT}
LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${LLVM_DEFAULT}/lib
-CONFIGURE_ARGS+= --enable-llvm
+MESON_ARGS+= -Dllvm=true
.else
-CONFIGURE_ARGS+= --disable-llvm
+MESON_ARGS+= -Dllvm=false
.endif
# There are issues that need to be fixed to use TLS model "initial-exec"
@@ -99,8 +88,9 @@
# pthread_setspecific which it uses now by default. But since this
# configure switch is going away ...
# https://lists.freebsd.org/pipermail/freebsd-arch/2016-February/017699.html
-CONFIGURE_ARGS+= --disable-glx-tls
+#MESON_ARGS+= -Duse-elf-tls=false # maybe import this patch?
# we don't care about GLes v1
-CONFIGURE_ARGS+= --disable-gles1
+MESON_ARGS+= -Dgles1=false
+.include <bsd.port.mk>
Index: graphics/mesa/distinfo
===================================================================
--- graphics/mesa/distinfo
+++ graphics/mesa/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1547724382
-SHA256 (mesa-18.3.2.tar.xz) = f7ce7181c07b6d8e0132da879af1729523a6c8aa87f79a9d59dfd064024cfb35
-SIZE (mesa-18.3.2.tar.xz) = 11868440
+TIMESTAMP = 1578861811
+SHA256 (mesa-19.2.8.tar.xz) = cffa8fa755c7422ce014c39ca0b770a092d9e0bbae537ceb2609c106916e5a57
+SIZE (mesa-19.2.8.tar.xz) = 11462168
Index: graphics/mesa/files/patch-include_GL_internal_dri__interface.h
===================================================================
--- graphics/mesa/files/patch-include_GL_internal_dri__interface.h
+++ graphics/mesa/files/patch-include_GL_internal_dri__interface.h
@@ -1,7 +1,7 @@
GCC on 9.x doesn't allow types to be overwritten, these types are defined
in drm.h also, which causes build issues in xorg-server.
---- include/GL/internal/dri_interface.h.orig 2017-12-21 17:31:21 UTC
+--- include/GL/internal/dri_interface.h.orig 2019-12-18 19:04:21 UTC
+++ include/GL/internal/dri_interface.h
@@ -40,13 +40,7 @@
#ifndef DRI_INTERFACE_H
@@ -15,5 +15,5 @@
-typedef struct drm_clip_rect drm_clip_rect_t;
-#endif
- #include <stdint.h>
+ #include <GL/gl.h>
Index: graphics/mesa/files/patch-src_amd_vulkan_radv__device.c
===================================================================
--- graphics/mesa/files/patch-src_amd_vulkan_radv__device.c
+++ graphics/mesa/files/patch-src_amd_vulkan_radv__device.c
@@ -1,10 +1,10 @@
- Define CLOCK_MONOTONIC_RAW if missing
---- src/amd/vulkan/radv_device.c.orig 2018-11-06 16:16:02 UTC
+--- src/amd/vulkan/radv_device.c.orig 2019-12-18 19:04:21 UTC
+++ src/amd/vulkan/radv_device.c
-@@ -50,6 +50,14 @@
- #include "util/debug.h"
- #include "util/mesa-sha1.h"
+@@ -49,6 +49,14 @@
+ #include "compiler/glsl_types.h"
+ #include "util/xmlpool.h"
+#ifndef CLOCK_MONOTONIC_RAW
+# ifdef CLOCK_MONOTONIC_FAST
Index: graphics/mesa/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
===================================================================
--- graphics/mesa/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
+++ graphics/mesa/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
@@ -1,8 +1,8 @@
- Define ETIME if missing
---- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig 2018-01-23 18:08:49 UTC
+--- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig 2019-12-18 19:04:21 UTC
+++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
-@@ -33,6 +33,9 @@
+@@ -35,6 +35,9 @@
#include "radv_amdgpu_bo.h"
#include "sid.h"
Index: graphics/mesa/files/patch-src_egl_drivers_dri2_platform__x11.c
===================================================================
--- graphics/mesa/files/patch-src_egl_drivers_dri2_platform__x11.c
+++ graphics/mesa/files/patch-src_egl_drivers_dri2_platform__x11.c
@@ -1,8 +1,8 @@
# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
#
---- src/egl/drivers/dri2/platform_x11.c.orig 2018-01-23 18:08:49 UTC
+--- src/egl/drivers/dri2/platform_x11.c.orig 2019-12-18 19:04:21 UTC
+++ src/egl/drivers/dri2/platform_x11.c
-@@ -1466,7 +1466,11 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp
+@@ -1539,7 +1539,11 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp
if (!disp->Options.ForceSoftware) {
#ifdef HAVE_DRI3
Index: graphics/mesa/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
===================================================================
--- graphics/mesa/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
+++ graphics/mesa/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
@@ -25,9 +25,9 @@
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
---- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2017-12-21 17:31:21 UTC
+--- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2019-12-18 19:04:21 UTC
+++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
-@@ -207,6 +207,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa
+@@ -241,6 +241,14 @@ pipe_loader_drm_probe_fd(struct pipe_loader_device **d
}
static int
@@ -42,24 +42,24 @@
open_drm_render_node_minor(int minor)
{
char path[PATH_MAX];
-@@ -218,8 +226,15 @@ open_drm_render_node_minor(int minor)
+@@ -252,8 +260,15 @@ open_drm_render_node_minor(int minor)
int
pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
{
- int i, j, fd;
+ int i, k, fd, num_render_node_devs;
+ int j = 0;
-+
+
+ struct {
+ unsigned vendor_id;
+ unsigned chip_id;
+ } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
-
++
+ /* Look for render nodes first */
for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
struct pipe_loader_device *dev;
-@@ -233,6 +248,9 @@ pipe_loader_drm_probe(struct pipe_loader
+@@ -267,12 +282,55 @@ pipe_loader_drm_probe(struct pipe_loader_device **devs
continue;
}
@@ -69,10 +69,12 @@
if (j < ndev) {
devs[j] = dev;
} else {
-@@ -242,6 +260,46 @@ pipe_loader_drm_probe(struct pipe_loader
- j++;
- }
-
+ close(fd);
+ dev->ops->release(&dev);
+ }
++ j++;
++ }
++
+ num_render_node_devs = j;
+
+ /* Next look for drm devices. */
@@ -110,9 +112,6 @@
+ dev->ops->release(&dev);
+ }
+
-+ j++;
-+ }
-+
- return j;
- }
+ j++;
+ }
Index: graphics/mesa/files/patch-src_gallium_drivers_freedreno_freedreno__screen.c
===================================================================
--- graphics/mesa/files/patch-src_gallium_drivers_freedreno_freedreno__screen.c
+++ graphics/mesa/files/patch-src_gallium_drivers_freedreno_freedreno__screen.c
@@ -1,6 +1,6 @@
- Without sysinfo() fall back to sysconf()
---- src/gallium/drivers/freedreno/freedreno_screen.c.orig 2018-04-21 05:48:24 UTC
+--- src/gallium/drivers/freedreno/freedreno_screen.c.orig 2019-12-18 19:04:21 UTC
+++ src/gallium/drivers/freedreno/freedreno_screen.c
@@ -43,7 +43,11 @@
#include <errno.h>
@@ -14,8 +14,8 @@
#include "freedreno_screen.h"
#include "freedreno_resource.h"
-@@ -837,9 +841,13 @@ fd_screen_create(struct fd_device *dev)
- screen->priority_mask = (1 << val) - 1;
+@@ -853,9 +857,13 @@ fd_screen_create(struct fd_device *dev, struct rendero
+ screen->has_robustness = val;
}
+#ifdef __GLIBC__
Index: graphics/mesa/files/patch-src_gallium_include_pipe_p__config.h
===================================================================
--- graphics/mesa/files/patch-src_gallium_include_pipe_p__config.h
+++ graphics/mesa/files/patch-src_gallium_include_pipe_p__config.h
@@ -14,25 +14,3 @@
/*
* Processor architecture
-@@ -131,7 +138,7 @@
-
- #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
- #define PIPE_ARCH_LITTLE_ENDIAN
--#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390)
-+#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_SPARC) || defined(PIPE_ARCH_SPARC_64)
- #define PIPE_ARCH_BIG_ENDIAN
- #endif
-
-@@ -160,6 +167,12 @@
- #define PIPE_OS_ANDROID
- #endif
-
-+#if defined(__DragonFly__)
-+#define PIPE_OS_DRAGONFLY
-+#define PIPE_OS_BSD
-+#define PIPE_OS_UNIX
-+#endif
-+
- #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
- #define PIPE_OS_FREEBSD
- #define PIPE_OS_BSD
Index: graphics/mesa/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
===================================================================
--- graphics/mesa/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
+++ graphics/mesa/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
@@ -6,18 +6,18 @@
ic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv' can not be used when making a shared object; recompile with -fPIC
# /usr/bin/ld: final link failed: Bad value
#
---- src/gallium/state_trackers/clover/llvm/invocation.cpp.orig 2017-04-01 15:33:37 UTC
+--- src/gallium/state_trackers/clover/llvm/invocation.cpp.orig 2019-12-18 19:04:21 UTC
+++ src/gallium/state_trackers/clover/llvm/invocation.cpp
-@@ -93,6 +93,8 @@ namespace {
- return ctx;
+@@ -181,6 +181,8 @@ namespace {
+ return get_lang_standard_from_version_str(device_version);
}
+ const char* cstr(const std::string& str) { return str.c_str(); }
+
std::unique_ptr<clang::CompilerInstance>
- create_compiler_instance(const target &target,
+ create_compiler_instance(const device &dev,
const std::vector<std::string> &opts,
-@@ -105,8 +107,8 @@ namespace {
+@@ -193,8 +195,8 @@ namespace {
// Parse the compiler options. A file name should be present at the end
// and must have the .cl extension in order for the CompilerInvocation
// class to recognize it as an OpenCL source file.
@@ -26,5 +26,5 @@
+ std::vector<const char *> copts(opts.size());
+ std::transform(opts.begin(), opts.end(), copts.begin(), cstr);
- if (!clang::CompilerInvocation::CreateFromArgs(
- c->getInvocation(), copts.data(), copts.data() + copts.size(), diag))
+ const target &target = dev.ir_target();
+ const std::string &device_clc_version = dev.device_clc_version();
Index: graphics/mesa/files/patch-src_glx_glxext.c
===================================================================
--- graphics/mesa/files/patch-src_glx_glxext.c
+++ graphics/mesa/files/patch-src_glx_glxext.c
@@ -1,8 +1,8 @@
# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
#
---- src/glx/glxext.c.orig 2017-12-21 17:31:21 UTC
+--- src/glx/glxext.c.orig 2019-12-18 19:04:21 UTC
+++ src/glx/glxext.c
-@@ -920,7 +920,11 @@ __glXInitialize(Display * dpy)
+@@ -914,7 +914,11 @@ __glXInitialize(Display * dpy)
#if defined(GLX_USE_DRM)
if (glx_direct && glx_accel) {
#if defined(HAVE_DRI3)
Index: graphics/mesa/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
===================================================================
--- graphics/mesa/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
+++ graphics/mesa/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
@@ -5,9 +5,9 @@
vector_type s_p = {}, s_n = {};
^~
---- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig 2018-01-23 18:08:50 UTC
+--- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig 2019-12-18 19:04:21 UTC
+++ src/intel/compiler/brw_fs_bank_conflicts.cpp
-@@ -716,7 +716,7 @@ namespace {
+@@ -728,7 +728,7 @@ namespace {
const weight_vector_type &conflicts)
{
const unsigned m = DIV_ROUND_UP(conflicts.size, vector_width);
Index: graphics/mesa/files/patch-src_intel_vulkan_anv__device.c
===================================================================
--- graphics/mesa/files/patch-src_intel_vulkan_anv__device.c
+++ graphics/mesa/files/patch-src_intel_vulkan_anv__device.c
@@ -2,7 +2,7 @@
- Define ETIME if missing
- Define CLOCK_MONOTONIC_RAW if missing
---- src/intel/vulkan/anv_device.c.orig 2018-11-06 16:16:02 UTC
+--- src/intel/vulkan/anv_device.c.orig 2019-12-18 19:04:21 UTC
+++ src/intel/vulkan/anv_device.c
@@ -25,7 +25,9 @@
#include <stdbool.h>
@@ -14,10 +14,10 @@
#include <unistd.h>
#include <fcntl.h>
#include <xf86drm.h>
-@@ -44,6 +46,17 @@
+@@ -60,6 +62,17 @@ DRI_CONF_END;
+ */
+ #define MAX_DEBUG_MESSAGE_LENGTH 4096
- #include "genxml/gen7_pack.h"
-
+#ifndef ETIME
+#define ETIME ETIMEDOUT
+#endif
@@ -31,9 +31,9 @@
+
static void
compiler_debug_log(void *data, const char *fmt, ...)
- { }
-@@ -64,10 +73,15 @@ static VkResult
- anv_compute_heap_size(int fd, uint64_t gtt_size, uint64_t *heap_size)
+ {
+@@ -96,10 +109,15 @@ static uint64_t
+ anv_compute_heap_size(int fd, uint64_t gtt_size)
{
/* Query the total ram from the system */
+#ifdef __GLIBC__
Index: graphics/mesa/files/patch-src_intel_vulkan_anv__queue.c
===================================================================
--- graphics/mesa/files/patch-src_intel_vulkan_anv__queue.c
+++ graphics/mesa/files/patch-src_intel_vulkan_anv__queue.c
@@ -1,18 +1,15 @@
- Define ETIME if missing
-- Drop header that was never used
---- src/intel/vulkan/anv_queue.c.orig 2017-10-23 13:21:18 UTC
-+++ src/intel/vulkan/anv_queue.c
-@@ -26,8 +26,11 @@
- */
+--- src/intel/vulkan/anv_queue.c.orig 2020-01-14 09:25:11.334523000 +0100
++++ src/intel/vulkan/anv_queue.c 2020-01-14 09:26:09.184071000 +0100
+@@ -33,6 +33,10 @@
- #include <fcntl.h>
-+#include <errno.h>
+ #include "genxml/gen7_pack.h"
+
+#ifndef ETIME
+#define ETIME ETIMEDOUT
+#endif
- #include <unistd.h>
--#include <sys/eventfd.h>
-
- #include "anv_private.h"
- #include "vk_util.h"
++
+ VkResult
+ anv_device_execbuf(struct anv_device *device,
+ struct drm_i915_gem_execbuffer2 *execbuf,
Index: graphics/mesa/files/patch-src_mesa_drivers_dri_i965_intel__batchbuffer.c
===================================================================
--- graphics/mesa/files/patch-src_mesa_drivers_dri_i965_intel__batchbuffer.c
+++ graphics/mesa/files/patch-src_mesa_drivers_dri_i965_intel__batchbuffer.c
@@ -0,0 +1,23 @@
+Fixes the following error:
+error: format specifies type 'unsigned long long' but the argument has type '__u64' (aka 'unsigned long') [-Werror,-Wformat]
+
+--- src/mesa/drivers/dri/i965/intel_batchbuffer.c.orig 2020-01-14 10:54:22.079484000 +0100
++++ src/mesa/drivers/dri/i965/intel_batchbuffer.c 2020-01-14 10:56:54.334570000 +0100
+@@ -67,7 +67,7 @@
+ uint64_t flags = batch->validation_list[i].flags;
+ assert(batch->validation_list[i].handle ==
+ batch->exec_bos[i]->gem_handle);
+- fprintf(stderr, "[%2d]: %2d %-14s %p %s%-7s @ 0x%016llx%s (%"PRIu64"B)\n",
++ fprintf(stderr, "[%2d]: %2d %-14s %p %s%-7s @ 0x%016"PRIx64"%s (%"PRIu64"B)\n",
+ i,
+ batch->validation_list[i].handle,
+ batch->exec_bos[i]->name,
+@@ -721,7 +721,7 @@
+
+ /* Update brw_bo::gtt_offset */
+ if (batch->validation_list[i].offset != bo->gtt_offset) {
+- DBG("BO %d migrated: 0x%" PRIx64 " -> 0x%llx\n",
++ DBG("BO %d migrated: 0x%" PRIx64 " -> 0x%" PRIx64 "\n",
+ bo->gem_handle, bo->gtt_offset,
+ batch->validation_list[i].offset);
+ assert(!(bo->kflags & EXEC_OBJECT_PINNED));
Index: graphics/mesa/files/patch-src_mesa_main_macros.h
===================================================================
--- graphics/mesa/files/patch-src_mesa_main_macros.h
+++ graphics/mesa/files/patch-src_mesa_main_macros.h
@@ -0,0 +1,14 @@
+ALIGN is also defined in sys/param.h
+
+--- src/mesa/main/macros.h.orig 2019-12-18 19:04:22 UTC
++++ src/mesa/main/macros.h
+@@ -677,6 +677,9 @@ minify(unsigned value, unsigned levels)
+ *
+ * \sa ROUND_DOWN_TO()
+ */
++#ifdef ALIGN
++#undef ALIGN
++#endif
+ static inline uintptr_t
+ ALIGN(uintptr_t value, int32_t alignment)
+ {
Index: graphics/mesa/files/patch-src_mesa_main_marshal.h
===================================================================
--- graphics/mesa/files/patch-src_mesa_main_marshal.h
+++ graphics/mesa/files/patch-src_mesa_main_marshal.h
@@ -0,0 +1,14 @@
+ALIGN is also defined in sys/param.h
+
+--- src/mesa/main/marshal.h.orig 2019-12-18 19:04:22 UTC
++++ src/mesa/main/marshal.h
+@@ -47,6 +47,9 @@ struct marshal_cmd_base
+ uint16_t cmd_size;
+ };
+
++#ifdef ALIGN
++#undef ALIGN
++#endif
+ static inline void *
+ _mesa_glthread_allocate_command(struct gl_context *ctx,
+ uint16_t cmd_id,
Index: graphics/mesa/files/patch-src_util_futex.h
===================================================================
--- graphics/mesa/files/patch-src_util_futex.h
+++ graphics/mesa/files/patch-src_util_futex.h
@@ -1,6 +1,6 @@
- Implement futex_wake() and futex_wait() via _umtx_op()
---- src/util/futex.h.orig 2018-09-24 16:00:57 UTC
+--- src/util/futex.h.orig 2019-12-18 19:04:22 UTC
+++ src/util/futex.h
@@ -29,10 +29,32 @@
#include <limits.h>
@@ -41,5 +41,5 @@
}
+#endif
- #endif
+ #elif defined(__FreeBSD__)
Index: graphics/mesa/files/patch-src_util_meson.build
===================================================================
--- graphics/mesa/files/patch-src_util_meson.build
+++ graphics/mesa/files/patch-src_util_meson.build
@@ -0,0 +1,13 @@
+--- src/util/meson.build.orig 2020-01-13 23:44:12.045592000 +0100
++++ src/util/meson.build 2020-01-13 23:45:01.661003000 +0100
+@@ -105,10 +105,6 @@
+ 'vma.h',
+ )
+
+-files_drirc = files('00-mesa-defaults.conf')
+-
+-install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
+-
+ if with_tests
+ prog_xmllint = find_program('xmllint', required : false, native : true)
+ if prog_xmllint.found()
Index: graphics/mesa/pkg-plist
===================================================================
--- graphics/mesa/pkg-plist
+++ graphics/mesa/pkg-plist
@@ -22,22 +22,22 @@
@comment include/GLES3/gl3platform.h
@comment include/KHR/khrplatform.h
@comment include/gbm.h
-%%INTEL_VDRIVER%%include/vulkan/vulkan_intel.h
-%%I915_DRIVER%%lib/dri/i915_dri.so
-%%I965_DRIVER%%lib/dri/i965_dri.so
-%%FREEDRENO_GDRIVER%%lib/dri/kgsl_dri.so
-%%SWRAST_GDRIVER%%lib/dri/kms_swrast_dri.so
-%%FREEDRENO_GDRIVER%%lib/dri/msm_dri.so
-%%R200_DRIVER%%lib/dri/r200_dri.so
-%%R300_GDRIVER%%lib/dri/r300_dri.so
-%%R600_GDRIVER%%lib/dri/r600_dri.so
+%%intel_VDRIVER%%include/vulkan/vulkan_intel.h
+%%i915_DRIVER%%lib/dri/i915_dri.so
+%%i965_DRIVER%%lib/dri/i965_dri.so
+%%freedreno_GDRIVER%%lib/dri/kgsl_dri.so
+%%swrast_GDRIVER%%lib/dri/kms_swrast_dri.so
+%%swrast_GDRIVER%%lib/dri/swrast_dri.so
+%%freedreno_GDRIVER%%lib/dri/msm_dri.so
+%%r200_DRIVER%%lib/dri/r200_dri.so
+%%r300_GDRIVER%%lib/dri/r300_dri.so
+%%r600_GDRIVER%%lib/dri/r600_dri.so
%%VAAPI%%%%R600_GDRIVER%%lib/dri/r600_drv_video.so
-%%RADEON_DRIVER%%lib/dri/radeon_dri.so
-%%RADEONSI_GDRIVER%%lib/dri/radeonsi_dri.so
-%%VAAPI%%%%RADEONSI_GDRIVER%%lib/dri/radeonsi_drv_video.so
-%%SWRAST_DRIVER%%lib/dri/swrast_dri.so
-%%VC4_GDRIVER%%lib/dri/vc4_dri.so
-%%SVGA_GDRIVER%%lib/dri/vmwgfx_dri.so
+%%r100_DRIVER%%lib/dri/radeon_dri.so
+%%radeonsi_GDRIVER%%lib/dri/radeonsi_dri.so
+%%VAAPI%%%%radeonsi_GDRIVER%%lib/dri/radeonsi_drv_video.so
+%%vc4_GDRIVER%%lib/dri/vc4_dri.so
+%%svga_GDRIVER%%lib/dri/vmwgfx_dri.so
@comment lib/gallium-pipe/pipe_r300.so
@comment lib/gallium-pipe/pipe_r600.so
@comment lib/gallium-pipe/pipe_radeonsi.so
@@ -58,36 +58,33 @@
@comment lib/libOSMesa.so
@comment lib/libOSMesa.so.8
@comment lib/libOSMesa.so.8.0.0
-%%R600_GDRIVER%%lib/libXvMCr600.so
-%%R600_GDRIVER%%lib/libXvMCr600.so.1
-%%R600_GDRIVER%%lib/libXvMCr600.so.1.0
-%%R600_GDRIVER%%lib/libXvMCr600.so.1.0.0
+%%r600_GDRIVER%%lib/libXvMCr600.so
@comment lib/libgbm.so
@comment lib/libgbm.so.1
@comment lib/libgbm.so.1.0.0
@comment lib/libglapi.so
@comment lib/libglapi.so.0
@comment lib/libglapi.so.0.0.0
-%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so
-%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1
-%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1.0
-%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1.0.0
-%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so
-%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1
-%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1.0
-%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1.0.0
-%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so
-%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1
-%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0
-%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0.0
-%%INTEL_VDRIVER%%lib/libvulkan_intel.so
-%%RADEON_VDRIVER%%lib/libvulkan_radeon.so
+%%VDPAU%%%%r300_GDRIVER%%lib/vdpau/libvdpau_r300.so
+%%VDPAU%%%%r300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1
+%%VDPAU%%%%r300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1.0
+%%VDPAU%%%%r300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1.0.0
+%%VDPAU%%%%r600_GDRIVER%%lib/vdpau/libvdpau_r600.so
+%%VDPAU%%%%r600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1
+%%VDPAU%%%%r600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1.0
+%%VDPAU%%%%r600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1.0.0
+%%VDPAU%%%%radeonsi_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so
+%%VDPAU%%%%radeonsi_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1
+%%VDPAU%%%%radeonsi_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0
+%%VDPAU%%%%radeonsi_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0.0
+%%intel_VDRIVER%%lib/libvulkan_intel.so
+%%amd_VDRIVER%%lib/libvulkan_radeon.so
libdata/pkgconfig/dri.pc
@comment libdata/pkgconfig/egl.pc
@comment libdata/pkgconfig/gbm.pc
@comment libdata/pkgconfig/gl.pc
@comment libdata/pkgconfig/glesv2.pc
@comment libdata/pkgconfig/osmesa.pc
-share/drirc.d/00-mesa-defaults.conf
-%%INTEL_VDRIVER%%share/vulkan/icd.d/intel_icd.%%ARCH%%.json
-%%RADEON_VDRIVER%%share/vulkan/icd.d/radeon_icd.%%ARCH%%.json
+@comment share/drirc.d/00-mesa-defaults.conf
+%%intel_VDRIVER%%share/vulkan/icd.d/intel_icd.%%ARCH%%.json
+%%amd_VDRIVER%%share/vulkan/icd.d/radeon_icd.%%ARCH%%.json
Index: graphics/s2tc/Makefile
===================================================================
--- graphics/s2tc/Makefile
+++ graphics/s2tc/Makefile
@@ -12,7 +12,7 @@
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
-BUILD_DEPENDS= mesa-libs>=0:graphics/mesa-libs
+BUILD_DEPENDS= mesa>=0:graphics/mesa
TEST_DEPENDS= convert:graphics/ImageMagick6 \
nvcompress:graphics/nvidia-texture-tools \
wget:ftp/wget
Index: lang/clover/Makefile
===================================================================
--- lang/clover/Makefile
+++ lang/clover/Makefile
@@ -2,39 +2,35 @@
PORTNAME= clover
PORTVERSION= ${MESAVERSION}
-PORTREVISION= 5
CATEGORIES= lang
COMMENT= Mesa OpenCL implementation for AMD GPUs
BUILD_DEPENDS= libclc>=0.3.0:devel/libclc \
- opencl>=0:devel/opencl
+ opencl>=0:devel/opencl \
+ wayland-protocols>=1.8:graphics/wayland-protocols \
+ wayland-scanner:graphics/wayland
LIB_DEPENDS= libOpenCL.so:devel/ocl-icd
RUN_DEPENDS= libclc>=0.3.0:devel/libclc \
opencl>=0:devel/opencl
+USE_XORG= xorgproto x11 xdamage xext xfixes xshmfence xv xrandr xcb xxf86vm
+
ONLY_FOR_ARCHS= i386 amd64
ONLY_FOR_ARCHS_REASON= Clover needs a GPU supported by the Radeon KMS driver
.include <bsd.port.options.mk>
-.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
+.include "${.CURDIR:H:H}/graphics/mesa/Makefile.common"
-CONFIGURE_ARGS+= --enable-opencl --enable-opencl-icd --disable-dri \
- --disable-egl --disable-gbm --disable-gles2 --disable-glx \
- --disable-va --disable-vdpau --disable-xvmc \
- --with-gallium-drivers=r600,radeonsi # only supported GPUs
-LDFLAGS_i386= -Wl,-znotext
+MESON_ARGS+= -Dgallium-opencl=icd -Ddri-drivers="" -Dvulkan-drivers="" \
+ -Degl=false -Dgbm=false -Dgles2=false -Dglx=disabled \
+ -Dgallium-va=false -Dgallium-vdpau=false -Dopengl=false \
+ -Dgallium-xvmc=false -Dgallium-drivers=r600,radeonsi # only supported GPUs
+LDFLAGS_i386= -Wl,-znotext
-#MESA_BUILD_WRKSRC= src/util src/compiler src/mesa src/gallium
-MESA_INSTALL_WRKSRC= src/gallium/targets/opencl src/gallium/targets/pipe-loader
-
-.include "${MASTERDIR}/Makefile.targets"
-
pre-configure:
@if [ -e ${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT} ] && \
! [ -e ${LOCALBASE}/bin/clang${LLVM_DEFAULT} ]; then \
${ECHO_MSG} "Your llvm${LLVM_DEFAULT} is not built with clang support, which is required."; \
${FALSE}; \
fi
-
-.include <bsd.port.post.mk>
Index: misc/raspberrypi-userland/Makefile
===================================================================
--- misc/raspberrypi-userland/Makefile
+++ misc/raspberrypi-userland/Makefile
@@ -12,7 +12,7 @@
ONLY_FOR_ARCHS= armv6 armv7
-CONFLICTS_INSTALL= mesa-libs
+CONFLICTS_INSTALL= mesa
USES= cmake pkgconfig shebangfix
Index: net/tigervnc-server/Makefile
===================================================================
--- net/tigervnc-server/Makefile
+++ net/tigervnc-server/Makefile
@@ -6,7 +6,7 @@
COMMENT= TigerVNC Server
PATCH_DEPENDS+= ${NONEXISTENT}:x11-servers/xorg-server:patch
-BUILD_DEPENDS+= ${LOCALBASE}/include/GL/internal/dri_interface.h:graphics/mesa-dri \
+BUILD_DEPENDS+= ${LOCALBASE}/include/GL/internal/dri_interface.h:graphics/mesa \
${LOCALBASE}/libdata/pkgconfig/fontutil.pc:x11-fonts/font-util \
bash:shells/bash
LIB_DEPENDS= libxshmfence.so:x11/libxshmfence
Index: x11/xorg/Makefile
===================================================================
--- x11/xorg/Makefile
+++ x11/xorg/Makefile
@@ -11,7 +11,7 @@
USES= metaport
-RUN_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri
+RUN_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa
# data
RUN_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/xbitmaps.pc:x11/xbitmaps \

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 15, 11:04 PM (3 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27655697
Default Alt Text
D23161.diff (101 KB)

Event Timeline