Commit Graph

1033 Commits

Author SHA1 Message Date
Mel Henning
d6ef45b48b 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>
(cherry picked from commit b9a9f6cd53)
2025-07-15 16:19:56 +02:00
LingMan
d78e41e89c 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>
(cherry picked from commit 3fbee8bae6)
2025-07-15 16:19:56 +02:00
Eric Engestrom
e6b9543668 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>
(cherry picked from commit 4be493862d)
2025-07-15 16:19:54 +02:00
Yiwei Zhang
b67b5cbec2 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>
(cherry picked from commit 60eebe964d)
2025-07-15 16:19:54 +02:00
Eric Engestrom
da0f67c5d0 meson: split subdir for virtio/vdrm and virtio/vulkan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35723>
(cherry picked from commit 1a6fc7006a)
2025-07-15 16:19:54 +02:00
Eric Engestrom
1bc18de415 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>
(cherry picked from commit a1daeb87a8)
2025-07-02 16:19:31 +02: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
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
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
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
Eric Engestrom
1f93dd7d37 meson: simplify video-codecs option parsing
The extra `all_free` that now remains in the list will be ignored in the
loop below anyway so there is no need to have complex code to try to
remove it.

This also means it becomes possible to set things like
`-D video-codecs=all_free,vc1dec`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33949>
2025-03-11 20:21:57 +00:00
Marek Olšák
fefb1a6fb3 meson: remove with_shared_glapi variable (it's always true)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33794>
2025-03-06 17:13:22 +00:00
Marek Olšák
e5c76088e9 meson: never use static glapi because shared glapi is also static and better
Shared glapi is already statically linked with libmesa (src/mesa),
and some parts are statically linked with loaders.

Static glapi will be removed after this is merged.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33794>
2025-03-06 17:13:22 +00:00
Alyssa Rosenzweig
4d6e37066a meson,clc: set CL standard from meson
this is slightly less weird I think.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33879>
2025-03-06 00:43:59 +00:00
Alyssa Rosenzweig
256cc0c927 meson: set NDEBUG appropriately for OpenCL
this strips device-side asserts in release drivers. this is a behaviour change
for asahi/panfrost/nvk, but hopefully a welcome one!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33879>
2025-03-06 00:43:59 +00:00
Alyssa Rosenzweig
f35172b6a4 meson: make CL args common
this will let us unify behaviour across drivers a bit more.

no functional change here. (intel is specifically excluded to avoid a functional
change.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33879>
2025-03-06 00:43:59 +00:00
Marek Olšák
027ccd963b Remove osmesa
It's redundant with EGL surfaceless and it doesn't have much use.

It's also available from the amber branch, so distros should get it from
there if they want to continue packaging it.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33836>
2025-03-04 00:40:39 +00:00
Xaver Hugl
53b40a40f4 increase required wayland-protocols version to 1.41
This version contains the color management protocol.

This commit also adjusts the build-wayland script to mention
that the DEBIAN_BASE_TAG also has to be bumped.

Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32038>
2025-02-25 21:24:11 +00:00
Alyssa Rosenzweig
feedd427b3 nvk: rewrite query copy shader in CL C
as previously discussed.

this is using "library CL" instead of kernel CL, which is the older way of doing
things. it works, it just has more boilerplate per-kernel than we'd want
otherwise. but library CL is basically free to integrate into a driver, whereas
kernel CL requires a lot more upfront investment. (I'm working on cleaning that
up but we're not quite there yet.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33362>
2025-02-24 21:15:26 +00:00
Dmitry Baryshkov
6f3062dffa meson: add freedreno (turnip) Vulkan to arm64 defaults
On Aarch64 enable freedreno Vulkan driver (turnip) by default. It is
stable enough to be enabled by default on the relevant platform.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33462>
2025-02-11 14:35:16 +00:00
Mary Guillemard
20970bcd96 panfrost: Add base of OpenCL C infrastructure
This allows compiling CL shaders into a single SPIR-V library per arch,
NIR call bindings for each functions and precompilled binaries for each
entrypoints.

We are only going to support Bifrost and Valhall for this.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32720>
2025-02-11 12:33:23 +00:00
Jung-uk Kim
f9fc7392fa FreeBSD: Disable support for "-mtls-dialect" for FreeBSD
Clang 19 supports "-mtls-dialect=" but FreeBSD does not support "-mtls-dialect=gnu2".
Skip auto-detection for FreeBSD.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31931>
2025-02-04 19:18:44 +00:00
Lionel Landwerlin
6d5375017a compiler: drop vtn_bindgen
Now unused

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33329>
2025-02-01 07:54:37 +00:00
Marek Olšák
82047fa82f amd: drop support for LLVM 15, 16, 17
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33211>
2025-02-01 04:22:30 +00:00
Jesse Natalie
049015a7b8 meson: Enable /Zc:preprocessor for MSVC
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33294>
2025-02-01 01:20:52 +00:00
Alyssa Rosenzweig
3b1166da8c meson: factor out with_driver_using_cl
adding a new bindgen-using driver should not require touching 4 different meson
files! factor out the expression, since it's a pain otherwise.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33099>
2025-01-31 16:17:58 +00:00
Karol Herbst
fe8a0d3548 clc: use SetUseHighestVersion when linking spirvs
This allows us to link spirvs with different versions.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33286>
2025-01-31 14:32:27 +00:00
Erik Faye-Lund
8fb48ad4f7 meson: build panvk by default on arm
PanVK on V10 GPUs has reached production quality, so let's enable
building it by default now.

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Daniel Stone <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33262>
2025-01-29 18:08:15 +00:00
Alyssa Rosenzweig
164a161279 meson: project-wide fs = import('fs')
reduces a bit of boilerplate.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33242>
2025-01-28 23:01:32 +00:00
Lionel Landwerlin
5adac011b8 meson: rework mesa-clc=system handling
In theory you can build a driver using OpenCL kernels with a
-Dmesa-clc=system. That shouldn't require any LLVM/Clang/etc...

But the checks to find the pre-compiled mesa_clc & vtn_bindgen
binaries are in meson files or conditions only triggered if you build
with LLVM (:

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dylan Baker <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33014>
2025-01-25 03:28:07 +00:00
Lionel Landwerlin
b3033dc633 meson: build mesa_clc for Anv/Iris
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dylan Baker <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33014>
2025-01-25 03:28:07 +00:00
Karmjit Mahil
1f9d96ec78 vulkan: Add inital vram-report-limit layer
This Vulkan layer allows reporting a limited VRAM size to the
application. This layer can be useful for testing applications and
games which query for the memory budget adjusting their behavior
accordingly.

They layer does not set a hard limit on the amount of VRAM thus
applications can still make allocations even though the reported
budget might indicate no memory is left, if the set limit is lower
than of actually available VRAM.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30095>
2025-01-24 19:56:43 +00:00
Connor Abbott
671e3a65a6 tu: Support VK_KHR_acceleration_structure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28447>
2025-01-20 01:22:23 +00:00
Pierre-Eric Pelloux-Prayer
22263616ed amd: amdgpu-virtio implementation
Native context support is implemented by diverting the libdrm_amdgpu functions
into new functions that use virtio-gpu.
VA allocations are done directly in the guest, using newly exposed libdrm_amdgpu
helpers (retrieved through dlopen/dlsym).

Guest <-> Host roundtrips can be expensive so we try to avoid them as much as
possible. When possible we also don't wait for the host reply in case where
it's not needed to get correct result.

Implicit sync works because virtio-gpu commands are submitted in order to the
host (there a single queue per device, shared by all the guest processes).

virtio-gpu also only supports one context per file description (but multiple
file descriptions per process) while amdgpu only allows one fd per process,
but multiple contexts per fd. This causes synchronization problems, because
virtio-gpu drops all sync primitive if they belong to the same fd/context/ring:
ie the amdgpu_ctx can't be expressed in virtio-gpu terms.

For now the solution is to only allocate a single amdgpu_ctx per application.

Contrary to radeonsi/radv, amdgpu_virtio can use libdrm_amdgpu directly: the
ones that don't rely on ioctl() are safe to use here.

Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21658>
2025-01-16 12:24:32 +00:00
Manuel Dun
9ab62e6452 Gfxstream: Initial mingw "compilable" Windows version of mesa/gfxstream
Initial "compilable" version of mesa/gfxstream on Windows. For now it is
achieved through "#if !DETECT_OS_WINDOWS" directives hence it is NOT
functional. The compilation works with mingw only and the compilation is
tested in a windows host. This commit is intended to only pass the
compilation process without errors.

Also created stub code for a future windows implementation.

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32795>
2025-01-15 20:57:18 +00:00
Icenowy Zheng
1c59793d2d meson: prefer 'python3' to 'python' when finding python3
Although in some cases python 3.x will come without "3" as suffix,
"python3" should still be preferred because sometimes "python" is python
2.x instead.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33025>
2025-01-15 11:24:41 +00:00
Konstantin Seurer
fac818bdb3 meson: Require glslangValidator when building lavapipe
The tool is required by the runtime for acceleration structures.
Lavapipe uses some of those runtime helpers and will use more of them in
the future (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31426),
especially those that have a hard requirement for the tool.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12412
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12437
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32882>
2025-01-10 00:08:30 +00:00
Aleksi Sapon
60e97e16aa meson: fix finding Python on Windows
On Windows, a venv has no versioned aliased to `python`.
`python3` will never be found from a venv.

Reviewed-by: Dylan Baker <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32934>
2025-01-08 22:47:42 +00:00
Mary Guillemard
5ddeea9a62 meson: Add precomp-compiler and install-precomp-compiler options
As Asahi, Intel and soon Panfrost requires an offline compiler for their
respective internal shaders, this commit adds generic new options to
workaround meson current limitations around cross-compillation.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32719>
2024-12-23 15:09:41 +00:00
Mary Guillemard
13fe5a597b meson: Add mesa-clc and install-mesa-clc options
Due to the cross build issues in current meson, we adds new options to
allow mesa_clc and vtn_bindgen to be installed or searched on the
system.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32719>
2024-12-23 15:09:40 +00:00
Sagar Ghuge
41baeb3810 anv: Implement acceleration structure API
Rework: (Kevin)
- Properly setup bvh_layout
   Our bvh resides in contiguous memory and can be divided into two sections:
      1. anv_accel_struct_header, tightly followed by
      2. actual bvh, which starts with root node, followed by interleaving
         leaves or internal nodes.
- Update comments for some fields for BVH and nodes.
- Properly populate the UUIDs in serialization header
- separate header func into completely two paths based on compaction bit
- Encode rt_uuid at second VK_UUID_SIZE.
- Write query result at correct slot
- add assertion for a 4B alignment
- move bvh_layout to anv_bvh
- Use meson option to decide which files to compile
- The alignment of serialization size is not needed
- Change static_assert to STATIC_ASSERT and move them inside functions

Rework (Sagar)
- Use anv_cmd_buffer_update_buffer instead of MI to copy data

Rework (Lionel)
- Remove flush after builds, and add flush in copy before dispatch
- Handle the flushes in CmdWriteAccelerationStructuresPropertiesKHR properly

Co-authored-by: Kevin Chuang <kaiwenjon23@gmail.com>
Co-authored-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31588>
2024-12-04 10:41:45 +00:00
Eric Engestrom
ffd02b8ad8 meson/megadriver: support various lib suffixes
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32333>
2024-11-26 20:45:41 +00:00
Aaron Ruby
4614097756 meson: Remove experimental from gfxstream driver build
We (QNX) is using this with our VMM, and our Linux reference distro (which is currently in development).
With libaemu removed, it's much easier to integrate into a Linux-guest
build.

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32161>
2024-11-19 00:42:52 +00:00
LingMan
718407e806 mesa: Bump required Rust version to 1.78
The Linux kernel requires Rust 1.78 since version 6.10. Thus, this update is
in line with our Rust update policy.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:13 +00:00
Eric Engestrom
b32d0d4b45 meson: define only once the versions of the x11 deps
This was a "bumped the version, missed one copy" bug waiting to happen.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32032>
2024-11-13 10:35:55 +00:00