[Mesa-dev] initial meson port
Dylan Baker
dylan at pnwbakers.com
Wed Sep 20 20:27:37 UTC 2017
Hi everyone,
A long time ago I made some rumbling about porting mesa to meson (isn't that
confusing). In the mean time I've been bogged down with other projects,
including adding features to meson itself, and trying to write and rebase meson
patches for all of mesa. Unfortunately mesa is a large fast moving project and
trying to writing meson for the entire thing has proven to simply be
intractable, I could spend nearly half my day rebasing to current master, and
that's both demoralizing and error prone.
So I took Jason's advice and started with what mattered to him ;) Vulkan. This
was a chunk big enough to be a decent example, but small and contained enough to
not require lots of rebasing. Intel's "anv" and the AMD "radv" driver share a
large number of dependencies between each other, and demonstrate writing a meson
build system.
You may notice a lot of TODO/FIXME comments here. Some of them are related to
upstream meson bugs (there are two currently, one that I have a pull request for
that is probably ready for merge, and one that I'm working on currently), or
things that need to be implemented for the meson build system to be complete.
There are a few things that will need to be resolved before implementing mesa
and gallium drivers (around dependencies that are hard dependencies for Vulkan,
but soft dependencies for mesa/gallium).
The meson build system is much faster for building these two drivers than the
autotools build system, but there are a couple of caveats worth mentioning
before I give you the numbers. 1: meson doesn't check for as many features,
flags, or dependencies; 2: meson doesn't build glx, egl, or the glsl compiler,
just enough of the glsl_compiler to get anv and radv building. The 1st will just
naturally happen, the second could be fixed.
Methodology : I ran each build system in as close of a configuration as I could
(out of tree, same number of jobs) using zsh's time. These were run on a 2 core
4 thread Intel skylake. Note that ninja by default runs with logical cores + 2
jobs.
Commands
autotools : 'mkdir autotools ; cd autotools ; ../autogen.sh \
--without-dri-drivers --without-gallium-drivers \
--with-platforms=x11,wayland --with-vulkan-drivers=intel,radeon \
&& make -j6'
meson : meson build -Dvulkan-drivers=intel,amd -Dplatforms=x11,wayland && ninja -C build
Results
autotools : sh -c 535.34s user 30.33s system 310% cpu 3:02.05 total
meson : sh -c 136.58s user 11.98s system 372% cpu 39.895 total
I'm hopeful that we can start landing the meson build system incrementally, so
that the rebasing pain can be eased. I'm working on getting i965 and radeonSI
as my next targets (I have access to hardware to test those), and I'll continue
to add additional drivers from there.
Dylan
More information about the mesa-dev
mailing list