diff --git a/graphics/mesa-dri/Makefile b/graphics/mesa-dri/Makefile index c01e8185e1d6..a0a05046c388 100644 --- a/graphics/mesa-dri/Makefile +++ b/graphics/mesa-dri/Makefile @@ -1,119 +1,119 @@ # Created by: Eric Anholt PORTNAME= mesa-dri PORTVERSION= ${MESAVERSION} CATEGORIES= graphics COMMENT= OpenGL hardware acceleration drivers for DRI2+ OPTIONS_GROUP= PLATFORM OPTIONS_GROUP_PLATFORM= PLATFORM_X11 PLATFORM_WAYLAND PLATFORM_X11_DESC= Enable X11 support for GBM/EGL PLATFORM_WAYLAND_DESC= Enable Wayland support for GBM/EGL PLATFORM_WAYLAND_IMPLIES= WAYLAND OPTIONS_DEFINE= WAYLAND ZSTD OPTIONS_DEFAULT= WAYLAND PLATFORM_X11 PLATFORM_WAYLAND ZSTD OPTIONS_SUB= yes 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 WAYLAND_IMPLIES= PLATFORM_WAYLAND ZSTD_DESC= Use ZSTD for shader cache ZSTD_LIB_DEPENDS= libzstd.so:archivers/zstd ZSTD_MESON_ENABLED= zstd .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" ALL_DRI_DRIVERS= I915 I965 R100 R200 -ALL_GALLIUM_DRIVERS= IRIS R300 R600 RADEONSI SVGA SWRAST +ALL_GALLIUM_DRIVERS= CROCUS IRIS R300 R600 RADEONSI SVGA SWRAST ALL_VULKAN_DRIVERS= INTEL AMD GALLIUM_DRIVERS+= SWRAST # llvmpipe .if ${ARCH:Marm*} DRI_DRIVERS+= R100 .endif .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == i386 \ || ${ARCH:Mpowerpc*} || ${ARCH} == riscv64 DRI_DRIVERS+= R100 R200 GALLIUM_DRIVERS+= R300 R600 RADEONSI VULKAN_DRIVERS+= AMD . if ${PORT_OPTIONS:MPLATFORM_X11} USE_XORG+= xv xvmc MESON_ARGS+= -Dgallium-xvmc=enabled . endif .endif .if ${ARCH} == amd64 || ${ARCH} == i386 DRI_DRIVERS+= I915 I965 -GALLIUM_DRIVERS+= IRIS SVGA +GALLIUM_DRIVERS+= CROCUS IRIS SVGA VULKAN_DRIVERS+= INTEL .endif LDFLAGS_i386= -Wl,-znotext .if ${PORT_OPTIONS:MPLATFORM_X11} MESA_PLATFORMS+= x11 USE_XORG+= xorgproto x11 xdamage xext xfixes xshmfence xv .if defined(VULKAN_DRIVERS) USE_XORG+= xcb xrandr .endif .endif .if ${PORT_OPTIONS:MPLATFORM_WAYLAND} MESA_PLATFORMS+= wayland .endif MESON_ARGS+= -Ddri-drivers="${DRI_DRIVERS:ts,:tl}" \ -Dgallium-drivers="${GALLIUM_DRIVERS:ts,:tl}" \ -Dvulkan-drivers="${VULKAN_DRIVERS:ts,:tl}" \ -Dplatforms="${MESA_PLATFORMS:ts,:tl}" # Disable some options MESON_ARGS+= -Dgallium-xa=disabled \ -Dgallium-vdpau=disabled \ -Dgallium-va=disabled \ -Dgles1=disabled \ -Dgles2=disabled \ -Dglx=disabled \ -Degl=disabled \ -Dosmesa=false \ -Dtools="" .for _d in ${ALL_DRI_DRIVERS} . if defined(DRI_DRIVERS) && ${DRI_DRIVERS:M${_d}} PLIST_SUB+= ${_d}_DRIVER="" . else PLIST_SUB+= ${_d}_DRIVER="@comment " . endif .endfor .for _gd in ${ALL_GALLIUM_DRIVERS} . if defined(GALLIUM_DRIVERS) && ${GALLIUM_DRIVERS:M${_gd}} PLIST_SUB+= ${_gd}_GDRIVER="" . else PLIST_SUB+= ${_gd}_GDRIVER="@comment " . endif .endfor PLIST_SUB += ARCH=${ARCH:S/amd/x86_/} .for _vd in ${ALL_VULKAN_DRIVERS} . if defined(VULKAN_DRIVERS) && ${VULKAN_DRIVERS:M${_vd}} PLIST_SUB+= ${_vd}_VDRIVER="" . else PLIST_SUB+= ${_vd}_VDRIVER="@comment " . endif .endfor .include "${MASTERDIR}/Makefile.targets" post-install: @${RM} -r ${STAGEDIR}/etc/OpenCL ${INSTALL_DATA} ${FILESDIR}/01-freebsd.conf \ ${STAGEDIR}${PREFIX}/share/drirc.d .include diff --git a/graphics/mesa-dri/Makefile.common b/graphics/mesa-dri/Makefile.common index 16ef1037c66d..bcd60d0b2e72 100644 --- a/graphics/mesa-dri/Makefile.common +++ b/graphics/mesa-dri/Makefile.common @@ -1,96 +1,99 @@ # 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 MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/} MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/} -MESABASEVERSION= 21.1.8 +MESABASEVERSION= 21.3.4 # 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 +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/docs/license.rst + COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//} BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs \ ${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR} LIB_DEPENDS+= libexpat.so:textproc/expat2 .if ${COMPONENT} != clover .if ${PORT_OPTIONS:MPLATFORM_X11} USES+= xorg .endif .endif .if ${COMPONENT} != osmesa LIB_DEPENDS+= libdrm.so:graphics/libdrm .endif .if ${COMPONENT} != libs LIB_DEPENDS+= libglapi.so:graphics/mesa-libs .endif .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == armv7 || ${ARCH} == i386 || ${ARCH} == powerpc64 || ${ARCH} == powerpc64le LIB_DEPENDS+= libunwind.so:devel/libunwind .endif .if ${OPSYS} == DragonFly LIB_DEPENDS+= libelf.so:devel/libelf .endif USES+= compiler:c++11-lib bison meson pathfix pkgconfig \ python:3.6+,build shebangfix tar:xz USE_LDCONFIG= yes .if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld # --build-id isn't supported by old GNU ld.bfd in base # Also ld.bfd have problems that seems related to --as-needed USE_BINUTILS= yes LDFLAGS+= -B${LOCALBASE}/bin .endif # 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/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 .include BINARY_ALIAS+= python3=${PYTHON_VERSION} -LLVM_DEFAULT= 12 +LLVM_DEFAULT= 13 BUILD_DEPENDS+= llvm-config${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} .if ${COMPONENT} != libs RUN_DEPENDS+= llvm-config${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} .endif MESON_ARGS+= --native-file="${WRKSRC}/llvm.ini" LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${LLVM_DEFAULT}/lib MESON_ARGS+= -Dllvm=enabled diff --git a/graphics/mesa-dri/distinfo b/graphics/mesa-dri/distinfo index a4fd71f1c57b..cf2d8d9fc7f1 100644 --- a/graphics/mesa-dri/distinfo +++ b/graphics/mesa-dri/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1633514529 -SHA256 (mesa-21.1.8.tar.xz) = 5cd32f5d089dca75300578a3d771a656eaed652090573a2655fe4e7022d56bfc -SIZE (mesa-21.1.8.tar.xz) = 15410504 +TIMESTAMP = 1642339994 +SHA256 (mesa-21.3.4.tar.xz) = 77104fd4a93bce69da3b0982f8ee88ba7c4fb98cfc491a669894339cdcd4a67d +SIZE (mesa-21.3.4.tar.xz) = 16497248 diff --git a/graphics/mesa-dri/files/patch-meson.build b/graphics/mesa-dri/files/patch-meson.build deleted file mode 100644 index 9cad06faaead..000000000000 --- a/graphics/mesa-dri/files/patch-meson.build +++ /dev/null @@ -1,28 +0,0 @@ ---- meson.build.orig 2021-06-30 18:18:55 UTC -+++ meson.build -@@ -161,7 +161,7 @@ if dri_drivers.contains('auto') - if system_has_kms_drm - # TODO: PPC, Sparc - if ['x86', 'x86_64'].contains(host_machine.cpu_family()) -- dri_drivers = ['i915', 'i965', 'r100', 'r200', 'nouveau'] -+ dri_drivers = ['i915', 'i965', 'r100', 'r200'] - elif ['arm', 'aarch64'].contains(host_machine.cpu_family()) - dri_drivers = [] - elif ['mips', 'mips64'].contains(host_machine.cpu_family()) -@@ -193,7 +193,7 @@ if gallium_drivers.contains('auto') - # TODO: PPC, Sparc - if ['x86', 'x86_64'].contains(host_machine.cpu_family()) - gallium_drivers = [ -- 'r300', 'r600', 'radeonsi', 'nouveau', 'virgl', 'svga', 'swrast', -+ 'r300', 'r600', 'radeonsi', 'virgl', 'svga', 'swrast', - 'iris' - ] - elif ['arm', 'aarch64'].contains(host_machine.cpu_family()) -@@ -1041,7 +1041,6 @@ else - '-Werror=incompatible-pointer-types', - '-Werror=int-conversion', - '-Wimplicit-fallthrough', -- '-Werror=thread-safety', - '-Wno-missing-field-initializers', - '-Wno-format-truncation', - '-fno-math-errno', diff --git a/graphics/mesa-dri/files/patch-src_gallium_include_pipe_p__compiler.h b/graphics/mesa-dri/files/patch-src_gallium_include_pipe_p__compiler.h new file mode 100644 index 000000000000..a67d3f974320 --- /dev/null +++ b/graphics/mesa-dri/files/patch-src_gallium_include_pipe_p__compiler.h @@ -0,0 +1,11 @@ +--- src/gallium/include/pipe/p_compiler.h.orig 2022-01-16 11:29:08 UTC ++++ src/gallium/include/pipe/p_compiler.h +@@ -170,7 +170,7 @@ typedef unsigned char boolean; + * aligned, but we only want to align the field. + */ + #define EXCLUSIVE_CACHELINE(decl) \ +- union { char __cl_space[CACHE_LINE_SIZE]; \ ++ union { char __cl_space[MESA_CACHE_LINE_SIZE]; \ + decl; } + + #if defined(__GNUC__) diff --git a/graphics/mesa-dri/files/patch-src_intel_compiler_brw__nir__lower__shader__calls.c b/graphics/mesa-dri/files/patch-src_intel_compiler_brw__nir__lower__shader__calls.c deleted file mode 100644 index f68c1e1acf18..000000000000 --- a/graphics/mesa-dri/files/patch-src_intel_compiler_brw__nir__lower__shader__calls.c +++ /dev/null @@ -1,15 +0,0 @@ ---- src/intel/compiler/brw_nir_lower_shader_calls.c.orig 2021-06-30 18:18:55 UTC -+++ src/intel/compiler/brw_nir_lower_shader_calls.c -@@ -151,6 +151,12 @@ instr_is_shader_call(nir_instr *instr) - intrin->intrinsic == nir_intrinsic_execute_callable; - } - -+#ifdef __FreeBSD__ -+/* brw_nir_rt.h -> glthread.h -> u_thread.h -> pthread_np.h -> sys/cpuset.h -> sys/_bitset.h -+ * - defines `struct bitset` which clashes with the following -+ */ -+#define bitset mesa_bitset -+#endif - struct bitset { - BITSET_WORD *set; - unsigned size; diff --git a/graphics/mesa-dri/files/patch-src_loader_meson.build b/graphics/mesa-dri/files/patch-src_loader_meson.build deleted file mode 100644 index 14ef872d46f4..000000000000 --- a/graphics/mesa-dri/files/patch-src_loader_meson.build +++ /dev/null @@ -1,11 +0,0 @@ ---- src/loader/meson.build.orig 2020-12-03 18:59:28.209491000 +0100 -+++ src/loader/meson.build 2020-12-03 18:59:40.685431000 +0100 -@@ -41,7 +41,7 @@ - '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path), - ] - --if with_gallium_iris and get_option('prefer-iris') -+if get_option('prefer-iris') - loader_c_args += ['-DPREFER_IRIS'] - endif - diff --git a/graphics/mesa-dri/files/patch-src_util_macros.h b/graphics/mesa-dri/files/patch-src_util_macros.h new file mode 100644 index 000000000000..5038dc8ea935 --- /dev/null +++ b/graphics/mesa-dri/files/patch-src_util_macros.h @@ -0,0 +1,10 @@ +--- src/util/macros.h.orig 2022-01-16 11:28:56 UTC ++++ src/util/macros.h +@@ -478,6 +478,6 @@ typedef int lock_cap_t; + #endif + + /* TODO: this could be different on non-x86 architectures. */ +-#define CACHE_LINE_SIZE 64 ++#define MESA_CACHE_LINE_SIZE 64 + + #endif /* UTIL_MACROS_H */ diff --git a/graphics/mesa-dri/files/patch-src_util_os__file.c b/graphics/mesa-dri/files/patch-src_util_os__file.c deleted file mode 100644 index fce8aaa4bcd9..000000000000 --- a/graphics/mesa-dri/files/patch-src_util_os__file.c +++ /dev/null @@ -1,11 +0,0 @@ ---- src/util/os_file.c.orig 2021-06-30 18:18:56 UTC -+++ src/util/os_file.c -@@ -89,7 +89,7 @@ typedef ptrdiff_t ssize_t; - static ssize_t - readN(int fd, char *buf, size_t len) - { -- int err = -ENODATA; -+ int err = -1; - size_t total = 0; - do { - ssize_t ret = read(fd, buf + total, len - total); diff --git a/graphics/mesa-dri/pkg-plist b/graphics/mesa-dri/pkg-plist index 78a86779e6fe..4929d30a859e 100644 --- a/graphics/mesa-dri/pkg-plist +++ b/graphics/mesa-dri/pkg-plist @@ -1,35 +1,37 @@ @comment include/GL/gl.h @comment include/GL/glcorearb.h @comment include/GL/glext.h include/GL/internal/dri_interface.h @comment include/KHR/khrplatform.h @comment include/gbm.h +%%CROCUS_GDRIVER%%lib/dri/crocus_dri.so +%%I915_DRIVER%%lib/dri/i830_dri.so %%I915_DRIVER%%lib/dri/i915_dri.so %%I965_DRIVER%%lib/dri/i965_dri.so %%IRIS_GDRIVER%%lib/dri/iris_dri.so %%SWRAST_GDRIVER%%lib/dri/kms_swrast_dri.so %%R200_DRIVER%%lib/dri/r200_dri.so %%R300_GDRIVER%%lib/dri/r300_dri.so %%R600_GDRIVER%%lib/dri/r600_dri.so %%R100_DRIVER%%lib/dri/radeon_dri.so %%RADEONSI_GDRIVER%%lib/dri/radeonsi_dri.so %%SWRAST_GDRIVER%%lib/dri/swrast_dri.so %%SVGA_GDRIVER%%lib/dri/vmwgfx_dri.so %%PLATFORM_X11%%%%R600_GDRIVER%%lib/libXvMCr600.so %%PLATFORM_X11%%%%R600_GDRIVER%%lib/libXvMCr600.so.1 %%PLATFORM_X11%%%%R600_GDRIVER%%lib/libXvMCr600.so.1.0 %%PLATFORM_X11%%%%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 %%INTEL_VDRIVER%%lib/libvulkan_intel.so %%AMD_VDRIVER%%lib/libvulkan_radeon.so libdata/pkgconfig/dri.pc @comment libdata/pkgconfig/gbm.pc share/drirc.d/00-mesa-defaults.conf share/drirc.d/01-freebsd.conf %%INTEL_VDRIVER%%share/vulkan/icd.d/intel_icd.%%ARCH%%.json %%AMD_VDRIVER%%share/vulkan/icd.d/radeon_icd.%%ARCH%%.json