Skip to Content.
Sympa Menu

sm-commit - [[SM-Commit] ] GIT changes to master grimoire by Justin Boffemmyer (e45533b9232161d28844b1672c29e0891b036a37)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Justin Boffemmyer <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
  • Subject: [[SM-Commit] ] GIT changes to master grimoire by Justin Boffemmyer (e45533b9232161d28844b1672c29e0891b036a37)
  • Date: Fri, 24 Jan 2025 14:47:45 +0000

GIT changes to master grimoire by Justin Boffemmyer <flux AT sourcemage.org>:

graphics-libs/mesa/BUILD | 34 +----
graphics-libs/mesa/CONFIGURE | 250
++++++++++++++++++++++++++++++++++---------
graphics-libs/mesa/DEPENDS | 8 +
graphics-libs/mesa/HISTORY | 5
4 files changed, 222 insertions(+), 75 deletions(-)

New commits:
commit e45533b9232161d28844b1672c29e0891b036a37
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

graphics-libs/mesa: add support, improve options

Add support for more drivers. Upstream mesa includes drivers for ARM
platforms, and they are now added here.

Improve option presentation and handling. For options that are entirely
dependent on other options being enabled, they are only presented when
their dependents are enabled. Many of the option messages were also
reworded or expanded upon to better clarify their meaning and use for
the user.

The handling of empty list options was also corrected in BUILD.

diff --git a/graphics-libs/mesa/BUILD b/graphics-libs/mesa/BUILD
index 106a5f6..0554311 100755
--- a/graphics-libs/mesa/BUILD
+++ b/graphics-libs/mesa/BUILD
@@ -16,8 +16,8 @@ case "$HOST" in
for i in "${unportable[@]}"; do
MESA_TOOLS="${MESA_TOOLS// $i / }"
done
- MESA_TOOLS="${MESA_TOOLS## }"
- MESA_TOOLS="${MESA_TOOLS%% }"
+ MESA_TOOLS="${MESA_TOOLS# }"
+ MESA_TOOLS="${MESA_TOOLS% }"
;;
esac &&

@@ -67,9 +67,7 @@ if [[ "${MESA_BRANCH}" != "scm" ]] ;then
meson_opt boolean "opencl-spirv" "$MESA_OPENCL_SPIRV"
fi &&

-if [ -z "$MESA_GALLIUM" ] || list_find "$MESA_GALLIUM" none ;then
- meson_opt list "gallium-drivers" ""
-else
+if [ -n "$MESA_GALLIUM" ] && ! list_find "$MESA_GALLIUM" none ;then
meson_opt list "gallium-drivers" "$MESA_GALLIUM"
fi &&

@@ -81,9 +79,7 @@ if [[ "$MESA_EGL" == y ]] && [ -n "$MESA_EGL_DEFAULT" ]
;then
meson_opt choice "egl-native-platform" "$MESA_EGL_DEFAULT"
fi &&

-if [ -z "$MESA_LIBCLC_STATIC_LINK" ] || list_find "$MESA_LIBCLC_STATIC_LINK"
none ;then
- meson_opt list "static-libclc" ""
-else
+if [ -n "$MESA_LIBCLC_STATIC_LINK" ] && ! list_find
"$MESA_LIBCLC_STATIC_LINK" none ;then
meson_opt list "static-libclc" "$MESA_LIBCLC_STATIC_LINK"
fi &&

@@ -91,31 +87,23 @@ if [ -n "$MESA_PERFETTO_SOURCES" ] ;then
meson_opt list "datasources" "$MESA_PERFETTO_SOURCES"
fi &&

-if [ -z "$MESA_TOOLS" ] || list_find "$MESA_TOOLS" none ;then
- meson_opt list "tools" ""
-else
+if [ -n "$MESA_TOOLS" ] && ! list_find "$MESA_TOOLS" none ;then
meson_opt list "tools" "$MESA_TOOLS"
fi &&

-if [ -z "$MESA_VIDEO_CODECS" ] || list_find "$MESA_VIDEO_CODECS" none ;then
- meson_opt list "video-codecs" ""
-else
+if [ -n "$MESA_VIDEO_CODECS" ] && ! list_find "$MESA_VIDEO_CODECS" none ;then
meson_opt list "video-codecs" "$MESA_VIDEO_CODECS"
fi &&

-if [ -z "$MESA_VULKAN" ] || list_find "$MESA_VULKAN" none ;then
- meson_opt list "vulkan-drivers" ""
-else
+if [ -n "$MESA_VULKAN" ] && ! list_find "$MESA_VULKAN" none ;then
meson_opt list "vulkan-drivers" "$MESA_VULKAN"
fi &&

-if [ -z "$MESA_VULKAN_LAYERS" ] || list_find "$MESA_VULKAN_LAYERS" none ;then
- meson_opt list "vulkan-layers" ""
-else
+if [ -n "$MESA_VULKAN_LAYERS" ] && ! list_find "$MESA_VULKAN_LAYERS" none
;then
meson_opt list "vulkan-layers" "$MESA_VULKAN_LAYERS"
fi &&

-OPTS="${OPTS// / }" &&
-OPTS="${OPTS## }" &&
-OPTS="${OPTS%% }" &&
+OPTS="$(echo "$OPTS" | sed 's,\s\+, ,g')" &&
+OPTS="${OPTS# }" &&
+OPTS="${OPTS% }" &&
default_build
diff --git a/graphics-libs/mesa/CONFIGURE b/graphics-libs/mesa/CONFIGURE
index 76ec4ac..ee8e356 100755
--- a/graphics-libs/mesa/CONFIGURE
+++ b/graphics-libs/mesa/CONFIGURE
@@ -1,61 +1,186 @@
. "${GRIMOIRE}/config_query_multi.function" &&
. "${GRIMOIRE}/MESON_CONFIGURE" &&

+sort_list() {
+ printf '%s\n' "$@" | sort -fu
+}
+
config_query_multi MESA_PLATFORMS "Which window systems to support?" \
auto \
wayland \
x11 \
&&

-config_query_multi MESA_DRM "Which libdrm hardware to use?" \
- AMD \
- INTEL \
- NOUVEAU \
- RADEON \
+config_query_multi MESA_ARCH "Which hardware platforms to support?" \
+ ARM \
+ x86 \
+ &&
+
+local vendors="VMware" &&
+if list_find "$MESA_ARCH" x86 ;then
+ vendors="$vendors AMD Intel Nvidia Microsoft-WSL"
+fi &&
+if list_find "$MESA_ARCH" ARM ;then
+ vendors="$vendors Freedreno Imagination Mali Nvidia RaspberryPi"
+fi &&
+vendors="${vendors## }" &&
+vendors="${vendors%% }" &&
+
+config_query_multi MESA_HW "Which graphics vendor hardware to support?" \
+ $(sort_list $vendors) \
&&

+for vendor in "$MESA_HW" ;do
+ case "$vendor" in
+ AMD) drivers="$drivers amdgpu radeon" ;;
+ Imagination) drivers="$drivers etnaviv" ;;
+ Mali) drivers="$drivers lima panfrost" ;;
+ Qualcomm) drivers="$drivers freedreno" ;;
+ Intel) drivers="$drivers intel" ;;
+ Nvidia)
+ if list_find "$MESA_ARCH" x86 ;then
+ drivers="$drivers nouveau"
+ fi &&
+ if list_find "$MESA_ARCH" ARM ;then
+ drivers="$drivers tegra"
+ fi
+ ;;
+ RaspberryPi) drivers="$drivers rpi" ;;
+ Microsoft-WSL) drivers="$drivers WSL" ;;
+ VMware) drivers="$drivers vmware-mks-stats" ;;
+ esac
+done &&
+
+drivers="${drivers# }" &&
+drivers="${drivers% }" &&
+case "$drivers" in
+ *" "*)
+ config_query_multi MESA_DRIVERS "Which drivers to support?" \
+ all \
+ $(sort_list $drivers)
+ ;;
+ *)
+ MESA_DRIVERS="$drivers"
+ ;;
+esac &&
+
+if list_find "$MESA_DRIVERS" etnaviv || list_find "$MESA_DRIVERS" WSL ;then
+ config_query MESA_VULKAN_EXPERIMENTAL "Enable experimental vulkan drivers?"
+fi &&
+
# only suggest drivers for specified hardware
-local AVAILABLE_GALLIUM="d3d12 llvmpipe softpipe svga virgl zink" &&
+local AVAILABLE_GALLIUM="llvmpipe softpipe svga virgl zink" &&
local AVAILABLE_VULKAN="swrast virtio" &&
-if list_find "$MESA_DRM" AMD;then
- AVAILABLE_VULKAN="amd ${AVAILABLE_VULKAN}" &&
+local AVAILABLE_TOOLS="dlclose-skip drm-shim glsl nir" &&
+
+if list_find "$MESA_DRIVERS" amdgpu;then
+ MESA_DRM="$MESA_DRM AMD" &&
+ AVAILABLE_VULKAN="$AVAILABLE_VULKAN amd" &&
config_query MESA_AMD_LLVM "Use LLVM for the AMD drivers?" y
fi &&
-if list_find "$MESA_DRM" RADEON;then
- AVAILABLE_GALLIUM="r300 r600 radeonsi ${AVAILABLE_GALLIUM}"
+
+if list_find "$MESA_DRIVERS" radeon;then
+ MESA_DRM="$MESA_DRM RADEON" &&
+ AVAILABLE_GALLIUM="$AVAILABLE_GALLIUM r300 r600 radeonsi"
fi &&
-if list_find "$MESA_DRM" INTEL;then
- AVAILABLE_GALLIUM="i915 iris crocus ${AVAILABLE_GALLIUM}" &&
- AVAILABLE_VULKAN="intel intel_hasvk ${AVAILABLE_VULKAN}"
+
+if list_find "$MESA_DRIVERS" intel;then
+ MESA_DRM="$MESA_DRM INTEL" &&
+ AVAILABLE_GALLIUM="$AVAILABLE_GALLIUM i915 iris crocus" &&
+ AVAILABLE_VULKAN="$AVAILABLE_VULKAN intel intel_hasvk" &&
+ AVAILABLE_TOOLS="$AVAILABLE_TOOLS intel intel-ui"
fi &&
-if list_find "$MESA_DRM" NOUVEAU;then
- AVAILABLE_GALLIUM="nouveau ${AVAILABLE_GALLIUM}" &&
- AVAILABLE_VULKAN="nouveau ${AVAILABLE_VULKAN}"
+
+if list_find "$MESA_DRIVERS" etnaviv;then
+ MESA_DRM="$MESA_DRM ETNAVIV" &&
+ AVAILABLE_GALLIUM="$AVAILABLE_GALLIUM etnaviv" &&
+ AVAILABLE_VULKAN="$AVAILABLE_VULKAN etnaviv" &&
+ AVAILABLE_TOOLS="$AVAILABLE_TOOLS etnaviv"
+fi &&
+
+if list_find "$MESA_DRIVERS" freedreno;then
+ MESA_DRM="$MESA_DRM FREEDRENO" &&
+ AVAILABLE_GALLIUM="$AVAILABLE_GALLIUM freedreno" &&
+ AVAILABLE_VULKAN="$AVAILABLE_VULKAN freedreno" &&
+ AVAILABLE_TOOLS="$AVAILABLE_TOOLS freedreno"
+fi &&
+
+if list_find "$MESA_DRIVERS" lima;then
+ AVAILABLE_GALLIUM="$AVAILABLE_GALLIUM lima" &&
+ AVAILABLE_TOOLS="$AVAILABLE_TOOLS lima"
+fi &&
+
+if list_find "$MESA_DRIVERS" nouveau;then
+ MESA_DRM="$MESA_DRM NOUVEAU" &&
+ AVAILABLE_GALLIUM="$AVAILABLE_GALLIUM nouveau" &&
+ AVAILABLE_VULKAN="$AVAILABLE_VULKAN nouveau" &&
+ AVAILABLE_TOOLS="$AVAILABLE_TOOLS nouveau"
+fi &&
+
+if list_find "$MESA_DRIVERS" panfrost;then
+ AVAILABLE_GALLIUM="$AVAILABLE_GALLIUM panfrost" &&
+ AVAILABLE_VULKAN="$AVAILABLE_VULKAN panfrost" &&
+ AVAILABLE_TOOLS="$AVAILABLE_TOOLS panfrost"
+fi &&
+
+if list_find "$MESA_DRIVERS" rpi;then
+ MESA_DRM="$MESA_DRM VC4" &&
+ AVAILABLE_GALLIUM="$AVAILABLE_GALLIUM v3d vc4" &&
+ AVAILABLE_VULKAN="$AVAILABLE_VULKAN broadcom" &&
+ AVAILABLE_TOOLS="$AVAILABLE_TOOLS freedreno"
+fi &&
+
+if list_find "$MESA_DRIVERS" tegra;then
+ MESA_DRM="$MESA_DRM TEGRA" &&
+ AVAILABLE_GALLIUM="$AVAILABLE_GALLIUM tegra"
+fi &&
+
+if list_find "$MESA_DRIVERS" vmware;then
+ MESA_DRM="$MESA_DRM vmwgfx" &&
+ AVAILABLE_GALLIUM="$AVAILABLE_GALLIUM vmware"
+fi &&
+
+if list_find "$MESA_DRIVERS" WSL;then
+ AVAILABLE_GALLIUM="$AVAILABLE_GALLIUM d3d12" &&
+ if [[ "$MESA_VULKAN_EXPERIMENTAL" == "y" ]] ;then
+ AVAILABLE_VULKAN="$AVAILABLE_VULKAN microsoft-experimental"
+ fi
fi &&

config_query_multi MESA_GALLIUM "Which gallium (accelerated) drivers to
build?" \
none \
all \
auto \
- $(echo $AVAILABLE_GALLIUM | sort) \
+ $(sort_list $AVAILABLE_GALLIUM) \
&&

if [ -n "$MESA_GALLIUM" ] && ! list_find "$MESA_GALLIUM" none ;then
config_query MESA_GALLIUM_HUD "Enable HUD block/NIC I/O HUD status
support?" n &&

local allow_xa
+ # XA state tracker requires one of the following gallium drivers
for driver in nouveau freedreno i915 svga ;do
if list_find "$MESA_GALLIUM" $driver ;then
allow_xa="y"
fi
- done
+ done &&
+
if [[ "$allow_xa" == "y" ]] ;then
config_query MESA_GALLIUM_XA "Build gallium XA frontend?" n
fi &&

+ if list_find "$MESA_GALLIUM" vmware ;then
+ if ! list_find "$MESA_GALLIUM" svga ;then
+ message "The vmware driver requires gallium svga; adding gallium
svga." &&
+ MESA_GALLIUM="$MESA_GALLIUM svga"
+ fi
+ fi &&
+
if list_find "$MESA_GALLIUM" llvmpipe || list_find "$MESA_GALLIUM"
softpipe ;then
config_query MESA_GALLIUM_D3D9 "Build gallium Direct3D9 (nine)
frontend?" n &&
- config_query MESA_GALLIUM_D3D10 "Build gallium Direct3D10 (WDDM UMD)
frontend?" n
+ if list_find "$MESA_DRIVERS" WSL ;then
+ config_query MESA_GALLIUM_D3D10 "Build gallium Direct3D10 (WDDM UMD)
frontend?" n
+ fi
fi &&

if list_find "$MESA_GALLIUM" d3d12 ;then
@@ -76,7 +201,7 @@ if [ -n "$MESA_GALLIUM" ] && ! list_find "$MESA_GALLIUM"
none ;then
fi
fi &&

- config_query MESA_RUSTICL "Build gallium rusticl frontend?" n &&
+ config_query MESA_RUSTICL "Build gallium rusticl (OpenCL) frontend
(requires rust)?" n &&

if [[ "$MESA_RUSTICL" == "y" ]] ;then
config_query_multi MESA_RUSTICL_DRIVERS "Which drivers to enable with
rusticl by default?" \
@@ -89,7 +214,7 @@ config_query_multi MESA_VULKAN "Which Vulkan drivers to
build?" \
none \
all \
auto \
- $(echo $AVAILABLE_VULKAN | sort) \
+ $(sort_list $AVAILABLE_VULKAN) \
&&

if [ -n "$MESA_VULKAN" ] && ! list_find "$MESA_VULKAN" none ;then
@@ -108,25 +233,38 @@ config_query MESA_SHADER_CACHE "Support on-disk shader
caching?" n &&

# EGL requires DRI, which is only enabled if gallium is enabled
if ! list_find "$MESA_GALLIUM" none ;then
- config_query MESA_EGL "Enable EGL platform support?" n &&
+ # Walyand requires EGL support
+ if list_find "$MESA_PLATFORMS" wayland || (list_find "$MESA_PLATFORMS"
auto && spell_ok wayland) ;then
+ MESA_EGL=y &&
+ persistent_add MESA_EGL
+ else
+ config_query MESA_EGL "Enable EGL platform support?" n
+ fi &&

if [[ "$MESA_EGL" == "y" ]] ;then
+ local egldefaults="drm surfaceless" &&
+ if list_find "$MESA_PLATFORMS" x11 ;then
+ egldefaults="$egldefaults x11"
+ fi &&
+ if list_find "$MESA_PLATFORMS" wayland ;then
+ egldefaults="$egldefaults wayland"
+ fi &&
+ if list_find "$MESA_PLATFORMS" WSL ;then
+ egldefaults="$egldefaults windows"
+ fi &&
config_query_list MESA_EGL_DEFAULT "Which window system should EGL
assume for EGL_DEFAULT_DISPLAY" \
auto \
- drm \
- surfaceless \
- wayland \
- x11
+ $(sort_list $egldefaults)
fi
fi &&

config_query MESA_GLES1 "Support OpenGL ES 1.x?" n &&
config_query MESA_GLES23 "Support OpenGL ES 2.x and 3.x?" n &&
config_query MESA_OPENGL "Enable desktop OpenGL support?" y &&
-config_query MESA_GBM "Enable gbm platform support?" n &&
+config_query MESA_GBM "Enable generic buffer management (GBM) support?" n &&
config_query MESA_OSMESA "Build OSmesa to support off-screen rendering?" n &&

-config_query_list MESA_GLX "Which glx build type (auto or dri recommended)?"
\
+config_query_list MESA_GLX "Which GLX build type (auto or dri recommended)?"
\
auto \
disabled \
dri \
@@ -137,11 +275,11 @@ if list_find "${MESA_GLX}" "disabled"; then
MESA_GLX="disabled"
else
config_query MESA_GLX_DIRECT "Enable direct rendering in GLX and EGL for
DRI?" y &&
- config_query MESA_GLX_READONLY "Disable writable .text section on x86
(decreases performance)?" n
+ config_query MESA_GLX_READONLY "Read-only GLX (disable writable .text
section) on x86 (decreases performance)?" n
fi &&

if [[ "$MESA_EGL" == "y" ]] || ! list_find "$MESA_GLX" disabled ;then
- config_query MESA_GLVND "Enable GLVND support?" n
+ config_query MESA_GLVND "Enable OpenGL vendor-neutral dispatch (GLVND)
support?" n
fi &&

config_query MESA_SPIRV_DXIL "Build support for the SPIR-V to DXIL library?"
n &&
@@ -149,29 +287,32 @@ config_query MESA_SPIRV_DXIL "Build support for the
SPIR-V to DXIL library?" n &
config_query_multi MESA_TOOLS "Which tools to build?" \
none \
all \
- dlclose-skip \
- drm-shim \
- etnaviv \
- freedreno \
- glsl \
- intel \
- intel-ui \
- nir \
- nouveau \
+ $(sort_list $AVAILABLE_TOOLS) \
&&

-config_query MESA_PERFETTO "Enable performance analysis with Perfetto" n &&
-
-if [[ "$MESA_PERFETTO" == "y" ]] ;then
- config_query_multi MESA_PERFETTO_SOURCES "Perfetto datasources to build" \
- auto \
- intel
+local perfetto_sources=""
+if list_find "$MESA_DRIVERS" freedreno ;then
+ perfetto_sources="$perfetto_sources intel"
+fi &&
+if list_find "$MESA_DRIVERS" intel ;then
+ perfetto_sources="$perfetto_sources intel"
+fi &&
+if list_find "$MESA_DRIVERS" panfrost ;then
+ perfetto_sources="$perfetto_sources intel"
+fi &&
+if [ -n "$perfetto_sources" ] ;then
+ config_query MESA_PERFETTO "Enable performance analysis with Perfetto" n &&
+ if [[ "$MESA_PERFETTO" == "y" ]] ;then
+ config_query_multi MESA_PERFETTO_SOURCES "Perfetto datasources to build"
\
+ auto \
+ $(sort_list $perfetto_sources)
+ fi
fi &&

config_query MESA_TEFLON "Enable TensorFlow Lite delegate" n &&
config_query MESA_GPUVIS "Enable tracing markers for gpuvis" n &&

-if list_find "$MESA_DRM" INTEL;then
+if list_find "$MESA_VULKAN" intel || list_find "$MESA_VULKAN" intel_hasvk
;then
config_query MESA_INTEL_RT "Build Intel raytracing support (on supported
hardware)?" n
fi &&

@@ -192,9 +333,18 @@ config_query_multi MESA_VIDEO_CODECS "Which codecs to
build?" \
config_query MESA_XMLCONFIG "Enable custom xmlconfig (driconf) support
(requires expat)?" n &&

# strip any leading or trailing spaces from the driver lists
-MESA_GALLIUM="${MESA_GALLIUM## }" &&
-MESA_GALLIUM="${MESA_GALLIUM%% }" &&
+MESA_DRM="$(echo "$MESA_DRM" | sed 's,\s\+, ,g')" &&
+MESA_DRM="${MESA_DRM# }" &&
+MESA_DRM="${MESA_DRM% }" &&
+MESA_GALLIUM="$(echo "$MESA_GALLIUM" | sed 's,\s\+, ,g')" &&
+MESA_GALLIUM="${MESA_GALLIUM# }" &&
+MESA_GALLIUM="${MESA_GALLIUM% }" &&
+MESA_VULKAN="$(echo "$MESA_VULKAN" | sed 's,\s\+, ,g')" &&
+MESA_VULKAN="${MESA_VULKAN# }" &&
+MESA_VULKAN="${MESA_VULKAN% }" &&
+
+persistent_add MESA_DRM &&
+persistent_add MESA_DIVERS &&
persistent_add MESA_GALLIUM &&
-MESA_VULKAN="${MESA_VULKAN## }" &&
-MESA_VULKAN="${MESA_VULKAN%% }" &&
+persistent_add MESA_GLX &&
persistent_add MESA_VULKAN
diff --git a/graphics-libs/mesa/DEPENDS b/graphics-libs/mesa/DEPENDS
index c83ad0d..e873bf9 100755
--- a/graphics-libs/mesa/DEPENDS
+++ b/graphics-libs/mesa/DEPENDS
@@ -118,12 +118,12 @@ done
if [[ "$allow_va_and_vdpau" == "y" ]] ;then
buildsys_optional_depends libvdpau \
-o gallium-vdpau \
- "gallium vdpau state tracker" \
+ "gallium VDPAU state tracker" \
&&

buildsys_optional_depends libva \
-o gallium-va \
- "gallium va state tracker"
+ "gallium VAAPI state tracker"
fi &&

buildsys_optional_depends lm_sensors \
@@ -158,4 +158,8 @@ fi &&
if [[ "$MESA_XMLCONFIG" == "y" ]] ;then
buildsys_depends expat &&
suggest_depends driconf "to create custom xmlconfig (driconf) files"
+else
+ buildsys_optional_depends expat \
+ -o expat \
+ "Use expat?"
fi
diff --git a/graphics-libs/mesa/HISTORY b/graphics-libs/mesa/HISTORY
index 6d9376a..a130b04 100644
--- a/graphics-libs/mesa/HISTORY
+++ b/graphics-libs/mesa/HISTORY
@@ -1,3 +1,8 @@
+2025-01-24 Justin Boffemmyer <flux AT sourcemage.org>
+ * BUILD: fix handling of empty list options
+ * CONFIGURE: support more drivers, improve interdependent option
selections
+ * DEPENDS: improve hint messages, support expat without xmlconfig
+
2025-01-23 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 24.3.4
* BUILD, CONFIGURE: opencl-spirv flag is for stable branch only


  • [[SM-Commit] ] GIT changes to master grimoire by Justin Boffemmyer (e45533b9232161d28844b1672c29e0891b036a37), Justin Boffemmyer, 01/24/2025

Archive powered by MHonArc 2.6.24.

Top of Page