Commit graph

1068 commits

Author SHA1 Message Date
Eric Engestrom
6872db98fb meson: auto-disable draw-use-llvm when llvm=disabled
The option's description is:
> Whether to use LLVM for the Gallium draw module, if LLVM is included.

Let's disable it right away if LLVM is disabled, to avoid some
configurations from failing.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38558>
(cherry picked from commit 37c7d19e46)
2025-12-03 11:34:49 +01:00
Eric Engestrom
0cbf8cc0ca meson: auto-disable amd-use-llvm when llvm=disabled
The option's description is:
> Whether to use LLVM for the AMD drivers, if LLVM is included.

Let's disable it right away if LLVM is disabled, to avoid configurations
like the one in the issue below from failing.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14306
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38558>
(cherry picked from commit 69bb927ebf)
2025-12-03 11:34:49 +01:00
Matt Turner
23be36fc01 meson: Fix sysprof-capture-4 dependency
The versioning scheme changed in v45.0 (the previous version was
3.48.0). As such, this version check would wrongly accept e.g. 48.0.

Fixes: e9341568fa ("meson: require sysprof-capture-4 >= 4.49.0")
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38557>
(cherry picked from commit ad14942300)
2025-12-03 11:34:48 +01:00
Christian Gmeiner
11e7b717fa meson: require sysprof-capture-4 >= 4.49.0
When Mesa is compiled with sysprof support, applications can crash with a
segfault during shutdown. This happens because sysprof_collector_mark()
registers thread-local storage destructors that get called after the library
containing the destructor code has been unloaded.

The problem was fixed in sysprof https://gitlab.gnome.org/GNOME/sysprof/-/merge_requests/152

CC: mesa-stable
Closes: mesa/mesa#13571
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38347>
(cherry picked from commit e9341568fa)
2025-12-03 11:34:45 +01:00
Mauro Rossi
4ea070a741 amd: require LLVM when amd-use-llvm is enabled
Commit 2aaa6ebb "build/amd: add amd-use-llvm build option"
allows to build radeonsi and radv without LLVM dependency
so LLVM constraint is applicable when amd-use-llvm=true

Fixes: 82047fa8 ("amd: drop support for LLVM 15, 16, 17")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37695>
(cherry picked from commit dd2476a257)
2025-10-15 13:55:11 +02:00
Quentin Schulz
3445cb5577 meson: fix libcl assert() reproducibility
The current -fmacro-prefix-map only handles removal of relative paths
but we still need to handle absolute paths.

The following path can be found in libvulkan_panfrost.so when building
with Yocto for example:
/work/build/tmp/work/cortexa76-cortexa55-crypto-poky-linux/mesa/25.2.0/sources/mesa-25.2.0/src/panfrost/libpan/../../util/bitpack_helpers.h

These paths currently seem to only appear in the binary in strings that
start with "Shader assertion fail at " which seems to indicate there are
calls to assert() with absolute paths as well as relative paths (which
are already patched with fmacro-prefix-map).

By stripping the project source and build root directories from the
paths with -fmacro-prefix-map, we get rid of this reproducibility issue
(which incidentally makes the build fail due to buildpaths QA issue).

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36927>
(cherry picked from commit b1a28b1165)
2025-09-17 13:59:18 +02:00
Quentin Schulz
e1ddd68a84 meson: replace global_source_root/global_build_root with project_*
global_source_root() and global_build_root() typically shouldn't be used
in case the current project can be used as a subproject as it'll return
the path to the main project[1][2].

Instead, let's do as suggested by the documentation and use
project_source_root() and project_build_root() instead.

[1] https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonglobal_source_root
[2] https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonglobal_build_root

Suggested-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36927>
(cherry picked from commit 6afe429b7c)
2025-09-17 13:59:18 +02:00
Iván Briano
9436a96c10 intel: Re-disable ray tracing on 32 bits
We had this disabled before moving to the common framework for BVH
building and lost it along the way.

Fixes: f0e18c475b ("intel: remove GRL/intel-clc")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36522>
(cherry picked from commit bf8ebb6a7d)
2025-08-06 13:43:31 +02:00
Faith Ekstrand
6c61751c1b meson: Require libX11 >= 1.8
Starting with version 1.8, libX11 calls XInitThreads() from the library
constructor so we can just assume we always have threaded X11.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36123>
2025-07-16 01:32:54 +00:00
Daniel Stone
355b96413d egl/wayland: Move bind_wayland_display to legacy build option
Similar to how support for X11's DRI2 protocol was deprecated in 24.2,
begin deprecating EGL_WL_bind_wayland_display (including
eglBindWaylandDisplayWL et al) by moving it behind a legacy-wayland
build option.

This extension was originally created in a pre-dmabuf world, where we
didn't have a universally-accepted way of exchanging buffers between
client and compositor, or even really the ability to describe formats
and modifiers universally.

Since then, the world has settled on dmabuf with DRM FourCC and
modifiers. We've had the zwp_linux_dmabuf_v1 protocol for 10 years now:
both clients and compositors implement this protocol to handle buffer
sharing. Compositors either use EGL_EXT_image_dma_buf_import or the
Vulkan dmabuf extensions to import these into GPU world.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36026>
2025-07-10 14:51:20 +00:00
Emma Anholt
fefa6aa899 dri2: Finish removing the now-unused dep_xcb_dri2.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19942>
2025-07-09 14:31:05 -07:00
Emma Anholt
b4eed47828 glx: clean up a litttle remains of DRI2 support.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19942>
2025-07-09 14:31:05 -07:00
Daniel Stone
08c6ba223b x11: Remove DRI2 support
DRI2 was hidden behind a legacy-x11 build option back in the 24.2
release. It's now been a year, so let's get on with removing it so we
can simplify our winsys interactions.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35885>
2025-07-09 17:49:58 +00:00
Mel Henning
b9a9f6cd53 meson: Allow unnecessary_transmutes for bindgen
Otherwise I get hundreds of "unnecessary transmute" warnings
on rustc 1.88.0

Cc: mesa-stable
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35874>
2025-07-08 20:51:44 +00:00
Yiwei Zhang
60eebe964d meson: drop vdrm from virgl and venus
Currently neither virgl nor venus uses vdrm. One big blocker is neither
of them has adopted drm_syncobj yet.

Fixes: 1a6fc7006a ("meson: split subdir for virtio/vdrm and virtio/vulkan")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35933>
2025-07-04 09:50:04 +00:00
Eric Engestrom
4be493862d meson: only run symbols-check if nm is available
And drop the redundant check from symbols-check.py, which was actually
masking all kinds of issues.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35891>
2025-07-02 19:21:25 +00:00
Adam Jackson
6a28d6707d meson: Require LLVM 8 or newer
This isn't a huge cleanup on its own, but it lets us start assuming
coroutine support, and I would like to unify graphics shader dispatch
to work the same way as compute shader dispatch.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35374>
2025-07-02 18:49:22 +00:00
Dylan Baker
2e2826d121 meson: use .enable_if for intel tools dependency on expat
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35840>
2025-07-01 17:40:03 +00:00
Dylan Baker
66a30385fe meson: change RadV dependency on LLVM to an ACO tests dependency
RadV itself doesn't require LLVM, only the ACO tests do. So stop
requiring LLVM for ACO without its tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35840>
2025-07-01 17:40:03 +00:00
Dylan Baker
39ccd7899c meson: use feature options for LLVM
This allows us to get better error messages in cases where LLVM has been
explicitly disabled but not found, as well making use of the feature
object for the required argument to dependency. This in turn can give
better error messages when the object is used incorrectly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35840>
2025-07-01 17:40:03 +00:00
Nicolas Dufresne
4008300672 build: Include panfrost to the tools 'all' list
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35775>
2025-06-26 21:55:17 +00:00
Nicolas Dufresne
3ce37fcbb5 build: Sort the tools 'all' list
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35775>
2025-06-26 21:55:17 +00:00
Dylan Baker
dd45e25dc3 meson: update b_sanitize check for Meson >= 1.8
In Meson 1.8 the b_sanitize option was changed from an enumerated set of
known sanitizers to an array of options to test with `-fsanitize`, this
means that the thread sanitizer could be used in conjunction with one
or more other sanitizers and we need to account for this. Use
`.contains()` to check if `thread` is in the sanitizer list

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35747>
2025-06-26 14:59:27 +00:00
Eric Engestrom
1a6fc7006a meson: split subdir for virtio/vdrm and virtio/vulkan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35723>
2025-06-25 22:21:48 +00:00
Eric Engestrom
a1daeb87a8 meson: fix vdrm inclusion logic
This is about which driver use vdrm, not which OS we're on.

Fixes the build on non-KMS/DRM system.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12899
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35723>
2025-06-25 22:21:48 +00:00
Eric Engestrom
b4ed35994d meson: bump required meson version to 1.4
See https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35652#note_2973761

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35742>
2025-06-25 21:55:16 +00:00
Eric Engestrom
474774ea58 meson: drop error for meson < 1.3 since we require 1.3+ already
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35742>
2025-06-25 21:55:16 +00:00
Mary Guillemard
e8137404b6 meson: make clz available in OpenCL code
for various math helpers.

the clzll version isn't available since long long is 128-bit for CL.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35639>
2025-06-20 10:11:52 +00:00
Gurchetan Singh
f7a9991b89 mesa: add option to enable virtgpu_kumquat FFI for gfxstream
Will be used by Cuttlefish CI/CD, but also commonly used by
gfxstream developers.

meson setup gfxstream-build -Dvulkan-drivers="gfxstream" -Dgallium-drivers="" -Dvirtgpu_kumquat=true -Dopengl=false -Drust_std=2021

In distros, virtgpu_kumquat is not expected to be packaged since
it is a CI/CD tool.

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35210>
2025-06-17 22:28:55 +00:00
Matt Jolly
1a698c75ae build: Rust: Bump minimum Meson and bindgen version
Meson 1.7.0 is required to ensure that generated bindings
are suitable for use with the selected Rust compiler.

Bindgen is bumped to 0.71.1 which has more permissive handling of
`--rust-target`, enabling (almost) any valid Rust version to be
passed as a target; `-nightly` and `-beta*` suffixes are an exception
to this.

This behaviour is expected to improve further with later versions of
Meson; upstream fixes have landed that:

 - pass a stripped version string to bindgen
 - additionally pass an appropriate `--rust-edition` if `rust_std` is
   set (or "nightly" if the compiler is `nightly`).

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12680
Bug: https://bugs.gentoo.org/946913
Signed-off-by: Matt Jolly <kangie@gentoo.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33725>
2025-06-17 16:51:15 +00:00
Sil Vilerino
38d2133e3e ci: Add Windows SDK 26100 to msvc image
Keep older 10.0.20348.0 SDK as well. Also change:
mesa_deps_test_piglit - Add CMAKE_POLICY_VERSION_MINIMUM=3.5 and _UCRT_NOISY_NAN
mesa_deps_test_deqp - Add CMAKE_POLICY_VERSION_MINIMUM=3.5 and CMAKE_SYSTEM_VERSION=10.0.20348.0
meson: When building with MSVC, add -D_UCRT_NOISY_NAN to workaround Win SDK 26100

D_UCRT_NOISY_NAN is for SDK 26100 issue:
https://developercommunity.visualstudio.com/t/NAN-is-no-longer-compile-time-constant-i/10688907

Reviewed-by: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35264>
2025-06-05 22:02:01 +00:00
Lionel Landwerlin
f0e18c475b intel: remove GRL/intel-clc
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35227>
2025-05-29 20:17:13 +00:00
Matt Turner
278d894146 meson: add wrap for libdrm
This allows building Mesa with the Android NDK, which doesn't provide
libdrm.

We will generate an `Android.bp` file using the `ninja-to-soong` tool
(https://github.com/rjodinchr/ninja-to-soong), and to do this we run
Mesa's standard meson build system to generate the ninja commands that
we then translate to soong.

That meson invocation is done using the Android NDK, which doesn't
provide libdrm, so until we find an alternative solution[*] we provide a
wrap file that builds libdrm as part of the Mesa build (but does not
install it--we still use the Android-provided libdrm at runtime)

Co-authored-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35058>
2025-05-27 16:07:29 +00:00
Mike Blumenkrantz
00aaef9f12 delete gallium-nine
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
farewell, old friend

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34887>
2025-05-23 13:43:37 -04:00
Mike Blumenkrantz
3be2c47db2 delete the XA frontend
this is unmaintained and untested

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34823>
2025-05-23 12:46:23 -04:00
Pohsiang (John) Hsu
d348fd5fb5 mediafoundation: Add mediafoundation frontend
Reviewed-by: <yuboxie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34843>
2025-05-23 15:30:04 +00:00
Christian Gmeiner
9da5eafa8e util/perf: Add sysprof integration
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34893>
2025-05-23 11:27:14 +00:00
LingMan
3fbee8bae6 meson: Streamline silencing of warnings in bindgen generated code
Everyone was doing roughly the same.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34969>
2025-05-21 17:11:08 +00:00
Sil Vilerino
33f670d869 d3d12/meson: Add USE_D3D12_PREVIEW_HEADERS compiler flag based on dep_dxheaders.version()
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13126

Reviewed-by: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35057>
2025-05-19 11:32:17 -04:00
Alyssa Rosenzweig
d2ac44dfde meson: make ffs available in OpenCL code
for u_foreach_bit.

the ffsll version isn't available since long long is 128-bit for CL.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34909>
2025-05-14 11:29:09 -04:00
Mike Blumenkrantz
5844dea316 delete clover
there comes a time when a project has to be declared unfit to remain
in the tree

this frontend hasn't seen actual development in about 6 years

if someone has a pressing need to continue development, there's no
blocker to un-deleting it, but unless that happens, there's now a
more featureful, more conformant, more active CL frontend in the tree

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19385>
2025-04-16 10:01:44 -04:00
Adam Jackson
c4b305079d meson: Simplify the power8 optimization logic
If it compiles, it works. And there's not a particularly good reason to
disable it, so don't let people disable it.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34239>
2025-04-14 14:12:30 +00:00
Mike Blumenkrantz
cf40099730 meson: deprecate gallium-xa
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
this is not maintained and will be removed in a future version

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34216>
2025-04-09 23:16:42 +00:00
Mike Blumenkrantz
6b6cb825e9 meson: deprecate gallium-nine
this is not maintained and will be removed in a future version

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34216>
2025-04-09 23:16:41 +00:00
K900
3d7bfcf984 meson: support building with system libgbm
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This is the next step towards making libgbm just a loader.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33890>
2025-04-09 12:15:33 +00:00
Robert Mader
8b76f521a0 meson: Bump minimum version to 1.3.0
Builds currently fail on older versions since the commit
below.

Fixes: f35172b6a4 (meson: make CL args common)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34313>
2025-04-04 17:15:34 +00:00
Eric Engestrom
a39090921e meson: drop deprecated swrast alias for softpipe+llvmpipe
We accidentally kept it one more release cycle than we meant to ^^'

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34217>
2025-03-26 21:44:26 +00:00
Mike Blumenkrantz
773f84ccc9 meson: add i915 to 'all' build for gallium-drivers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34046>
2025-03-13 22:12:56 +00:00
Eric Engestrom
a0b457aca6 meson: announce that clover is deprecated (slated for removal)
See https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19385;
the timeline is not 100% decided yet, but let's warn users already.

Suggested-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34021>
2025-03-13 12:20:45 +00:00
Samuel Pitoiset
5fe5fb147e meson: add build-radv-tests option
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33875>
2025-03-12 09:07:15 +00:00