From nobody Fri Feb 03 22:25:00 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P7qwD4MFJz3kpvR; Fri, 3 Feb 2023 22:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P7qwD3VRVz3kYl; Fri, 3 Feb 2023 22:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675463100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XTuyph/OCN84vtYNZEn64KrWFoM7OGBNNau3I4wHTqI=; b=Tq0Mc9Hs1HWiQbKEkG7bvg6gv+I5w6fM8VaY82akkUZDidWgd1TF4+1WC5QgCnWyRFoA/b EyLVl+yDXV/V4csZ6acnLPiSkWfgCjelUaqMFEeXFl7Y42AMDnI6SyCGUDsYNeO2ZtF+M7 CpvFJsU7l0+Av+QEFDN/lqaKl4FCVxotpz0cCSXR4KaTRewFNFET/q1EYciyjh0j9Otq2A proIIGRp+5H9TRU9I8BkctJZ+Zw4Z+AOT4dJXvYrltjGW+x92Gtgq9UZQZ1qcmn6+nBWda Ow2iFcpT0m/78BWo8cc+mzcsNRgpG4bwkbSML6gcbmZFGeEYtvM2I/af6+7tSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675463100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XTuyph/OCN84vtYNZEn64KrWFoM7OGBNNau3I4wHTqI=; b=xWU7lhqL0sPoy8ZrL2A+AALsYZwcSpWgADYwERryRB90nzdiTnQLY7IZO7am4Ey68V0BcF LjFRJOsfvRX6AsAQ6isbwXo3i5+0AaIr8Z82byddS6xo3+cTGRjHWtWVAMwKgLQea5TZOV 7/0CmZQL2lx9Bnd8tMS5Dj5dEeShzB/Kqb13nog3hOEDnF76nzb3vUsx0ygz9uHPta2VQj S9/bUY4jnc2tE8fw1MYaddVHE2hYj0d7tC+BKEiakda0CQHPNBjUYpUepBPOw7awjvctJ3 zOhPu+Gn/yXgP5giJnoYcJr+V3AR89czV1Dk+HYFdCZIEBU3991CdGbXhNth3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675463100; a=rsa-sha256; cv=none; b=cRSkY7mcmlRFTX/yqSdQtSigyKY1wZn6CwsM2Ex1wOmgrKsD91BEBsAjYjuSauF9vXPCZ6 34/3RZCKtw9ZAyLKCZv6YeAAlmhbms/p3Mgx0Yf4tFFETZqusI+LbL6xkGVPUSUlQc8J4K eCzB4xJywc9YgcnfnT091EUyldxgJMkZlbKs5B2N+CiIb3LHvr0XHUvVAU5JdeM97OFLUQ sHwh7MjSl7sjoKw2pbUGgyimfrqSs12H3lUX6ZYNiPTAYbn4KIgvv3Nhx+K4oV4BHUjx+r BBDIQKX8JGzkhF8XNJ+CbW6l+mLntJESOnlJeYRzW0kNOpBkE5TnBQd/HhkGHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P7qwD2b5JzrY8; Fri, 3 Feb 2023 22:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 313MP0P8083242; Fri, 3 Feb 2023 22:25:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 313MP0qK083241; Fri, 3 Feb 2023 22:25:00 GMT (envelope-from git) Date: Fri, 3 Feb 2023 22:25:00 GMT Message-Id: <202302032225.313MP0qK083241@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Jan Beich Subject: git: d8990eff958b - main - graphics/mesa-devel: expose OpenCL support List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jbeich X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8990eff958b5295ec292d58cf63cbb55f788be3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jbeich: URL: https://cgit.FreeBSD.org/ports/commit/?id=d8990eff958b5295ec292d58cf63cbb55f788be3 commit d8990eff958b5295ec292d58cf63cbb55f788be3 Author: Jan Beich AuthorDate: 2023-02-03 19:55:25 +0000 Commit: Jan Beich CommitDate: 2023-02-03 22:23:41 +0000 graphics/mesa-devel: expose OpenCL support Overrides lang/clover but still required for mesa.icd unless built in standalone mode (DEFAULT_VERSIONS+=gl=mesa-devel). For example, on Intel GPUs one can set IRIS_ENABLE_CLOVER=1 and RUSTICL_ENABLE=iris via environ(7) to enable both Clover and Rusticl. https://docs.mesa3d.org/envvars.html#rusticl-environment-variables https://github.com/OCL-dev/ocl-icd/blob/master/doc/libOpenCL.7.txt.in --- graphics/mesa-devel/Makefile | 23 ++++++++++++++--- graphics/mesa-devel/files/libmap.conf.in | 2 ++ graphics/mesa-devel/files/patch-suffix | 42 ++++++++++++++++++++++++++++++++ graphics/mesa-devel/pkg-plist | 12 +++++++++ 4 files changed, 76 insertions(+), 3 deletions(-) diff --git a/graphics/mesa-devel/Makefile b/graphics/mesa-devel/Makefile index 9cb92c96babc..96bd90ee1487 100644 --- a/graphics/mesa-devel/Makefile +++ b/graphics/mesa-devel/Makefile @@ -1,6 +1,7 @@ PORTNAME= mesa DISTVERSION= 23.0-branchpoint-838 DISTVERSIONSUFFIX= -g51ea81c0a11 +PORTREVISION= 1 CATEGORIES= graphics PKGNAMESUFFIX= -devel @@ -10,7 +11,7 @@ PATCHFILES+= 50433886a3e3.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/- PATCHFILES+= 4c7408374e3d.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21052 MAINTAINER= jbeich@FreeBSD.org -COMMENT= Bleeding edge Mesa drivers (OpenGL, Vulkan) +COMMENT= Bleeding edge Mesa drivers (OpenCL, OpenGL, Vulkan) WWW= https://www.mesa3d.org/ LICENSE= MIT @@ -44,8 +45,8 @@ MESON_ARGS= -Dgallium-omx=disabled \ ${NULL} PLIST_SUB= ARCH=${ARCH:S/amd/x86_/} -OPTIONS_DEFINE= LIBUNWIND LLVM LTO VAAPI VDPAU VKLAYERS WAYLAND X11 ZSTD -OPTIONS_DEFAULT= LIBUNWIND LLVM LTO VAAPI VDPAU VKLAYERS WAYLAND X11 ZSTD +OPTIONS_DEFINE= LIBUNWIND LLVM LTO OPENCL VAAPI VDPAU VKLAYERS WAYLAND X11 ZSTD +OPTIONS_DEFAULT= LIBUNWIND LLVM LTO OPENCL VAAPI VDPAU VKLAYERS WAYLAND X11 ZSTD OPTIONS_GROUP= GALLIUM VULKAN OPTIONS_GROUP_GALLIUM= crocus iris panfrost r600 radeonsi OPTIONS_GROUP_VULKAN= anv hasvk radv @@ -102,6 +103,20 @@ ${i}_IMPLIES+= LLVM LTO_MESON_TRUE= b_lto +OPENCL_DESC= Heterogeneous computing via OpenCL (implies LLVM) +OPENCL_BUILD_DEPENDS= bindgen:devel/rust-bindgen-cli \ + libclc>0:devel/libclc \ + spirv-tools>0:graphics/spirv-tools \ + rustc:lang/rust +OPENCL_LIB_DEPENDS= libLLVMSPIRVLib.so.${LLVM_VERSION}:devel/spirv-llvm-translator@${LLVM_PORT:T} +OPENCL_RUN_DEPENDS= libclc>0:devel/libclc +OPENCL_CONFIGURE_ENV= PKG_CONFIG_PATH="${LLVM_PREFIX}/libdata/pkgconfig" +OPENCL_MESON_FALSE= b_lundef # environ +OPENCL_MESON_TRUE= gallium-rusticl +OPENCL_MESON_ON= -Dgallium-opencl=icd +OPENCL_VARS= LLVM_USES=llvm:15,lib # chase libclc + rust (LTO) +OPENCL_IMPLIES= LLVM ${"${PORT_OPTIONS:Miris}":?iris:radeonsi} # any from OPTIONS_GROUP_GALLIUM + VAAPI_DESC= Hardware encoding/decoding (only r600, radeonsi) VAAPI_BUILD_DEPENDS= libva>0:multimedia/libva VAAPI_MESON_ENABLED= gallium-va @@ -143,6 +158,8 @@ post-patch: ${WRKSRC}/bin/git_sha1_gen.py post-patch-COINST-on: + @${MV} ${WRKSRC}/src/gallium/targets/opencl/MesaOpenCL.def.in \ + ${WRKSRC}/src/gallium/targets/opencl/MesaOpenCL${PKGNAMESUFFIX}.def.in @${MV} ${WRKSRC}/src/util/00-${PORTNAME}-defaults.conf \ ${WRKSRC}/src/util/00-${PKGBASE}-defaults.conf @${MV} ${WRKSRC}/src/util/00-radv-defaults.conf \ diff --git a/graphics/mesa-devel/files/libmap.conf.in b/graphics/mesa-devel/files/libmap.conf.in index 24c7e5e47115..17ed9dc1c888 100644 --- a/graphics/mesa-devel/files/libmap.conf.in +++ b/graphics/mesa-devel/files/libmap.conf.in @@ -8,6 +8,8 @@ libEGL_mesa.so.0 libEGL_mesa%%SUFFIX%%.so.0 # GBM clients like kmscube and wlroots fail otherwise libgbm.so.1 libgbm%%SUFFIX%%.so.1 +%%OPENCL%%libMesaOpenCL.so.1 libMesaOpenCL%%SUFFIX%%.so.1 + %%anv%%%%PREFIX%%/lib/libvulkan_intel.so libvulkan_intel%%SUFFIX%%.so %%hasvk%%%%PREFIX%%/lib/libvulkan_intel_hasvk.so libvulkan_intel_hasvk%%SUFFIX%%.so %%radv%%%%PREFIX%%/lib/libvulkan_radeon.so libvulkan_radeon%%SUFFIX%%.so diff --git a/graphics/mesa-devel/files/patch-suffix b/graphics/mesa-devel/files/patch-suffix index 61af28390c1c..ee52f899c573 100644 --- a/graphics/mesa-devel/files/patch-suffix +++ b/graphics/mesa-devel/files/patch-suffix @@ -62,6 +62,48 @@ Library selection is handled by libglvnd and/or libmap.conf. egl_lib_version = '0.0.0' deps_for_egl += dep_glvnd files_egl += [g_egldispatchstubs_h, g_egldispatchstubs_c] +--- src/gallium/auxiliary/pipe-loader/meson.build.orig 2023-02-01 23:53:26 UTC ++++ src/gallium/auxiliary/pipe-loader/meson.build +@@ -58,7 +58,7 @@ libpipe_loader_dynamic = static_library( + c_args : [ + libpipe_loader_defines, + '-DPIPE_SEARCH_DIR="@0@"'.format( +- join_paths(get_option('prefix'), get_option('libdir'), 'gallium-pipe') ++ join_paths(get_option('prefix'), get_option('libdir'), 'gallium-pipe' + get_option('egl-lib-suffix')) + ) + ], + gnu_symbol_visibility : 'hidden', +--- src/gallium/targets/opencl/meson.build.orig 2023-02-01 23:53:26 UTC ++++ src/gallium/targets/opencl/meson.build +@@ -30,7 +30,7 @@ llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBR + endif + + llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir') +-opencl_libname = with_opencl_icd ? 'MesaOpenCL' : 'OpenCL' ++opencl_libname = with_opencl_icd ? 'MesaOpenCL' + get_option('egl-lib-suffix') : 'OpenCL' + + polly_dep = null_dep + polly_isl_dep = null_dep +@@ -117,7 +117,7 @@ if with_opencl_icd + + if with_opencl_icd + _config = configuration_data() +- _config.set('OPENCL_LIBNAME', 'MesaOpenCL') ++ _config.set('OPENCL_LIBNAME', 'MesaOpenCL' + get_option('egl-lib-suffix')) + _config.set('OPENCL_VERSION', opencl_version) + configure_file( + configuration : _config, +--- src/gallium/targets/pipe-loader/meson.build.orig 2023-02-01 23:53:26 UTC ++++ src/gallium/targets/pipe-loader/meson.build +@@ -44,7 +44,7 @@ endif + pipe_loader_link_deps += files('pipe.sym') + endif + +-pipe_loader_install_dir = join_paths(get_option('libdir'), 'gallium-pipe') ++pipe_loader_install_dir = join_paths(get_option('libdir'), 'gallium-pipe' + get_option('egl-lib-suffix')) + + _kmsro_targets = [ + driver_kmsro, driver_v3d, driver_vc4, driver_freedreno, driver_etnaviv, --- src/gbm/backends/dri/gbm_dri.c.orig 2020-05-30 21:28:01 UTC +++ src/gbm/backends/dri/gbm_dri.c @@ -307,14 +307,6 @@ dri_bind_extensions(struct gbm_dri_device *dri, diff --git a/graphics/mesa-devel/pkg-plist b/graphics/mesa-devel/pkg-plist index 2581bcdbaffa..8a41ab2b855f 100644 --- a/graphics/mesa-devel/pkg-plist +++ b/graphics/mesa-devel/pkg-plist @@ -1,4 +1,6 @@ %%VKLAYERS%%bin/mesa-overlay-control.py +%%NO_COINST%%%%OPENCL%%etc/OpenCL/vendors/mesa.icd +%%OPENCL%%etc/OpenCL/vendors/rusticl.icd %%COINST%%@sample etc/libmap.d/mesa%%SUFFIX%%.conf.sample %%NO_COINST%%include/EGL/eglext_angle.h %%NO_COINST%%include/EGL/eglmesaext.h @@ -12,12 +14,22 @@ %%panfrost%%lib/dri%%SUFFIX%%/rockchip_dri.so %%VAAPI%%%%r600%%lib/dri%%SUFFIX%%/r600_drv_video.so %%VAAPI%%%%radeonsi%%lib/dri%%SUFFIX%%/radeonsi_drv_video.so +%%OPENCL%%%%crocus%%lib/gallium-pipe%%SUFFIX%%/pipe_crocus.so +%%OPENCL%%%%iris%%lib/gallium-pipe%%SUFFIX%%/pipe_iris.so +%%OPENCL%%%%r600%%lib/gallium-pipe%%SUFFIX%%/pipe_r600.so +%%OPENCL%%%%radeonsi%%lib/gallium-pipe%%SUFFIX%%/pipe_radeonsi.so %%NO_COINST%%lib/libEGL_mesa%%SUFFIX%%.so lib/libEGL_mesa%%SUFFIX%%.so.0 lib/libEGL_mesa%%SUFFIX%%.so.0.0.0 %%X11%%%%NO_COINST%%lib/libGLX_mesa%%SUFFIX%%.so %%X11%%lib/libGLX_mesa%%SUFFIX%%.so.0 %%X11%%lib/libGLX_mesa%%SUFFIX%%.so.0.0.0 +%%OPENCL%%lib/libMesaOpenCL%%SUFFIX%%.so +%%OPENCL%%lib/libMesaOpenCL%%SUFFIX%%.so.1 +%%OPENCL%%lib/libMesaOpenCL%%SUFFIX%%.so.1.0.0 +%%OPENCL%%lib/libRusticlOpenCL.so +%%OPENCL%%lib/libRusticlOpenCL.so.1 +%%OPENCL%%lib/libRusticlOpenCL.so.1.0.0 %%VKLAYERS%%lib/libVkLayer_MESA_device_select.so %%VKLAYERS%%lib/libVkLayer_MESA_overlay.so %%NO_COINST%%lib/libgbm%%SUFFIX%%.so