Commit Graph

676 Commits

Author SHA1 Message Date
James Jones 7f615c66fb meson: Add a GBM backends search path build option
This is the list of locations where GBM will look
for alternate backend implementations based on the
DRM driver name. It defaults to $libdir/gbm.

On Android, this path is currently hard-coded to
/vendor/lib[64]/gbm.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
Bas Nieuwenhuizen c88d1bace3 meson: Bump libdrm for amdgpu to 2.4.107.
For capture/replay va stability.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10570>
2021-07-05 17:27:51 +00:00
Luis Felipe Strano Moraes 7f8652d72d meson: print information about layers being built as part of summary
reviewed-by: Dylan Baker <dylan@pnwbakers.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11673>
2021-07-01 16:42:07 +00:00
Roman Stratiienko f85d3113b2 egl: android: add IMapper@4 metadata API buffer_info getter
Starting from Android-11 Google introduces generalized API
to access buffer information. This API is a part of IMapper@4 HAL.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6045>
2021-06-30 16:50:44 +00:00
Pierre-Eric Pelloux-Prayer 11528b621c mesa/shaderapi: add an optional shader override mechanism
MESA_SHADER_READ_PATH is handy but it's not usable in
all cases.

This commit allows to implement an alternative mechanism
without assuming too much about how it's done, nor where/how
the shaders are stored.

When this is enabled MESA_SHADER_DUMP_PATH,
MESA_SHADER_CAPTURE_PATH and MESA_GLSL env var handling is
disabled.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11621>
2021-06-28 10:10:35 +02:00
Jeremy Newton 9c25107495 Update libva requirement
Bump libva requirement since mesa references API not present prior to
libva API version 1.1.0 (libva 2.1.0 release).

See fbf6511e35, which added VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2
requiring API version 1.1.0 or later.

Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11508>
2021-06-28 07:30:21 +00:00
Enrico Galli cf385cf68c util: Add qsort_r/s args adapter for MSVC and BSD/macOS
MSVC's qsort_s behaves similarly to sort_r. Unfortunately, qsort_s's
compare function has the "context"/"args" as its first argument. BSD's
qsort_r has a different order than GNU's qsort_r. Finally, C11 added
qsort_s's which look like GNU's gsort_r.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>
2021-06-24 20:05:12 +00:00
Jason Ekstrand bdd460fdcb util: Add an implementation of qsort_r for non-GNU platforms
Android and MSVC don't have qsort_r() so let's provide a util wrapper
that uses the old qsort and thread-local storage.  We use C++ for this
because thread_local is built into C++11 and we can't rely on C11
everywhere.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>
2021-06-24 20:05:12 +00:00
Boris Brezillon d970fe2e9d panfrost: Add a Vulkan driver for Midgard/Bifrost GPUs
Based on turnip.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11139>
2021-06-22 14:07:34 +00:00
Yurii Kolesnykov 89b4f337d5 c_std=c11 in meson default_options
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1020

Co-authored-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Yurii Kolesnykov <root@yurikoles.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6935>
2021-06-20 11:36:06 +03:00
Zhaofeng Li 9908da1b7a Add default driver selections for RISC-V
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11346>
2021-06-17 01:29:38 +00:00
Ian Romanick 70c9726e06 util: Consider CPU affinity when detecting number of CPUs
A similar path can be used on at least FreeBSD using cpuset_getaffinity.
This is how Ninja determines the number of available CPUs on that
platform.  See the GetProcessorCount function in util.cc:

https://github.com/ninja-build/ninja/blob/master/src/util.cc

v2: Fix counting the number of available CPUs.  The CPU_COUNT API does
not work the way I thought it did. :face_palm: Noticed by Marek.

Reviewed-by: Adam Jackson <ajax@redhat.com> [v1]
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> [v1]
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11228>
2021-06-15 20:01:53 +00:00
Dave Airlie f3630548f1 crocus: initial gallium driver for Intel gfx 4-7
This is a gallium driver for the Intel gfx 4-7 GPUs.

It was initially cloned from the iris driver by Ilia Mirkin,
then I ported over large reams of code from i965 until it worked.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11146>
2021-06-14 06:34:05 +10:00
Erico Nunes 479bda7848 meson: kmsro: require dri3 for X11
The current implementation in kmsro relies on buffer sharing using
WINSYS_HANDLE_TYPE_FD, which in x11 is only used by default when dri3
is enabled.
Since the current implementation will not work without it, we can
prevent user error by checking that it is not disabled at configuration
time.

Closes #4861

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11305>
2021-06-11 11:12:43 +00:00
Roman Stratiienko 5987f71cb1 nouveau: Don't require RTTI and use it only when enabled
The only case RTTI is used in nouveau is type assertion at:
File src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:

    assert(typeid(*i) == typeid(*this));

This assertion is used 'to be on the safe side' only and not mandatory.

In Android we do not have rtti for libLLVM therefore this assertion
has to be skipped.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11069>
2021-06-10 15:10:04 +00:00
John Bates df1a4e749f add execmem build option
The execmem option can be set to false to disable the dynamic
dispatch patching that requires mmap(PROT_WRITE | PROT_EXEC),
which is undesirable on some platforms.

Signed-off-by: John Bates <jbates@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10987>
2021-06-09 21:28:17 +00:00
Roman Stratiienko 016e932cda meson: egl: Do not build platform_drm for Android
'platform_android' wasn't designed to coexist with 'platform_drm' within
single build, therefore a lot of conflicts appears during compile-time.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10183>
2021-06-07 16:04:15 +00:00
Duncan Hopkins a2d6a5f885 zink: Fix MacOS compiling issues
Add a moltenvk-dir build option to supply the MacOS Vulkan SDK MoltenVK location.
Force compiler, for zink only, into object-c mode when MoltenVK is used to allow for the MacOS ioSurface and CAMetalLayer types that the headers expose.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11129>
2021-06-04 08:58:16 +00:00
Eric Anholt 0d8e431871 android: Fix ELF TLS support.
Android 29 introduced general-dynamic TLS variable support ("quick
function call to look up the location of the dynamically allocated
storage"), while Mesa on normal Linux has used initial-exec ("use some of
the startup-time fixed slots, hope for the best!").  Both would be better
options than falling all the way back to pthread_getspecific(), which is
the alternative we have pre-29.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10389>
2021-06-02 03:10:49 +00:00
Jose Fonseca 54b8137141 d3d10umd,d3d10sw: Initial import.
This change adds a gallium D3D10 state tracker that works as a WDDM UMD
software driver, similar to Microsoft WARP, but using llvmpipe/softpipe.

The final deliverable is a d3d10sw.dll, which is similar to WARP's
d3d10warp.dll.

This has been used to run Microsoft Windows HCK wgf11* tests with
llvmpipe, and they were at one point passing 100%.

Known limitations:
- TGSI (no NIR)
- D3D10 only (no D3D11 support yet)
- no WINE integration (WINE doesn't implement WDDM DDI.)

For further details see:
- src/gallium/frontends/d3d10umd/README.md
- src/gallium/targets/d3d10sw/README.md

v2: Drop the DXBC-based disassembly.  Add missing break statements.
v3: Incorporate Jesse's feedback.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10687>
2021-05-19 13:50:07 +00:00
Ryan Houdek 855ffa7c46 Default enable SSE2 on mesa builds.
With the idea of branching classic device support in to its own tree now would be a good time to also raise the minimum
requirements to something that is more "modern" on x86.
SSE2 was introduced in 2000(!) by default let's make it the minimum spec now
All the old hardware that is moving to the maintenance branch will finally be out of the way.

For the 64-bit side of the discussion there isn't much changed.
* GCC already enables -msse and -msse2 by default
* Same with clang
* fpmath=sse might remove some extraneous x87 usage
** Clang implies fpmath=sse ALWAYS

For the 32-bit side of things is where the exciting details change
* GCC by default doesn't enable sse1 or sse2
** Does all `float`, `double`, and `long double` math with x87
** -msse2 enables sse2 and sse1, gcc still uses x87 even with those enabled
** -mfpmath=sse moves away from using x87 and instead uses sse1 and sse2
* Clang already default enables sse1/sse2 which then turns on their implied fpmath=sse

What does this mean for users?
On Linux raises the default minimum processor spec to SSE2 supporting CPUs
* Intel requirements raise from P5 (1993) to Netburst (2000)
* AMD requirements raise from Athlon(1999/2000) to Athlon 64 (2003)
* Via requirements raise from C3(2001) to C7 (2005)

What does it mean for package maintainers?
For x86-64 distributions that have i386/i686 multilib, then nothing changes. You're already on a platform guaranteed to support SSE2.
For i386/i686 distributions they will need to weigh their min spec against this. Not sure how many still support classic processors.

Who is left out in the cold?
* Intel Quark (2013)
** Embedded board, doesn't have a GPU, Technically has 1x PCIe 2.0 lane that someone could plug a GPU in to
* Some older transmeta CPUs, but they had a followup that also had SSE2.
** Anyone hacking on these with a modern GPU? I'm guessing they know how to turn this option off

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9868>
2021-05-13 06:06:42 +00:00
Rob Clark ecfb00fb09 util/perfetto: Add one-time init
Various places around mesa which might want to register a data-source,
etc, should call util_perfetto_init() first to ensure we connect to the
tracing service.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9901>
2021-05-10 15:34:07 +00:00
Antonio Caggiano 1cc72b2aef pps: Gfx-pps v0.3.0
Add the gfx-pps backbone in `src/pps`.

v2: Simplify supported drivers creation.
v3: No default getter is provided for counters.
v4: Open DRM device in read/write mode.
v5: Wait for datasource to be started.
v6: Set FIFO scheduler while sampling counters.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: John Bates <jbates@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9652>
2021-05-07 13:41:38 +00:00
Antonio Caggiano a0738525ed util: Perfetto SDK v15.0
Add Perfetto SDK v15.0 as a dependency using a meson wrap.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: John Bates <jbates@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9652>
2021-05-07 13:41:38 +00:00
Alyssa Rosenzweig 080b05e29e asahi: Add Gallium driver
Forked from noop, with some code from Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582>
2021-05-02 17:54:05 -04:00
Alyssa Rosenzweig 972409dacb asahi: Stub command-line compiler for AGX G13B
Based on the Bifrost standalone compiler, which was based on Midgard's
standalone compiler, which was based on Freedreno's standalone compiler,
which was.....

It's like sour dough!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582>
2021-05-02 17:41:09 -04:00
Simon Ser 5f101e8096 gallium, va: add support for VASurfaceAttribDRMFormatModifiers
This new surface attribute can be supplied by the client to indicate
a list of modifiers that the driver can choose from for buffer
allocation. This is useful to make sure the buffers allocated via libva
are compatible with the intended usage (e.g. can be scanned out via KMS
or can be imported to EGL).

Introduce a new Gallium pipe_context.create_video_buffer_with_modifiers
hook that drivers can implement if they are modifiers-aware. Add a
modifiers argument to vlVaHandleSurfaceAllocate so that the
user-supplied list of modifiers can be passed down from vaCreateSurfaces
to the Gallium driver.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10237>
2021-04-22 15:57:29 +00:00
James Park e189839002 meson: Disable MSVC warning 5105
Older versions of the Windows SDK are not compliant when the new
preprocessor is active, which is the default when C17 is enabled.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10202>
2021-04-22 10:29:02 +00:00
James Park e29f4a19a8 meson: Disable libdrm for RADV on Windows
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10202>
2021-04-22 10:29:02 +00:00
James Park e9254699a7 meson: Add wrap for libelf on Windows
Uses release from Lag Free Games GitHub, which applies Windows build
fixes to FreeBSD libelf.

The amd_common library uses libelf.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10202>
2021-04-22 10:29:02 +00:00
Dylan Baker 5b9253c287 meson: OpenMP is supposed to be optional
The code around it checks that it is found, so clearly it was meant to
be optional, not arequired.

Fixes: cd2832ee51
       ("meson: add an optional OpenMP dependency for AMD tests")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10286>
2021-04-19 23:23:59 +00:00
Marek Olšák b878444c3a amd: drop support for LLVM 10
It doesn't support RDNA 2.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10199>
2021-04-16 09:25:19 +00:00
Marek Olšák 2747332723 amd: drop support for LLVM 9
This would be easy to support except that it doesn't support RDNA 2.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10199>
2021-04-16 09:25:19 +00:00
Samuel Pitoiset 936b58378c amd: drop support for LLVM 8
It doesn't support Navi1x and the removal enables this nice code cleanup.

v2: rebase - mareko

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (v1)
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10199>
2021-04-16 09:25:19 +00:00
James Park 75d8998f7c meson: Fix winflexbison warnings
Undefine __STDC_VERSION__ for C files to avoid mismatch with C11/C17.

Define __STDC_VERSION__ for C++ files to use <inttypes.h> path.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10196>
2021-04-14 19:17:27 +00:00
Ella-0 a18ac347cf glsl: build without bison
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8739>
2021-04-13 19:12:48 +00:00
Marek Olšák cd2832ee51 meson: add an optional OpenMP dependency for AMD tests
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10003>
2021-04-13 03:17:42 +00:00
Jesse Natalie 99dde83a3e meson: For MSVC, suppress warnings generated by useless delayloads
LLVM's tools delayload some OS DLLs to improve process startup times,
but they put the delayload in the exported linker args that Meson picks
up and then applies to all libraries that link against LLVM. Since our
binaries don't link against the OS libs that are being delayloaded, that
generates a "useless delayload" warning.

Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10157>
2021-04-12 19:12:40 +00:00
Leo Liu 2c1e4c4baa meson: bump drm amdgpu version to 2.4.105
To include the INFO ioctl query for video caps

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10095>
2021-04-12 17:33:32 +00:00
Jesse Natalie 3aa8cbc784 meson: Refuse to build lavapipe without llvmpipe
This config doesn't work, and as of recently it no longer links.
Let's fail it early.

Fixes: 7b79db11c2 ("lavapipe: enable correct workgroup sizing")
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10107>
2021-04-09 14:52:30 +00:00
Chia-I Wu b0736f49d3 venus: add driver skeleton
It only has enough stubs to be loadable by the loader.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>
2021-04-08 17:15:37 +00:00
Philipp Zabel 2470bcb946 meson: Fix missing xcb-xrandr dependency for Vulkan X11 WSI
Fixes a build failure when building any Vulkan driver for the X11
platform with -Dxlib-lease=disabled. For example:

  /usr/bin/ld: src/vulkan/wsi/libvulkan_wsi.a(wsi_common_x11.c.o): in function `wsi_x11_detect_xwayland':
  src/vulkan/wsi/wsi_common_x11.c:123: undefined reference to `xcb_randr_query_version_unchecked'

Fixes: 1de2fd0cf2 "wsi/x11: Always link against xcb-xrandr"
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9972>
2021-04-08 10:08:40 +00:00
Jesse Natalie f3db2963ce wgl: Add unit test infrastructure for OpenGL32.dll on Windows
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9959>
2021-04-01 16:19:41 +00:00
Alyssa Rosenzweig 70813c1c13 meson: Remove kmsro from gallium-drivers
Automatically include it if we're building with a driver that depends on
it, and don't include it if we're not. Avoids a footgun (building
something like panfrost without kmsro) with minimal effect on code size
in the "kmsro possible but not used" case. (This case primarily affects
Freedreno, but the Freedreno maintainers suggested this, so I think it's
ok.)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8893>
2021-03-31 13:07:35 +00:00
Lionel Landwerlin 54fe5b0482 meson: switch vulkan layer to list of choices
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2832>
2021-03-25 19:10:03 +00:00
Eric Anholt 3cc390bf7d broadcom: Disbale CLIF dumping when libexpat isn't available.
Given what a niche developer tool CLIF dumps are, no sense requiring
libexpat just for that.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9764>
2021-03-24 17:25:07 +00:00
Jose Fonseca 6e6cd7d93c scons: Remove.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9720>
2021-03-20 10:38:55 +00:00
Jesse Natalie 012bc2fc77 meson, util: Make zlib optional again
This adds a HAVE_COMPRESSION macro, which is undefined if neither zlib
nor zstd are present, and is used to no-op compress.h/c. This also has
a side effect of fixing SCons, since it won't define this macro.

Fixes: d7ecbd5bf8 ("util: create some standalone compression helpers")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9689>
2021-03-19 19:33:59 +00:00
Michel Dänzer d8911a0ae8 Revert "meson: add enable-glcpp-tests option"
This reverts commit f9ae947e72.

Not needed anymore.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
2021-03-19 08:50:38 +00:00
Michel Zou 73a48600b4 meson: detect winflex/bison only on native win32
we want to detect the native bison when cross-compiling

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9375>
2021-03-11 10:38:36 +00:00
Jesse Natalie 3955dd077b meson/gallium: Add an option to not use LLVM for gallium draw module
We'd like to use one Mesa build environment which builds our CL compiler
stack (which needs Clang/LLVM) and which builds our GL driver. The GL
driver doesn't really need LLVM support, and since we're statically
linking LLVM, removing it from the driver drastically reduces our DLL
size on disk.

Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9259>
2021-02-25 17:48:16 +00:00
Michel Zou 5a2b930014 meson/xmlconfig: win32 regex fallback
xmlconfig now uses regex fonctions even without xml support

Fixes: c83400e6
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9261>
2021-02-25 14:03:27 +00:00
Jesse Natalie ba141b95a7 glapi: Support "ELF" TLS on Windows
To avoid a massive rename, I'm leaving this as a misnomer, it's not
really ELF TLS, but it's the same concept.

Note that Windows doesn't support thread-local variables imported
or exported between modules, so we can only support this when we're
not using a shared glapi.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4050
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9165>
2021-02-23 17:06:48 +00:00
Dave Airlie 054dd668a6 meson/llvm: add native for gallium swrast
If we are building llvmpipe and lavapipe we want native in this
list.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9208>
2021-02-23 17:17:28 +10:00
Kristian Høgsberg 0d5fe24c9b macros: Add thread-safety annotation macros
Extracted from !7529

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9061>
2021-02-18 00:27:49 +00:00
Mike Blumenkrantz f9ae947e72 meson: add enable-glcpp-tests option
these are too intermittent to be left enabled on CI for now

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8738>
2021-01-28 15:52:32 +00:00
Jeremy Huddleston Sequoia 766538f83c darwin: Use the system libunwind
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4094

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8507>
2021-01-15 20:00:20 +00:00
Jeremy Huddleston Sequoia 00944f80e2 darwin: Use the system libexpat
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4093

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8506>
2021-01-15 19:37:32 +00:00
X512 99616fe799 meson: fix Haiku EGL build; no dri requirement
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8323>
2021-01-09 20:51:17 -06:00
X512 97520d8d48 util/meson: Add libnetwork dependency for Haiku
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8323>
2021-01-09 20:51:08 -06:00
nia 275079e3ad util: Avoid pthread_setaffinity_np on NetBSD
NetBSD's variant has a different prototype from the Linux version
the code expects. It might make sense to add support for NetBSD's
version, however, since NetBSD defaults to not allowing non-root
users to set processor affinity, there would be little gain here.

This is a build fix for NetBSD.

Signed-off-by: Nia Alarie <nia@NetBSD.org>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
CC: 20.3 <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7947>
2021-01-09 06:22:13 +00:00
Alexander von Gluck IV cd2f3627a6 meson: Add _GNU_SOURCE for Haiku to activate non-posix functions
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2021-01-04 21:18:54 -06:00
Adam Jackson 435de835cd swrast: Remove the classic swrast DRI driver
Following up from the classic swrast OSMesa removal in favor of
llvmpipe/softpipe, remove the classic swrast DRI driver.  It's unused by
any distribution -- debian was the last holdout until this week, which had
it enabled instead of softpipe on obscure platforms (non-LLVM and hurd).
Now that debian has switched, remove the driver so nobody can accidentally
enable it again.

Fixes: #325, #324, #322, #321, #319, #318, #317, #315, #313, #311, #310,
       #306, #305, #304, #302, #301, #300, #299, #298, #297, #293, #289

Reviewed-by: Eric Anholt <eric@anholt.net> (commit message rewritten)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8069>
2020-12-31 00:15:29 +00:00
Michael Tang 67e48bee1e microsoft/compiler: Add dedicated spirv_to_dxil libraries
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8043>
2020-12-22 13:28:21 -08:00
Jesse Natalie bc5f69faee d3d12: Use DirectX-Headers wrap for d3d12.h
This does 2 things for us:
1. Allows us to compile-time depend on any features from new headers,
   instead of having to conditionally compile based on Windows SDK version.
2. Allows us to reference d3d12.h when compiling for non-Windows.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Eric Anholt ee80237218 mesa: Retire classic OSMesa.
The classic OSMesa renders directly into user memory using
src/mesa/swrast, while gallium OSMesa renders using softpipe or llvmpipe
and copies out at glFlush() time.  This would make gallium look like a
worse choice for OSMesa, except that swrast is:

1) Painfully slow to render compared to llvmpipe
2) Incorrect at derivatives
3) Limited to GL 2.1 instead of GL 4.6

In my survey of OSMesa users, debian was the remaining holdout with
classic OSMesa in use on hurd and some rare non-LLVM-supported
architectures (sh4, alpha, etc.).  As of today, they've switched to
softpipe-based gallium OSMesa for them.

To prevent people from running the wrong OSMesa (to the extent that
running OSMesa can ever be the right thing), delete the classic
version.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>

Closes: #320
Closes: #877
Closes: #2297
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1243>
2020-12-10 18:38:13 +00:00
Rob Clark 6fe84c5dda util: Allow STATIC_ASSERT() everywhere
Remove -Werror=vla from c_msvc_compat_args so we can use STATIC_ASSERT()
in core code.  We have a CI job for this.

(And arguably we could probably just drop c_msvc_compat_args entirely.)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7941>
2020-12-10 16:48:36 +00:00
Rob Clark 5a082911cd util: Promote __builtin_types_compatible_p compat
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7941>
2020-12-10 16:48:36 +00:00
Simon Ser ef75ede4ed egl/wayland: remove libwayland < 1.18 workaround
Require libwayland 1.18 and remove the workaround for
WL_SHM_FORMAT_{A,X}BGR16161616F.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7771>
2020-12-10 09:55:22 +00:00
Vinson Lee d4ae1950de meson: Fix build with llvm-12.
This patch fixes this Meson build error.

$ meson builddir \
-Dshared-llvm=disabled
-Ddri-drivers=''
-Dbuild-tests=true \
-Dgallium-drivers=swrast \
-Dvulkan-drivers=''
[...]
/usr/bin/ld: src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_misc.cpp.o): in function `llvm::InitializeNativeTarget()':
llvm/Support/TargetSelect.h:118: undefined reference to `LLVMInitializeX86TargetInfo'
/usr/bin/ld: llvm/Support/TargetSelect.h:119: undefined reference to `LLVMInitializeX86Target'
/usr/bin/ld: llvm/Support/TargetSelect.h:120: undefined reference to `LLVMInitializeX86TargetMC'
/usr/bin/ld: src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_misc.cpp.o): in function `llvm::InitializeNativeTargetAsmPrinter()':
llvm/Support/TargetSelect.h:132: undefined reference to `LLVMInitializeX86AsmPrinter'
/usr/bin/ld: src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_misc.cpp.o): in function `llvm::InitializeNativeTargetDisassembler()':
llvm/Support/TargetSelect.h:156: undefined reference to `LLVMInitializeX86Disassembler'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7777>
2020-12-08 19:53:57 -08:00
Vinson Lee bb46a010bb meson: Fix Clang microsoft-enum-value detection.
Fixes: 3aee462781 ("meson: add windows compiler checks and libraries")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7543>
2020-12-05 06:02:38 +00:00
Adam Jackson df0157dc69 meson: Make the glvnd vendor name configurable
Leave the default as "mesa", but this enables parallel Mesa installs.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7674>
2020-12-03 22:36:27 +00:00
Zack Rusin c76edc646b meson.build: Order the flex/bison by odds of them working
Some flex/bison installs on windows include yacc and lex
as bash scripts that call bison/flex binaries. That creates
an extra layer of dependencies because those won't work from
plain cmd.exe/powershell. Lets switch the lookup order so that
by default we pickup vanilla binaries instead of scripts.

Reviewd-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7806>
2020-12-03 12:39:02 +00:00
Neha Bhende 4c285e7080 meson.build: Disable zlib as per -Dzlib option
Disable use of zlib as per -Dzlib option.
Default value is true. To disable zlib usage, specify -Dzlib=false

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7806>
2020-12-03 12:39:02 +00:00
Neha Bhende 12fa2d2ac2 meson.build: Use SSE math for MinGW X86 build as per sse2 option
This patch adds missing compiler flags to build 32bit driver. It helps to build 32bit
using mingw successfully

Generated GL driver is tested using piglit, glretrace, conform and
some opengl apps

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7806>
2020-12-03 12:39:02 +00:00
Eric Anholt 311470fa64 meson: Remove old todo comment about pthread stubs.
Noticed while making my last change.  pthread stubs are long dead, we
actually use threads all over now.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>
2020-12-02 20:43:33 +00:00
Eric Anholt 661b292834 egl: Skip closing drivers when building with AddressSanitizer.
If you dlclose your driver, the leak reports look like:

    #0 0xffff9c7e5e7c in malloc (/lib/aarch64-linux-gnu/libasan.so.6+0x9ee7c)
    #1 0xffff94aaaa48  (<unknown module>)
    #2 0xffff94aa5ff4  (<unknown module>)
    #3 0xffff94d1867c  (<unknown module>)
    #4 0xffff94d184f0  (<unknown module>)
    #5 0xffff94c9a990  (<unknown module>)
    #6 0xffff94c92e30  (<unknown module>)
    #7 0xffff94c91d48  (<unknown module>)
    #8 0xffff946eb800  (/home/anholt/src/mesa/build-aarch64-asan/src/egl/libEGL.so.1.0.0+0xfe800)
    #9 0xffff94c72874  (<unknown module>)
    #10 0xffff946ede68  (/home/anholt/src/mesa/build-aarch64-asan/src/egl/libEGL.so.1.0.0+0x100e68)
    #11 0xffff94bf7134  (<unknown module>)
    #12 0xffff9c686450 in dri2_create_screen ../src/egl/drivers/dri2/egl_dri2.c:1079

which is not terribly useful.  Probe if we're building with asan and just
skip closing the driver in the happy path (which seems to be the standard
practice for loadable modules with this tool).

Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>
2020-12-02 20:43:33 +00:00
Jesse Natalie 80817b6e34 meson: Adjust Clover's required LLVM modules
When coming from CMake, all-targets doesn't exist, and Clover's
mechanism for finding Clang apparently requires the OpenMP frontend
lib but doesn't automatically pull it in.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>
2020-12-02 10:12:28 -08:00
Jesse Natalie 425cfcafb2 clover: Add opencl-native build flag
This flag controls whether to include native codegen functionality
for the AMD backend

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>
2020-12-02 10:12:27 -08:00
Jesse Natalie 852d91edcd windows: Always set NOMINMAX to remove min/max macros
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>
2020-12-02 10:12:25 -08:00
Yevhenii Kharchenko 361d143f94 meson: Add build option to specify default shader disk cache max-size
Added an optional 'shader-cache-max-size' build option to meson,
which sets default value of max disk cache size for compiled
GLSL programs. Can be overriden by 'MESA_GLSL_CACHE_MAX_SIZE'
environment variable.
Syntax is the same as environment variable has: a number optionally
followed by K, M, G to specify a size in kilobytes, megabytes, or
gigabytes. By default, gigabytes will be assumed.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3572

Signed-off-by: Yevhenii Kharchenko <yevhenii.kharchenko@globallogic.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: John Bates <jbates@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7217>
2020-12-02 11:44:34 +00:00
Adam Jackson 94a9867b05 glx: Remove DRI1
The DRI1 drivers were removed in Mesa 8.0, released in February 2012.
Time to say goodnight.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7660>
2020-12-01 18:40:18 +00:00
Dylan Baker a5227465c1 meson: use a feature option for microsoft-clc
It's less code and makes the configuration easier to fine tune.

Fixes: ff05da7f8d
       ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7699>
2020-11-23 17:31:55 +00:00
Dylan Baker 7ca4a478ad meson: Don't add extra values to shader-cache
We're trying to move to using a feature here, adding more values breaks
that.

Fixes: 5de56937a3
       ("disk_cache: build option for disabled-by-default")

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7699>
2020-11-23 17:31:55 +00:00
Eric Engestrom f8dc22bf61 meson: drop deprecated EGL platform build options
These two options were deprecated and announced to be removed in 20.3,
so let's drop them now.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: 20.3 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5844>
2020-11-20 21:35:23 +00:00
Jesse Natalie ff05da7f8d microsoft: Add CLC frontend and kernel/compute support to DXIL converter
This adds a standalone library which can convert through the pipeline of
OpenCL C -> SPIR -> SPIR-V -> NIR -> DXIL. It can add in the libclc
implementations of various library functions in the NIR phase, and
also massages the NIR to shift it more towards graphics-style compute.

This is leveraged by the out-of-tree OpenCLOn12 runtime
(https://github.com/microsoft/OpenCLOn12).

This is the combination of a lot of commits from our development branch,
containing code by several authors.

Co-authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-authored-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
2020-11-18 04:05:37 +00:00
Tony Wasserka 526405dfec meson: Treat LLVM headers as a system dependency
This will suppress warnings from LLVM includes.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7632>
2020-11-17 20:40:23 +00:00
Erik Faye-Lund ee657df09a meson: verify that d3d12.h exists when building the d3d12 driver
Without this header-file, we can't build the driver. So let's verify
that it exists, and can be used by the C++ compiler.

This should make it a bit more clear what's wrong if someone attempts to
build this using MinGW or on Linux.

Fixes: 2ea15cd661 ("d3d12: introduce d3d12 gallium driver")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7575>
2020-11-13 08:40:52 +00:00
Yuxuan Shui 53660e4c4e Add EGL xcb platform
This enables GL applications to be written without any involvement of
Xlib.

EGL X11 platform is actually already xcb-only underneath, so this commit
just add the necessary interface changes so eglDisplay can be created
from a xcb_connection_t.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6474>
2020-11-12 16:39:47 +00:00
Erik Faye-Lund 2ea15cd661 d3d12: introduce d3d12 gallium driver
This driver will allow running OpenGL and OpenCL on top of Gallium
for any hardware supporting Microsoft's Direct3D 12 on Windows 10.

This is the combination of a lot of commits from our development branch,
containing code from several authors.

Co-authored-by: Bill Kristiansen <billkris@microsoft.com>
Co-authored-by: Gert Wollny <gert.wollny@collabora.com>
Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Co-authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
2020-11-10 15:37:07 +00:00
Eric Anholt c4f8d421df meson: Don't enable libunwind by in 'auto' mode on Android.
On Android we're expected to use their backtrace library.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7227>
2020-10-20 18:29:38 +00:00
Eric Anholt f2a27d72de meson: Don't try to build GLX by default on Android.
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7227>
2020-10-20 18:29:38 +00:00
Eric Anholt 81a0f1eca2 meson: Only require libexpat when a part of the build needs it.
Now that xmlconfig can be built without libexpat on Android, we can make
android builds not require the presence of libexpat for many drivers.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7223>
2020-10-20 18:16:26 +00:00
Michael Olbrich 442a769600 meson.build: xxf86vm is not needed for -Dglx-direct=false
It is only used in src/glx/glxcmds.c and when GLX_DIRECT_RENDERING is
defined.
So only depend on it if GLX direct rendering is actually enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1905>
2020-10-20 17:58:45 +00:00
Duncan Hopkins cf17d62516 meson: Add xcb-fixes to loader when using x11 and dri3. Fixes undefined symbol for xcb_xfixes_create_region in loader_dri3_helper.c
loader_dr3_helper.c uses xcb_xfixes_create_region() that requires dep_xcb_xfixes to link. This is dependent on with_platform_x11 and with_dri3.
But the source meson file does not set this up dependent on with_dri3.
The build was initialsed using platforms=x11 and gallium-drivers=zink,swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7164>
2020-10-19 17:24:25 +00:00
Eric Anholt f51ce21e4e meson: Drop adding -Wl,--gc-sections to project c/cpp arguments.
We already have the targets we care about doing this using
ld_args_gc_sections, and by adding it to project arguments we caused
warnings spam in the android clang build about the compile stage not using
the argument.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6700>
2020-10-14 16:54:59 +00:00
Alejandro Piñeiro e5034f0d0d v3dv: add v3d vulkan driver skeleton
Initial commit, mostly a import of the minimum from anv/radv to get a
skeleton to start to work with.

In includes:
 * meson files
 * Copy & adapt entrypoints ane extensions scripts from anv (that were
   later used on radv)

This is a firt approach, but is is likely that we can remove/simplify
some things.

v2: fix copyright character at broadcom/vulkan/meson.build (Eric)
v3: no spaces inside arrays (Dylan)
v4: add gnu_symbol_visibility (detected by CI on first Merge attemp)

Reviewed-by: Eric Anholt <eric@anholt.net>

squash! v3dv: add v3d vulkan driver skeleton

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:24 +00:00
John Bates 5de56937a3 disk_cache: build option for disabled-by-default
On some systems it is problematic to have the shader cache enabled
by default. This adds a build option to support the disk cache but
keep it disabled unless the environment variable
MESA_GLSL_CACHE_DISABLE=false.

For example, on Chrome OS, Chrome already has it's own shader
disk cache implementation so it disables the mesa feature. Tests
do not want the shader disk cache enabled because it can cause
inconsistent performance results and the default 1GB for the
disk cache could lead to problems that require more effort to
work around. The Mesa shader disk cache is useful for VMs though,
where it is easy to configure the feature with environment
variables. With the current version of Mesa, Chrome OS would need
to have a system-wide environment variable to disable the disk
cache everywhere except where needed. More elegant to just build
Mesa with the cache feature disabled by default.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6967>
2020-10-09 16:52:49 +00:00
Dylan Baker 5ffdb1092b meson: generalize libclc usage
So that it's not tied directly to clover.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7034>
2020-10-07 21:52:04 +00:00
Philipp Zabel 03bea54e02 meson: fix power8 option
Do not throw a deprecation warning if the power8 option is set to the
new 'disabled' value. Instead, warn if it is still set to the legacy
value 'false'.

Fixes: 138c003d22 ("meson: deprecated 'true' and 'false' in combo options for 'enabled' and 'disabled'")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6370>
2020-10-02 05:49:18 +00:00
Matt Turner 1aac47db69 Revert F16C series (MR 6774)
This reverts commit 4fb2eddfdf.
This reverts commit 7a1deb16f8.
This reverts commit 2b6a172343.
This reverts commit 5af81393e4.
This reverts commit 87900afe5b.

A couple of problems were discovered after this series was merged that
cause breakage in different configurations:

   (1) It seems that using -mf16c also enables AVX, leading to SIGILL on
   platforms that do not support AVX.
   (2) Since clang only warns about unknown flags, and as I understand
   it Meson's handling in cc.has_argument() is broken, the F16C code is
   wrongly enabled when clang is used, even for example on ARM, leading
   to a compilation error.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3583
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6969>
2020-10-01 21:08:12 +00:00
Marek Olšák 87900afe5b util: implement f16c - fast half<->float conversions
This also happens to fix bptc-float-modes on llvmpipe.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6774>
2020-09-30 16:28:24 +00:00
Serge Martin a3543adc26 clover: set LLVM min version to 8.0.1
It also bump from 8.0.0 to .1 for AMD gallium and VK

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6336>
2020-09-26 11:06:42 +02:00
zhu yong 7898993bcd meson: add support for loongson's mips/mips64 arch.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6836>
2020-09-25 17:04:04 +00:00
Kristian H. Kristensen e80758405c turnip: Add kgsl backend
Lacking a bit around fences and wsi integration, but there's enough
here to actually drive the GPU.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4479>
2020-09-21 22:51:05 +00:00
Eric Engestrom 0f4d09443e meson: drop leftover PTHREAD_SETAFFINITY_IN_NP_HEADER
55765f80 replaced this with a check for the header itself.

Fixes: 55765f80b9 ("util/u_thread: include pthread_np.h if found")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6548>
2020-09-04 09:07:16 +00:00
Jonathan Gray 55765f80b9 util/u_thread: include pthread_np.h if found
Required for pthread_set_name_np() on OpenBSD as there is no
pthread_setaffinity_np() to define PTHREAD_SETAFFINITY_IN_NP_HEADER.

Fixes: dcf9d91a80 ("util: Handle differences in pthread_setname_np")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>
2020-08-31 09:14:57 +00:00
Jonathan Gray 0398caa97f meson: conditionally include -ldl in gbm pkg-config file
Follow libGL and only include -ldl in gbm pkg-config file if libdl was
actually found.  Many systems have these functions in libc and don't
have libdl.

Fixes: 816bf7d164 ("meson: build gbm")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>
2020-08-31 09:14:57 +00:00
Jonathan Gray c97af23b13 meson: don't build with USE_ELF_TLS on OpenBSD
OpenBSD does not have TLS

Fixes: a47c525f32 ("meson: build glx")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>
2020-08-31 09:14:57 +00:00
Eric Engestrom 9ac1686422 meson: don't advertise TLS support if glx wasn't build with it
Fixes: a47c525f32 ("meson: build glx")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>
2020-08-31 09:14:57 +00:00
Jonathan Gray f9a7e6e854 meson: build with _ISOC11_SOURCE on OpenBSD
Mesa builds with -std=c99 but uses timespec_get() a c11 function.
Build with _ISOC11_SOURCE for c11 visibility when -std is specified.
On linux c11 visibility comes from defining _GNU_SOURCE.

Fixes: e3a8013de8 ("util/u_queue: add util_queue_fence_wait_timeout")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>
2020-08-31 09:14:57 +00:00
Vinson Lee 855afe0144 meson: Fix lmsensors warning message.
Fixes: 138c003d22 ("meson: deprecated 'true' and 'false' in combo options for 'enabled' and 'disabled'")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6397>
2020-08-24 17:37:26 -07:00
Jesse Natalie 258ef4d4a4 wgl: Switch to Win10 version defines to enable usage of Win10 WGL callbacks
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6228>
2020-08-21 09:44:01 +00:00
Pierre Moreau 6ed87594b1 meson: Raise minimum version for SPIR-V OpenCL deps (v4)
SPIRV-LLVM-Translator had API-breaking changes during version 0.2.1.
Since the new API was being used, a higher version has to be requested.

While at it and since SPIRV-LLVM-Translator added a new API to request a
specific SPIR-V version as well as allowed SPIR-V extensions, increase
the version number to the first including those new features.

v2: Require an LLVM version which is compatible with the
    SPIRV-LLVM-Translator that was found; that requirement was
    previously implicit and would be ensured when that library was
    built. Making it explicit will help in cases where multiple versions
    of LLVM might be installed.
v3: fix use of undefined _minimum_llvmspirvlib_version_array
v4 (Karol): fix creating the minimum requested version
            Simplifing the code

Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Serge Martin <edb@sigluy.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5038>
2020-08-20 19:48:12 +00:00
Eric Engestrom eae181e3eb egl/x11_dri3: enable & require xfixes 2.0
Cc: 20.2 <mesa-stable>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6132>
2020-08-19 12:47:57 +00:00
Gert Wollny 6d28270968 meson: Make some warnings handled as errors with MSVC
We should really pass the right number and parameter types to
functions.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6227>
2020-08-18 13:44:10 +00:00
Daniel Stone 45f2252879 meson: Add MSVC narrowing-int-to-char warnings
MSVC seems quite keen to warn us that we're narrowing an int into a
char, even if it fits entirely within range.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6227>
2020-08-18 13:44:10 +00:00
Eric Engestrom ab5a36b342 meson: fix trivial s/dir/dri/ typo
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6354>
2020-08-18 10:58:22 +00:00
Adam Jackson aeba69deaa drisw: Port the MIT-SHM check to XCB
The old version isn't thread-safe, and xlib makes it unreasonably
difficult to write thread-safely.

Fixes: mesa/mesa#3398
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6294>
2020-08-17 16:17:50 +00:00
Pierre-Eric Pelloux-Prayer b7c04b1790 ac/llvm: handle static/shared llvm init separately
Having a single init function works as expected for shared llvm, but
when using a static llvm only one llvm will get initialized.

This commit introduces 2 separate init function:
- shared llvm = single public init function
- static llvm = one init function for each module using llvm

Fixes: 50d20dc055 ("ac/llvm: export ac_init_llvm_once in targets")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3376
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6253>
2020-08-17 10:47:41 +00:00
Dave Airlie b38879f8c5 vallium: initial import of the vulkan frontend
This is the initial import of the vallium frontend for gallium.
This is only good enough to run the triangle and the gears demo
(wrongly) from Sascha demos.

Improvements are mostly on the llvmpipe side after this.

It contains an implementation of the Vulkan API which is mapped
onto the gallium API, and is suitable only for SOFTWARE drivers.

Command buffers are recordred into malloced memory, then later
they are played back against the gallium API. The command buffers
are mostly just Vulkan API marshalling but in some places the information is
processed before being put into the command buffer (renderpass stuff).

Execution happens on a separate "graphics" thread, againt the gallium API.

There is only a single queue which wraps a single gallium context.

Resources are allocated via the new resource/memory APIs.
Shaders are created via the context and bound/unbound in the
second thread.

(No HW for reasons - memory management, sw paths for lots of paths,
pointless CPU side queue)

v2: drop mesa_icd, drop cpp_args, drop extra flags, change meson config (Eric)
v2.1: use meson-gallium job

meson pieces:
Reviewed-by: Eric Engestrom <eric@engestrom.ch>

overall:

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6082>
2020-08-17 14:31:47 +10:00
Eric Engestrom dd003abd2f meson: bump required glvnd version
https://github.com/KhronosGroup/EGL-Registry/pull/95 has moved
a couple of extensions defines and functions to the upstream `eglext.h`,
but when 9a74746bd1 sync'ed these files we broke compilation
of apps that require these symbols on systems that don't have the
updated Khronos headers.

On non-GLVND builds, we still provide these headers, so everything's
fine, but on GLVND builds the Khronos headers are external so we need to
make sure we have a libglvnd version that's recent enough.

Fixes: 9a74746bd1 ("EGL: sync headers with Khronos")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6069>
2020-08-08 17:15:25 +02:00
Kristian H. Kristensen 5096ebf954 meson: Define ANDROID and ANDROID_API_LEVEL when compiling for Android
Set ANDROID_API_LEVEL based on the value we already have and define
ANDROID to make sure we build code paths that are guarded by that.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>
2020-08-05 18:08:07 +00:00
Kristian H. Kristensen 932f51d593 ci: Include enough Android headers to let us compile test EGL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>
2020-08-05 18:08:07 +00:00
Kristian H. Kristensen 848e7b947d util: Move stack debug functions to src/util
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>
2020-08-05 18:08:06 +00:00
Eric Engestrom a4181fcd42 meson: fix `-D xlib-lease=auto` detection
This is used by Vulkan, not EGL, and depends on having DRM/KMS, not GBM.

Reported-by: Oschowa <oschowa@web.de>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3346
Fixes: e00adef34a ("egl: automatically compile the `drm` platform when available")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6150>
2020-08-02 16:23:47 +00:00
Rhys Perry d488d0fd7b aco: add framework for testing isel and integration tests
And add some simple tests to demonstrate/test the pipeline builder and
glsl_scraper.py.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3521>
2020-07-30 16:13:08 +00:00
Rhys Perry e6366f9094 aco: add framework for unit testing
And add some "tests" to test and document currently unused features of the
framework.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3521>
2020-07-30 16:13:08 +00:00
Eric Anholt 33f33bb7d6 meson: Enable GCing of functions and data from compilation units by default.
Normally, the linker will pull in any compilation unit (aka .c file) from
a static lib (such as our shared util code) that is depended on by the
code linking against it.  Since that code is already compiled, the .text
section is allowed to jump anywhere in .text, and the compiler can't
garbage collect unused functions inside of a compile unit.

Teasing callgraphs apart so that normal compilation-unit-level GCing can
reduce driver size hurts the logical organization of the code and is
difficult.  As an example, once I'd split the format pack/unpack tables, I
had to split out util_format_read/write() from util_format.c to avoid
pulling in pack/unpack.  But even then it didn't help, because it turns
out turnip's pack calls pull in util_format_bptc.c for bptc packing, but
that file also includes the unpack impls, and those internally call
util_format_unpack, and thus we pulled in all of unpack.  Splitting all of
this to separate files makes code harder to find and maintain, and is a
waste of dev time.

By setting these compiler flags, the compiler puts each function and data
symbol in a separate ELF section and the linker can then safely GC unused
text and data sections from a compile unit that gets pulled in.  There's a
bit of a space cost due to having those separate sections, but it ends up
being a huge win in disk space on my personal release driver builds:

- i965_dri.so -213k
- x86 gallium dri.so -430k
- libvulkan_intel.so -272k
- aarch64 gallium dri.so -330k
- libvulkan_freedreno.so -783k

No difference on iris drawoverhead -compat -test 1 on my skylake (n=60)

Effect on debugoptimized build times (n=5)
touch nir_lower_io.c build time (bfd)        +15.999% +/- 3.80377%
touch freedreno fd6_gmem.c build time (bfd)  +13.5294% +/- 4.86363%
touch nir_lower_io.c build time (lld)        no change
touch freedreno fd6_gmem.c build time (lld)  +2.45375% +/- 2.2383%

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5739>
2020-07-17 23:56:17 +00:00
Karol Herbst 08ceba943d nouveau: enable HMM
v2: move declarations into libdrm
v3: fix typos
    rework handling of how much memory to reserve
v4: remove unused parameter
    unmap cutout on error and when the screen is destroyed
v5: move into screen_create
    enable HMM only if CL gets enabled

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5906>
2020-07-14 19:59:12 +00:00
Michel Dänzer 89caa485f1 Revert https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4580
It broke the CI pipeline on master:

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/3604314
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/3604315

Revert for now, to allow other MRs to be merged.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5905>
2020-07-14 17:08:10 +02:00
Karol Herbst f67cd0bbd9 nouveau: enable HMM
v2: move declarations into libdrm
v3: fix typos
    rework handling of how much memory to reserve
v4: remove unused parameter
    unmap cutout on error and when the screen is destroyed
v5: move into screen_create
    enable HMM only if CL gets enabled

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4580>
2020-07-14 14:04:59 +00:00
Eric Engestrom e00adef34a egl: automatically compile the `drm` platform when available
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3161>
2020-07-10 13:48:24 +00:00
Eric Engestrom 60ad006b27 meson: move xlib-lease block further down
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3161>
2020-07-10 13:48:24 +00:00
Eric Engestrom a38e21d668 egl: always compile surfaceless
It has no dependencies and costs virtually nothing to build. There is
no downside to enabling it unconditionally, so let's do just that.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3161>
2020-07-10 13:48:23 +00:00
Timothy Arceri e2209e869a meson: turn on Wimplicit-fallthrough project wide
This will help avoid coding errors and allows for less warnings
from some static analysis tools.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
2020-07-02 23:52:53 +00:00
Emmanuel 708db983dd meson: Do not enable USE_ELF_TLS for FreeBSD
Compiling with this option result in too much TLS usage and FreeBSD
cannot handle that.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Emmanuel <manu@FreeBSD.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3559>
2020-07-01 16:47:05 +00:00
Frédéric Bonnard 5a27efdf0e meson: Revert commit overriding C++ standard with gnu++11 on ppc64el
Since a few versions, mesa now needs c++14 and compiling with gnu++11
on ppc64el fails.
Let's use the default standard and fix the collision of types between
c++ and altivec in a another patch.

Cc: mesa-stable
Signed-off-by: Frédéric Bonnard <frediz@debian.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4948>
2020-06-30 20:44:07 +00:00
Bas Nieuwenhuizen 3b74e6fa28 meson: Do not require shader cache for radv.
We fixed the compile error a while ago.

Fixes: cc10b34e9e "util/disk_cache: Fix disk_cache_get_function_timestamp with disabled cache."
Reviewed-by: Drew Davenport <ddavenport@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5649>
2020-06-28 01:10:45 +00:00
Jan Beich 63b81c9915 meson: unbreak sysctl.h detection on BSDs
Code:
 #include <sys/sysctl.h>
Compiler stdout:

Compiler stderr:
 In file included from testfile.c:1:
/usr/include/sys/sysctl.h:1184:40: error: unknown type name 'size_t'
int     sysctl(const int *, u_int, void *, size_t *, const void *, size_t);
                                           ^
/usr/include/sys/sysctl.h:1185:40: error: unknown type name 'size_t'
int     sysctlbyname(const char *, void *, size_t *, const void *, size_t);
                                           ^
/usr/include/sys/sysctl.h:1186:42: error: unknown type name 'size_t'
int     sysctlnametomib(const char *, int *, size_t *);
                                             ^
3 errors generated.

Checking if "sys/sysctl.h" compiles: NO

<https://gitlab.freedesktop.org/mesa/drm/-/commit/1f8ada802391>
<https://gitlab.freedesktop.org/mesa/drm/-/commit/4083e8f2c659>

Reviewed-by: Niclas Zeising <zeising@daemonic.se>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5462>
2020-06-16 23:24:54 +00:00
Eric Engestrom d32144602c meson: remove "empty array"/"array of an empty string" confusion
Until Meson 0.47, setting `-D arrayoption=` was not the same as setting
`-D arrayoption=[]`; the latter cleared the array, while the former
filled it with an empty string option.

Since Meson 0.47 [1], the former maps to the latter, so empty items can
only be set by explicitly giving an array containing an empty string,
ie. `-D arrayoption="['']"`; however note that this is *not* what we
want in any of the current Mesa code anyway.

This makes the code handling array options a bit more complicated, and
a lot more error-prone, so let's get rid of the confusion by removing
the empty-string option.

[1] f3a8f9c34d

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/386>
2020-06-02 19:36:12 +00:00
Dylan Baker 138c003d22 meson: deprecated 'true' and 'false' in combo options for 'enabled' and 'disabled'
To prepare to use meson's builtin feature options in the future, which
are more powerful and provide useful feature for packagers, like the
ability to turn all "automagic" features off, and then explicitly turn
on the ones they want.

This is designed to make the transition softer, since the 'true' and
'false' are still accepted, just with a warning.

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
2020-06-01 18:59:18 +00:00
Dylan Baker a8e2d79e02 meson: use gnu_symbol_visibility argument
This uses a meson builtin to handle -fvisibility=hidden. This is nice
because we don't need to track which languages are used, if C++ is
suddenly added meson just does the right thing.

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
2020-06-01 18:59:18 +00:00
Dylan Baker 17dcd535c1 meson: Use builtins for checking gnu __attributes__
This requires less code, and will fast skip on compilers that are known
to not have these, like MSVC.

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
2020-06-01 18:59:18 +00:00
Dylan Baker a16e8bfb94 meson: Use the check_header function
Instead of open coding it. This was new in 0.47

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
2020-06-01 18:59:18 +00:00
Dylan Baker c1a290bdd5 meson: Bump required version to 0.52.0
This matches what other graphics space projects require now, and allows
us to simplify a number of cases, as well as make use of new features in
meson.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2737
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
2020-06-01 18:59:18 +00:00
Eric Engestrom 444138d6d9 tree-wide: fix deprecated GitLab URLs
They will stop working in the next GitLab release, so let's update them
ASAP to make sure things are propagated to everyone by then.

See:
https://about.gitlab.com/releases/2020/05/06/gitlab-com-13-0-breaking-changes/#removal-of-deprecated-project-paths

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5111>
2020-05-23 15:33:50 +00:00
Danylo Piliaiev 5500a2b7fc meson: Disable GCC's dead store elimination for memory zeroing custom new
Some classes use custom new operator which zeroes memory, however gcc does
aggressive dead-store elimination which threats all writes to the memory
before the constructor as "dead stores".

For now we disable this optimization.

The new operators in question are declared via:
 DECLARE_RZALLOC_CXX_OPERATORS
 DECLARE_LINEAR_ZALLOC_CXX_OPERATORS

The issue was found with lto builds, however there is no guarantee that
it didn't happen with ordinary ones.

CC: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2977
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1358
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5104>
2020-05-21 08:54:30 +00:00
Emmanuel Gil Peyrot 4c212a1168 util/rand_xor: use getrandom() when available
This function has been added in glibc 2.25, and the related syscall in
Linux 3.17, in order to avoid requiring the /dev/urandom to exist, and
doing the open()/read()/close() dance on it.

We pass GRND_NONBLOCK so that it doesn’t block if not enough entropy has
been gathered to initialise the /dev/urandom source, and fallback to the
next source in any error case.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2026>
2020-05-15 13:37:20 +02:00
Quentin Glidic 00f5ea9fdc meson: Use dependency.partial_dependency()
It avoids calling pkg-config which was searched for in a wrong way, thus
breaking setup where unprefixed pkg-config was banned (e.g. on Exherbo).

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Fixes: 53f9131205
       ("meson: fix getting cflags from pkg-config")

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4701>
2020-04-24 06:58:32 +00:00