Commit Graph

676 Commits

Author SHA1 Message Date
Jesse Natalie c002bbeb2f util: Add a Win32 futex impl
This uses APIs that are not available on Win7. Since this is a build-time
configuration, and since we can't use the SDK version as an indicator
(since you can support Win7 via new SDKs), a new option is added to allow
disabling it, to maintain Win7 support if desired.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17431>
2022-07-15 21:31:51 +00:00
Jesse Natalie ddbbe96c88 Fix static glapi on Windows
On Linux, the static glapi path sees libGL.so implementing the static
glapi, and the drivers (libgallium_dri.so) updating/reading the TLS
vars.

On Windows, to allow libgallium_wgl.dll to be a full ICD, it's
responsible for implementing the actual static glapi. However, before
this change, OpenGL32.dll was also implementing the static glapi,
meaning that GL API calls from OpenGL32.dll didn't route to the driver
correctly because the TLS vars were never actually set - the driver set
its copy, and OpenGL32.dll read its own copy.

Now, always build a bridge and static version of glapi when not using
shared. The bridge version is linked into OpenGL32.dll, and the static
version is linked into the driver on Windows. GLES only builds with
shared glapi - but after this, shared glapi is not really needed on
Windows for GLES, since the driver has all of the data.

Fixes: f36921ef ("wgl: Refactor drivers to a libgallium_wgl.dll")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6560
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16713>
2022-07-14 20:01:22 +00:00
Michel Zou edc7f40a83 meson: drop dladdr check on win32
since !17208 there are 2 paths for disk_cache_get_function_identifier
on mingw: DETECT_OS_WINDOWS or HAVE_DLADDR (if dlfcn shims is present)

../src/util/disk_cache_os.c:47:1: error: redefinition of 'disk_cache_get_function_identifier'
   47 | disk_cache_get_function_identifier(void *ptr, struct mesa_sha1 *ctx)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/util/disk_cache_os.c:36:
../src/util/disk_cache.h:121:1: note: previous definition of 'disk_cache_get_function_identifier' with type '_Bool(void *, struct _SHA1_CTX *)'
  121 | disk_cache_get_function_identifier(void *ptr, struct mesa_sha1 *ctx)

here we disable the dladdr path from meson for consistency with msvc

fixes: 2dcbe8727

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17261>
2022-06-28 14:02:14 +00:00
Danylo Piliaiev ee6a0c675b meson: Define _GNU_SOURCE for android host system
Otherwise sched_getaffinity isn't be defined and util_cpu_detect_once
fails to compile.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17173>
2022-06-22 11:52:36 +03:00
Yonggang Luo c17a0d956a meson/clover: Getting clover can be built with no-rtti llvm in mingw
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17055>
2022-06-16 20:38:35 +00:00
Yonggang Luo 86f87dbe21 meson/rtti: Using get_argument_syntax to check msvc compatible compiler
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17055>
2022-06-16 20:38:35 +00:00
Yonggang Luo 2d934ac110 meson: Use cc.get_argument_syntax instead cc.get_id when possible.
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17065>
2022-06-16 19:59:58 +00:00
Yonggang Luo b2ddec4e98 c11: Implement c11/time.h with c11/impl/time.c
Create c11/time.h instead of put timespec_get in `c11/threads.h`

Creating impl folder is used to avoid `#include <time.h>` point the c11/time.h file

Detecting if `struct timespec` present with meson
Define TIME_UTC in `c11/time.h` instead `c11/threads.h`
Define `struct timespec` in `c11/time.h` when not present.
Implement timespec_get in c11/impl/time.c instead threads.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15497>
2022-06-09 17:23:34 +00:00
Yonggang Luo a6dd77149a meson: Fixes timespec_get detect code
Add functions_to_detect dictionary to records the paths to include

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15497>
2022-06-09 17:23:33 +00:00
Jesse Natalie 3cd320c5fa meson: Use a C99 STDC_VERSION for flex
Fixes: 8575d0e8 ("meson: modernize win_flex stdint.h logic")
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16839>
2022-06-03 15:13:10 +00:00
Erik Faye-Lund c21dfe3348 meson: add back -Werror=vla to msvc compat flags
Back when STATIC_ASSERT was prepared for use in common code, the
-Werror=vla flag was removed from the MSVC compat flags. But now we're
using C++11 / C11 static asserts instead, so we can add it back again.

This should help us noticing some breakages before they happen.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>
2022-06-03 07:14:43 +00:00
Erik Faye-Lund 8575d0e84b meson: modernize win_flex stdint.h logic
Since this logic was written, we've moved to require C11, so this can
now be simplified. First of all, we no longer need to set
__STDC_VERSION__ for C code at all, because the issue that MSVC doesn't
set __STDC_VERSION__ for C99 is longer a concern. Second, we can make
the C++ check unconditional.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16812>
2022-06-02 13:09:15 +00:00
Sil Vilerino e5ddd8ad94 meson: Add build option for gallium-d3d12-video feature
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6511
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16597>
2022-05-24 16:36:31 +00:00
Sil Vilerino 4a9e068a6e meson: Update DirectX-Headers dependency to 1.602.0 version with fallback to the wrap
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16597>
2022-05-24 16:36:31 +00:00
Sil Vilerino 82e4fc654f meson: Support d3d12 as a video-supporting driver
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16286>
2022-05-17 21:02:25 +00:00
Erik Faye-Lund 693c723211 zink: use run-time linking to loader
This makes Zink no longer have the vulkan-loader in the import-table,
which can prevent opengl32.dll on Windows from loading on systems
without the loader installed.

Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11550>
2022-05-13 16:23:41 +00:00
Georg Lehmann bf6372df62 meson: Tell glslang to be quiet.
Without --quiet glslang unconditionally prints the input file name to stdout.
Check if --quiet is supported because some distros only have ancient glslang
versions.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16312>
2022-05-04 11:30:43 +00:00
Erik Faye-Lund 5a62d00480 util: fix test on msvc
We also miss this function on MSVC. But let's use the functionality in
meson to check for supported functions instead of hand-rolling the list
here.

Fixes: 067023dce2 ("util: Add some unit tests of the half-float conversions.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16290>
2022-05-03 19:33:20 +00:00
Erik Faye-Lund 202cab3d30 meson: deprecate specifying osmesa-bits
This option has no meaningful effect any more other than pointlessly
renaming the the library. Let's introduce a new default value called
"unspecified", and complain if it's set to anything else.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16213>
2022-04-29 19:30:03 +00:00
Erik Faye-Lund 36250e839b meson: remove unused defines
These defines are no longer used since we removed libmesa_classic.

Fixes: e030d5ba8a ("mesa: Delete libmesa_classic")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16213>
2022-04-29 19:30:03 +00:00
Dave Airlie 7d969fe9e9 meson: add a video codec support option
This allows to turn on/off all hw implementations for a specific video
codec across the tree. Patent encumbered codecs can cause problems for
distributions due to the nature of at least MPEG-LA licensing.

https://jina-liu.medium.com/settle-your-questions-about-h-264-license-cost-once-and-for-all-hopefully-a058c2149256
is probably the best explaination I can find.

From a distro pov, codecs are a jigsaw puzzle, you only seem to become a problem well you fit all the pieces.

This patch will allow disabling the mesa piece of the puzzle.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15258>
2022-04-28 22:27:27 +00:00
Eric Engestrom 1ecb440705 meson: replace deprecated dep.get_pkgconfig_variable(...) with dep.get_variable(pkgconfig : ...)
The former is deprecated since meson 0.56, while the latter is available since meson 0.51, and we currently require meson 0.53+.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16012>
2022-04-25 18:10:58 +00:00
Konstantin Seurer 5d9ef0efb5 radv: Add the fuchsia radix sort
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15648>
2022-04-24 16:03:32 +02:00
Alyssa Rosenzweig 46b099e392 meson: Ignore unused variables in release builds
Variables that are only used for assertions are considered unused in release
builds. Don't treat this as an error, since we build with -Werror even for
release in CI. This causes reasonable code to build and pass tests locally (and
therefore to be queued for merge by reasonable developers), but later fail in CI
due to a variable used only as an assertion. This pattern is common enough we
have an ASSERTED macro to workaround the behaviour, but failing a CI run to
have the author go back and add in the ASSERTED and re-queue later is a recipe
for frustration, wasted time, and wasted CI bandwidth.

Disable this behaviour to reduce CI friction.

In my view, sprinkling in ASSERTED clutters the code, rather than helps; I find
CI's insistence on doing so actively counterproductive. Developers are free to
continue doing so after this change. But this way CI won't fail merge requests
over it. After all, CI enforces policy, and we shouldn't have "mark variables
only used for assertions as ASSERTED" as policy. Let's pick our battles wisely
and improve CI's signal-to-noise ratio.

As an added benefit, this eliminates a class of defects where ASSERTED is used
incorrectly, e.g:

   c91e3c6a42 ("util: Should not use ASSERTED in util_thread_get_time_nano")
   3e22fc27af ("zink: remove incorrect ASSERTED macro")
   0d08ce287b ("pan/bi: Remove dated ASSERTED properties")

Note that actual unused variables will be caught by debug builds. It is expected
that developers do debug builds locally before ramming code through CI, so that
should be caught.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15582>
2022-04-23 13:36:05 -04:00
Erik Faye-Lund be952e71a7 meson: turn on -Wno-unused-function project-wide
We generate a lot of functions without knowing if they end up being used
or not. So we can't easily avoid these warnings.

This fixes a bunch of warnings for me when building with Clang.

Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15547>
2022-04-19 06:54:47 +00:00
Adam Jackson 25c42abac8 meson: Define a HAVE_XXXX macro for every gallium driver we build
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Chad Versace 3f8224baee intel/tools: Fix build without drivers
If Meson was configured with -Dtools=intel but all Intel drivers were
disabled, then Meson silently refused to build the tools.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15617>
2022-03-31 18:20:01 +00:00
Adam Jackson d43e6a9a49 dri: Remove the megadriver compat stub
This is for compatibility with loaders that don't know about
__DRI_DRIVER_GET_EXTENSIONS. xserver has supported that since 1.15.0,
which is almost nine years old now.

While we're about it, fix a comment in meson.build that used to be about
megadrivers to reflect reality.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>
2022-03-31 09:58:49 -04:00
Yonggang Luo 887d74dd2f meson: Add predefined macro -D__MSVCRT_VERSION__=0x0700 only in mingw environment without _UCRT
Fixed the following error:
```

1 error generated.
[18/1468] Compiling C object src/util/libmesa_util.a.p/half_float.c.obj
FAILED: src/util/libmesa_util.a.p/half_float.c.obj
"cc" "-Isrc/util/libmesa_util.a.p" "-Isrc/util" "-I../../src/util" "-Iinclude" "-I../../include" "-Isrc" "-I../../src" "-Isrc/mapi" "-I../../src/mapi" "-Isrc/mesa" "-I../../src/mesa" "-I../../src/gallium/include" "-Isrc/gallium/auxiliary" "-I../../src/gallium/auxiliary" "-IC:/CI-Tools/msys64/clang64/include" "-fvisibility=hidden" "-fcolor-diagnostics" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-std=c11" "-O2" "-g" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DPACKAGE_VERSION=\"22.1.0-devel\"" "-DPACKAGE_BUGREPORT=\"https://gitlab.freedesktop.org/mesa/mesa/-/issues\"" "-DHAVE_WINDOWS_PLATFORM" "-DHAVE_SURFACELESS_PLATFORM" "-DUSE_ELF_TLS" "-DUSE_TLS_BEHIND_FUNCTIONS" "-DENABLE_ST_OMX_BELLAGIO=0" "-DENABLE_ST_OMX_TIZONIA=0" "-DEGL_NO_X11" "-DHAVE___BUILTIN_BSWAP32" "-DHAVE___BUILTIN_BSWAP64" "-DHAVE___BUILTIN_CLZ" "-DHAVE___BUILTIN_CLZLL" "-DHAVE___BUILTIN_CTZ" "-DHAVE___BUILTIN_EXPECT" "-DHAVE___BUILTIN_FFS" "-DHAVE___BUILTIN_FFSLL" "-DHAVE___BUILTIN_POPCOUNT" "-DHAVE___BUILTIN_POPCOUNTLL" "-DHAVE___BUILTIN_UNREACHABLE" "-DHAVE___BUILTIN_TYPES_COMPATIBLE_P" "-DHAVE_FUNC_ATTRIBUTE_CONST" "-DHAVE_FUNC_ATTRIBUTE_FLATTEN" "-DHAVE_FUNC_ATTRIBUTE_MALLOC" "-DHAVE_FUNC_ATTRIBUTE_PURE" "-DHAVE_FUNC_ATTRIBUTE_UNUSED" "-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT" "-DHAVE_FUNC_ATTRIBUTE_WEAK" "-DHAVE_FUNC_ATTRIBUTE_FORMAT" "-DHAVE_FUNC_ATTRIBUTE_PACKED" "-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL" "-DHAVE_FUNC_ATTRIBUTE_ALIAS" "-DHAVE_FUNC_ATTRIBUTE_NORETURN" "-DHAVE_FUNC_ATTRIBUTE_VISIBILITY" "-DHAVE_UINT128" "-D_WINDOWS" "-D_WIN32_WINNT=0x0A00" "-DWINVER=0x0A00" "-DPIPE_SUBSYSTEM_WINDOWS_USER" "-D_USE_MATH_DEFINES" "-D__MSVCRT_VERSION__=0x0700" "-DUSE_SSE41" "-DUSE_GCC_ATOMIC_BUILTINS" "-DHAS_SCHED_H" "-DHAVE_CET_H" "-DHAVE_STRTOF" "-DHAVE_TIMESPEC_GET" "-DHAVE_STRTOK_R" "-DHAVE_QSORT_S" "-DHAVE_ZLIB" "-DHAVE_ZSTD" "-DHAVE_COMPRESSION" "-DLLVM_AVAILABLE" "-DMESA_LLVM_VERSION_STRING=\"13.0.1\"" "-DLLVM_IS_SHARED=1" "-DDRAW_LLVM_AVAILABLE" "-DMESA_EXECMEM" "-DVK_USE_PLATFORM_WIN32_KHR"
"-Werror=implicit-function-declaration" "-Werror=missing-prototypes" "-Werror=return-type" "-Werror=empty-body" "-Werror=incompatible-pointer-types" "-Werror=int-conversion" "-Wimplicit-fallthrough" "-Wno-missing-field-initializers" "-fno-math-errno" "-fno-trapping-math" "-Qunused-arguments" "-fno-common" "-Wno-microsoft-enum-value" "-Werror=format" "-Wformat-security" "-Werror=thread-safety" "-ffunction-sections" "-fdata-sections" "-pthread" "-Werror=pointer-arith" "-Werror=gnu-empty-initializer" -MD -MQ src/util/libmesa_util.a.p/half_float.c.obj -MF "src/util/libmesa_util.a.p/half_float.c.obj.d" -o src/util/libmesa_util.a.p/half_float.c.obj "-c" ../../src/util/half_float.c
In file included from ../../src/util/half_float.c:30:
In file included from ../../src/util/half_float.h:32:
In file included from ../../src/util/u_cpu_detect.h:41:
In file included from ../../src/util/u_thread.h:35:
In file included from ../../include/c11/threads.h:64:
../../include/c11/threads_win32.h:136:5: error: implicit declaration of function 'timespec_get' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    timespec_get(&now, TIME_UTC);
    ^
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14014>
2022-03-30 00:45:03 +08:00
Erik Faye-Lund a012b21964 microsoft: Initial vulkan-on-12 driver
This is Dozen, the Vulkan on DirectX 12 driver. Not to be confused with
DirectEggs.

This is an early prototype, and not meant to be upstreamed as-is.

Co-Authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-Authored-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Co-Authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Co-Authored-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>
2022-03-25 16:21:45 +00:00
Rob Clark 802f4da5ee freedreno/drm: Add virtio backend
Add a new backend to enable using native driver in a VM guest, via a new
virtgpu context type which (indirectly) makes host kernel interface
available in guest and handles the details of mapping buffers to guest,
etc.

Note that fence-fd's are currently a bit awkward, in that they get
signaled by the guest kernel driver (drm/virtio) once virglrenderer in
the host has processed the execbuf, not when host kernel has signaled
the submit fence.  For passing buffers to the host (virtio-wl) the egl
context in virglrenderer is used to create a fence on the host side.
But use of out-fence-fd's in guest could have slightly unexpected
results.  For this reason we limit all submitqueues to default priority
(so they cannot be preepmted by host egl context).  AFAICT virgl and
venus have a similar problem, which will eventually be solveable once we
have RESOURCE_CREATE_SYNC.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Matt Coster 97c4ce44e9 pvr: Gate offline compiler build behind -Dtools=imagination
This matches the behavior of e.g. panfrost's bifrost_compiler target.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15284>
2022-03-24 11:39:39 +00:00
Frank Binns 8991e64641 pvr: Add a Vulkan driver for Imagination Technologies PowerVR Rogue GPUs
Co-authored-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Co-authored-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Co-authored-by: Simon Perretta <simon.perretta@imgtec.com>
Co-authored-by: Alexander Wasey <Alexander.Wasey@imgtec.com>
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Signed-off-by: Alexander Wasey <Alexander.Wasey@imgtec.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15243>
2022-03-22 15:04:55 +00:00
Jason Ekstrand c15bf88f01 intel: Add a little OpenCL C compiler binary
v2: Fix up indentation (Marcin)
    s/gen/gfx/ (Marcin)
    Deal with fd closing in success/fail cases (Marin)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Lionel Landwerlin b1e7ce84cc meson: try to find clang-cpp before going through each module
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Juan A. Suarez Romero 54d0a2cfad util/disk_cache: rename MESA_GLSL_CACHE envvar
Rename MESA_GLSL_CACHE to MESA_SHADER_CACHE, as the on-disk cache can
store not only GLSL but also SPIR-V shaders.

v2:
 - Keep old envvar as deprecated (Mike)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15390>
2022-03-17 11:15:53 +01:00
Samuel Pitoiset 0e060e7a08 meson: bump libdrm_amdgpu version to 2.4.110
For the new AMDGPU CTX OP stable pstates.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
2022-02-21 11:16:11 +00:00
Dylan Baker 2f916f2be6 meson: add support for `meson devenv` with vulkan
Meson devenv is a feature added in meson 0.58 (thus the features is
version guarded) that allows creating a shell environment with
environment variables automatically setup for running the project inside
the build dir. Some variables (such as LD_LIBRARY_PATH and PATH) are set
automatically, others must be added by the project.

For vulkan is is relativley simple, we create a new, uninstalled, icd
file for each driver and set the VK_ICD_FILENAMES variable
appropriately. This can be used with:

```sh
meson devenv -C $builddir
```

then, vulkan applications will automatically use the uninstall vulkan
driver, no need to install.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14826>
2022-02-04 09:08:47 -08:00
Emma Anholt 8457667be9 ci: Use a dlclose-disabling preload library for leak checking in Vulkan.
For GL, we disable the dlclose() call on the driver in asan builds so that
leak reports get proper backtraces.  For Vulkan, the dlclose() happens
from libvulkan so you need a bigger hammer to keep our drivers loaded.

Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14235>
2022-01-27 23:47:46 +00:00
Simon McVittie 949b5787ee meson: Try to link all-targets module if Gallium OpenCL is enabled
If we don't do this, and we are statically linking LLVM
(-Dshared-llvm=disabled) while using a version of LLVM compiled for a
general-purpose distribution, then the link fails with undefined
references to the functions called by LLVMInitializeAllTargets().

Using a version of LLVM that was built specifically for Mesa will
sometimes mask this: if the only backends built into LLVM are backends
that we specifically link anyway, then the link will succeed.

According to commit 80817b6e "meson: Adjust Clover's required LLVM
modules", all-targets is not available when using CMake to locate LLVM,
so make it optional rather than mandatory.

This partially reverts commit 80817b6e34.

Resolves: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3962
Resolves: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5609
Signed-off-by: Simon McVittie <smcv@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13720>
2022-01-19 23:00:48 +00:00
Alex Xu (Hello71) 19f88eb858 meson: tlsdesc: minor reformatting, add comments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14027>
2022-01-19 19:45:22 +00:00
Thomas H.P. Andersen 9e839620da meson: add check kwarg to run_command
run_command will change the default for the check arg to true
in the future. If it is true then meson will exit if the command
fails. It must be false here as we check the return code to
provide a meaningful error message.

With meson 0.61 we get the following warning:

WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14602>
2022-01-19 04:55:55 +00:00
Bas Nieuwenhuizen 101a366e57 meson: Bump libdrm_amdgpu version req to 2.4.109.
For getting the fd from the device.

This uses the new function introduced with libdrm 2.4.109. This has
already been updated in CI and is already required for mesa common
bits so requiring it for libdrm_amdgpu is no big deal.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13974>
2021-12-31 15:14:18 +00:00
Hamish Arblaster cafca76fa2 zink: Fix building on macOS
This fixes building on macOS:
  Disable ZINK_USE_DMABUF on macOS, it is unsupported.
  Import vk_mvk_moltenvk.h for MVK_VERSION in zink_resource.c.
  Add additional build arguments (see meson.build) to build properly.

To build on macOS, you will probably need to run:
  brew install bison llvm cmake libxext xquartz ninja xorgproto meson

And you also need to setup meson with something like:
  -Dmoltenvk-dir=/Users/<Username>/VulkanSDK/<VersionNumber>/MoltenVK
  -Dc_std=c11

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14255>
2021-12-29 03:21:35 +00:00
Thomas H.P. Andersen 84b21fea46 meson: drop a temp formatting variable
This was only needed in meson < 0.50

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14240>
2021-12-18 10:34:44 +00:00
Thomas H.P. Andersen 1867a0cebf meson: drop a comment relating to old meson version
This comment was related to an if/else on meson version that has
already been removed in c1a290bdd5

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14240>
2021-12-18 10:34:44 +00:00
Thomas H.P. Andersen 88d0aeab6d meson: drop compatability with < 0.48
Before meson 0.48 the cpu_family() would return 'ppc64le' on little
endian power8. In newer versions it returns 'ppc64' and endianness
should be checked with endian()

We now require meson >= 0.53 so we can drop the compatability with
older versions.

The old behavior was added in e430a034b9

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14240>
2021-12-18 10:34:44 +00:00
Michel Zou 631b3fe3e9 meson: correctly detect linker arguments
Fixes: 22673a98 ("meson: Check arguments before adding")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13961>
2021-12-16 17:19:28 +00:00
Caio Oliveira 49c356a335 meson: Bump version required for gtest protocol
The feature was added in 0.55 but there was a bug when tests
crashed (and no XML file was generated) that was only fixed in 0.59.2.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14204>
2021-12-15 23:28:09 +00:00
Michel Zou 558bc2227e meson: check -mtls if has_exe_wrapper
Fixes: 60d95c5d (Auto-enable TLSDESC support)
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14086>
2021-12-07 22:24:52 +00:00