Index: graphics/mesa-dri/Makefile =================================================================== --- graphics/mesa-dri/Makefile +++ graphics/mesa-dri/Makefile @@ -3,20 +3,16 @@ PORTNAME= mesa-dri PORTVERSION= ${MESAVERSION} -PORTREVISION= 3 CATEGORIES= graphics COMMENT= OpenGL hardware acceleration drivers for DRI2+ USE_XORG= xorgproto x11 xdamage xext xfixes xshmfence xv xvmc -OPTIONS_DEFINE= TEXTURE VAAPI VDPAU WAYLAND -OPTIONS_DEFAULT=TEXTURE WAYLAND +OPTIONS_DEFINE= VAAPI VDPAU WAYLAND +OPTIONS_DEFAULT=WAYLAND OPTIONS_SUB= yes -TEXTURE_DESC= Enable texture-float support (patent encumbered) -TEXTURE_CONFIGURE_ENABLE= texture-float - VAAPI_CONFIGURE_ENABLE= va VAAPI_LIB_DEPENDS= libva.so:multimedia/libva VAAPI_USE= XORG=xcb @@ -72,6 +68,7 @@ .if ${VULKAN_DRIVERS} BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR} +USE_XORG+= xcb xrandr .endif LDFLAGS_i386= -Wl,-znotext Index: graphics/mesa-dri/Makefile.common =================================================================== --- graphics/mesa-dri/Makefile.common +++ graphics/mesa-dri/Makefile.common @@ -14,7 +14,7 @@ MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/} MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/} -MESABASEVERSION= 18.1.9 +MESABASEVERSION= 18.2.7 # if there is a subversion, don't include the '-' between 7.11-rc2. MESASUBVERSION= Index: graphics/mesa-dri/distinfo =================================================================== --- graphics/mesa-dri/distinfo +++ graphics/mesa-dri/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1538226082 -SHA256 (mesa-18.1.9.tar.xz) = 55f5778d58a710a63d6635f000535768faf7db9e8144dc0f4fd1989f936c1a83 -SIZE (mesa-18.1.9.tar.xz) = 11146188 +TIMESTAMP = 1544709740 +SHA256 (mesa-18.2.7.tar.xz) = 9c7b02560d89d77ca279cd21f36ea9a49e9ffc5611f6fe35099357d744d07ae6 +SIZE (mesa-18.2.7.tar.xz) = 11356060 Index: graphics/mesa-dri/files/configure.ac =================================================================== --- graphics/mesa-dri/files/configure.ac +++ graphics/mesa-dri/files/configure.ac @@ -30,6 +30,18 @@ dri3_default=yes ;; *) +@@ -1884,9 +1884,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') @@ -2061,8 +2070,6 @@ if test "x$enable_opencl" = xyes; then CLANG_LIBDIR=${LLVM_LIBDIR} fi Index: graphics/mesa-dri/files/patch-configure =================================================================== --- graphics/mesa-dri/files/patch-configure +++ graphics/mesa-dri/files/patch-configure @@ -51,6 +51,74 @@ dri3_default=yes ;; *) +@@ -26000,31 +26000,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 . +-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 +@@ -26092,31 +26072,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 . +-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 @@ -27096,9 +27106,6 @@ rm -f core conftest.err conftest.$ac_obj CLANG_LIBDIR=${LLVM_LIBDIR} fi Index: graphics/mesa-dri/files/patch-llvm7 =================================================================== --- graphics/mesa-dri/files/patch-llvm7 +++ /dev/null @@ -1,52 +0,0 @@ -commit d424be0feda5 -Author: Jan Vesely -Date: Tue May 22 17:52:30 2018 -0400 - - clover: Fix build after llvm r332881. - - v2: fix whitespace and indentation - - r332881 added an extra parameter to the emit function. - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106619 - Signed-off-by: Jan Vesely - Reviewed-By: Aaron Watry - Tested-By: Aaron Watry - Tested-by: Kai Wasserbäch - ---- src/gallium/state_trackers/clover/llvm/codegen/native.cpp.orig 2018-07-27 13:52:17 UTC -+++ src/gallium/state_trackers/clover/llvm/codegen/native.cpp -@@ -126,13 +126,12 @@ namespace { - { - compat::pass_manager pm; - ::llvm::raw_svector_ostream os { data }; -- compat::raw_ostream_to_emit_file fos(os); - - mod.setDataLayout(compat::get_data_layout(*tm)); - tm->Options.MCOptions.AsmVerbose = - (ft == TargetMachine::CGFT_AssemblyFile); - -- if (tm->addPassesToEmitFile(pm, fos, ft)) -+ if (compat::add_passes_to_emit_file(*tm, pm, os, ft)) - fail(r_log, build_error(), "TargetMachine can't emit this file"); - - pm.run(mod); ---- src/gallium/state_trackers/clover/llvm/compat.hpp.orig 2018-07-27 13:52:17 UTC -+++ src/gallium/state_trackers/clover/llvm/compat.hpp -@@ -247,6 +247,17 @@ namespace clover { - ::llvm::WriteBitcodeToFile(&mod, os); - #endif - } -+ -+ template -+ bool add_passes_to_emit_file(TM &tm, PM &pm, OS &os, FT &ft) -+ { -+ compat::raw_ostream_to_emit_file fos(os); -+#if HAVE_LLVM >= 0x0700 -+ return tm.addPassesToEmitFile(pm, fos, nullptr, ft); -+#else -+ return tm.addPassesToEmitFile(pm, fos, ft); -+#endif -+ } - } - } - } Index: graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c =================================================================== --- graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c +++ graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c @@ -1,14 +1,34 @@ -# We don't have MAP_NORESERVE so use MAP_NOSYNC | MAP_NOCORE and -# hope for the best (this alloc is too big but it's only a test) -# ---- src/intel/tools/aubinator.c.orig 2017-10-02 15:49:02 UTC +- Partially implement memfd_create() via mkostemp() + +--- src/intel/tools/aubinator.c.orig 2018-08-02 15:41:20 UTC +++ src/intel/tools/aubinator.c -@@ -637,7 +637,7 @@ int main(int argc, char *argv[]) - /* mmap a terabyte for our gtt space. */ - gtt_size = 1ull << 40; - gtt = mmap(NULL, gtt_size, PROT_READ | PROT_WRITE, -- MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); -+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_NOSYNC | MAP_NOCORE, -1, 0); - if (gtt == MAP_FAILED) { - fprintf(stderr, "failed to alloc gtt space: %s\n", strerror(errno)); - exit(EXIT_FAILURE); +@@ -52,7 +52,29 @@ + 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 @@ -6,7 +6,7 @@ * */ -+#ifdef __FreeBSD__ ++#if defined(__FreeBSD__) && __FreeBSD__ < 12 +#define _WITH_GETLINE +#endif #include Index: graphics/mesa-dri/files/patch-src_intel_tools_error2aub.c =================================================================== --- /dev/null +++ graphics/mesa-dri/files/patch-src_intel_tools_error2aub.c @@ -0,0 +1,14 @@ +# 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 + #include + #include ++#if defined(__FreeBSD__) && __FreeBSD__ < 12 ++#define _WITH_GETLINE ++#endif + #include + #include + #include 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 @@ -2,16 +2,14 @@ # --- src/util/build_id.c.orig 2017-12-21 17:31:22 UTC +++ src/util/build_id.c -@@ -34,7 +34,11 @@ +@@ -38,6 +38,10 @@ + #define ElfW(type) Elf_##type #endif - #ifndef ElfW --#define ElfW(type) Elf_##type -+#ifdef __LP64__ -+#define ElfW(type) Elf64_##type -+#else -+#define ElfW(type) Elf32_##type ++#if defined(__FreeBSD__) && __FreeBSD__ < 12 ++typedef Elf_Note Elf_Nhdr; +#endif - #endif ++ + struct build_id_note { + ElfW(Nhdr) nhdr; - #define ALIGN(val, align) (((val) + (align) - 1) & ~((align) - 1)) Index: graphics/mesa-dri/pkg-help =================================================================== --- graphics/mesa-dri/pkg-help +++ graphics/mesa-dri/pkg-help @@ -2,14 +2,4 @@ drivers to decode video on the GPU via libva and libvdpau, respectively. Gallium based VAAPI and VDPAU drivers are only available for Radeon GPUs. -Both GPU decode options require newer drm drivers than are currently present -in a released FreeBSD kernel. These are options for DRM-next and DragonFly. - -The TEXTURE option enables texture-float support, which SGI claims requires -US Patent #6,650,327 [1], filed Jun 16, 1998 thus expiring on Jun 16, 2018. -Use may require a license depending on jurisdiction, consult a lawyer. - -See docs/patents.txt in the Mesa tarball or the following URLs: - -[1] https://www.google.com/patents/US6650327 -[2] http://www.opengl.org/registry/specs/ARB/texture_float.txt +VAAPI and VDPAU require graphics/drm-stable-kmod or newer on FreeBSD. Index: graphics/mesa-dri/pkg-plist =================================================================== --- graphics/mesa-dri/pkg-plist +++ graphics/mesa-dri/pkg-plist @@ -83,15 +83,11 @@ %%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0.0 %%INTEL_VDRIVER%%lib/libvulkan_intel.so %%RADEON_VDRIVER%%lib/libvulkan_radeon.so -@comment lib/libwayland-egl.so -@comment lib/libwayland-egl.so.1 -@comment lib/libwayland-egl.so.1.0.0 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 -@comment libdata/pkgconfig/wayland-egl.pc %%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 @@ -3,7 +3,6 @@ PORTNAME= mesa-libs PORTVERSION= ${MESAVERSION} -PORTREVISION= 4 CATEGORIES= graphics COMMENT= OpenGL libraries that support GLX and EGL clients @@ -17,8 +16,7 @@ WAYLAND_DESC= Enable support for the Wayland platform in EGL WAYLAND_BUILD_DEPENDS= wayland-protocols>=1.8:graphics/wayland-protocols -WAYLAND_LIB_DEPENDS= libwayland-client.so:graphics/wayland \ - libwayland-server.so:graphics/wayland +WAYLAND_LIB_DEPENDS= libwayland-egl.so:graphics/wayland .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" @@ -33,8 +31,7 @@ MESA_INSTALL_WRKSRC= src/mapi .if ${PORT_OPTIONS:MWAYLAND} -MESA_BUILD_WRKSRC+= src/egl/wayland/wayland-drm src/egl/wayland/wayland-egl -MESA_INSTALL_WRKSRC+= src/egl/wayland/wayland-egl +MESA_BUILD_WRKSRC+= src/egl/wayland/wayland-drm .endif MESA_BUILD_WRKSRC+= src/gbm src/glx Index: graphics/mesa-libs/pkg-plist =================================================================== --- graphics/mesa-libs/pkg-plist +++ graphics/mesa-libs/pkg-plist @@ -36,11 +36,7 @@ lib/libglapi.so lib/libglapi.so.0 lib/libglapi.so.0.0.0 -@comment %%WAYLAND%%lib/libwayland-egl.so -@comment %%WAYLAND%%lib/libwayland-egl.so.1 -@comment %%WAYLAND%%lib/libwayland-egl.so.1.0.0 libdata/pkgconfig/egl.pc libdata/pkgconfig/gbm.pc libdata/pkgconfig/gl.pc libdata/pkgconfig/glesv2.pc -@comment %%WAYLAND%%libdata/pkgconfig/wayland-egl.pc