path: root/
AgeCommit message (Collapse)AuthorFilesLines
3 daysturnip: Add kgsl backendKristian H. Kristensen1-0/+1
Lacking a bit around fences and wsi integration, but there's enough here to actually drive the GPU. Part-of: <>
2020-09-04meson: drop leftover PTHREAD_SETAFFINITY_IN_NP_HEADEREric Engestrom1-6/+0
55765f80 replaced this with a check for the header itself. Fixes: 55765f80b9ce7cce4ec6 ("util/u_thread: include pthread_np.h if found") Signed-off-by: Eric Engestrom <> Reviewed-by: Jonathan Gray <> Part-of: <>
2020-08-31util/u_thread: include pthread_np.h if foundJonathan Gray1-1/+1
Required for pthread_set_name_np() on OpenBSD as there is no pthread_setaffinity_np() to define PTHREAD_SETAFFINITY_IN_NP_HEADER. Fixes: dcf9d91a80e ("util: Handle differences in pthread_setname_np") Signed-off-by: Jonathan Gray <> Reviewed-by: Eric Engestrom <> Part-of: <>
2020-08-31meson: conditionally include -ldl in gbm pkg-config fileJonathan Gray1-0/+6
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: 816bf7d1644 ("meson: build gbm") Signed-off-by: Jonathan Gray <> Reviewed-by: Eric Engestrom <> Part-of: <>
2020-08-31meson: don't build with USE_ELF_TLS on OpenBSDJonathan Gray1-1/+1
OpenBSD does not have TLS Fixes: a47c525f328 ("meson: build glx") Signed-off-by: Jonathan Gray <> Reviewed-by: Eric Engestrom <> Part-of: <>
2020-08-31meson: don't advertise TLS support if glx wasn't build with itEric Engestrom1-0/+2
Fixes: a47c525f328 ("meson: build glx") Signed-off-by: Eric Engestrom <> Part-of: <>
2020-08-31meson: build with _ISOC11_SOURCE on OpenBSDJonathan Gray1-0/+2
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: e3a8013de8c ("util/u_queue: add util_queue_fence_wait_timeout") Signed-off-by: Jonathan Gray <> Reviewed-by: Eric Engestrom <> Part-of: <>
2020-08-24meson: Fix lmsensors warning message.Vinson Lee1-2/+2
Fixes: 138c003d2273 ("meson: deprecated 'true' and 'false' in combo options for 'enabled' and 'disabled'") Signed-off-by: Vinson Lee <> Reviewed-by: Eric Engestrom <> Reviewed-by: Marek Olšák <> Part-of: <>
2020-08-21wgl: Switch to Win10 version defines to enable usage of Win10 WGL callbacksJesse Natalie1-1/+1
Reviewed-by: Erik Faye-Lund <> Reviewed-by: Jose Fonseca <> Part-of: <>
2020-08-20meson: Raise minimum version for SPIR-V OpenCL deps (v4)Pierre Moreau1-14/+26
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 <> Reviewed-by: Karol Herbst <> Reviewed-by: Serge Martin <> Reviewed-by: Francisco Jerez <> Part-of: <>
2020-08-19egl/x11_dri3: enable & require xfixes 2.0Eric Engestrom1-1/+1
Cc: 20.2 <mesa-stable> Signed-off-by: Eric Engestrom <> Acked-by: Michel Dänzer <> Part-of: <>
2020-08-18meson: Make some warnings handled as errors with MSVCGert Wollny1-0/+2
We should really pass the right number and parameter types to functions. Signed-off-by: Gert Wollny <> Reviewed-by: Erik Faye-Lund <> Part-of: <>
2020-08-18meson: Add MSVC narrowing-int-to-char warningsDaniel Stone1-0/+2
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 <> Reviewed-by: Erik Faye-Lund <> Part-of: <>
2020-08-18meson: fix trivial s/dir/dri/ typoEric Engestrom1-1/+1
Signed-off-by: Eric Engestrom <> Reviewed-by: Alyssa Rosenzweig <> Part-of: <>
2020-08-17drisw: Port the MIT-SHM check to XCBAdam Jackson1-0/+2
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 <> Reviewed-by: Michel Dänzer <> Part-of: <>
2020-08-17ac/llvm: handle static/shared llvm init separatelyPierre-Eric Pelloux-Prayer1-0/+1
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: 50d20dc055d ("ac/llvm: export ac_init_llvm_once in targets") Closes: Reviewed-by: Bas Nieuwenhuizen <> Reviewed-by: Marek Olšák <> Part-of: <>
2020-08-17vallium: initial import of the vulkan frontendDave Airlie1-2/+6
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 <> overall: Acked-by: Roland Scheidegger <> Part-of: <>
2020-08-08meson: bump required glvnd versionEric Engestrom1-1/+1 has moved a couple of extensions defines and functions to the upstream `eglext.h`, but when 9a74746bd1f3bd28d4c4 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: 9a74746bd1f3bd28d4c4 ("EGL: sync headers with Khronos") Signed-off-by: Eric Engestrom <> Acked-by: Daniel Stone <> Part-of: <>
2020-08-05meson: Define ANDROID and ANDROID_API_LEVEL when compiling for AndroidKristian H. Kristensen1-1/+5
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 <> Part-of: <>
2020-08-05ci: Include enough Android headers to let us compile test EGLKristian H. Kristensen1-8/+16
Part-of: <>
2020-08-05util: Move stack debug functions to src/utilKristian H. Kristensen1-3/+1
Reviewed-by: Eric Engestrom <> Part-of: <>
2020-08-02meson: fix `-D xlib-lease=auto` detectionEric Engestrom1-1/+1
This is used by Vulkan, not EGL, and depends on having DRM/KMS, not GBM. Reported-by: Oschowa <> Closes: Fixes: e00adef34a5ce485e2c9 ("egl: automatically compile the `drm` platform when available") Signed-off-by: Eric Engestrom <> Reviewed-by: Bas Nieuwenhuizen <> Part-of: <>
2020-07-30aco: add framework for testing isel and integration testsRhys Perry1-0/+4
And add some simple tests to demonstrate/test the pipeline builder and Signed-off-by: Rhys Perry <> Acked-by: Samuel Pitoiset <> Acked-by: Daniel Schürmann <> Acked-by: Timur Kristóf <> Part-of: <>
2020-07-30aco: add framework for unit testingRhys Perry1-0/+4
And add some "tests" to test and document currently unused features of the framework. Signed-off-by: Rhys Perry <> Acked-by: Samuel Pitoiset <> Acked-by: Daniel Schürmann <> Acked-by: Timur Kristóf <> Part-of: <>
2020-07-17meson: Enable GCing of functions and data from compilation units by default.Eric Anholt1-0/+13
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: - -213k - x86 gallium -430k - -272k - aarch64 gallium -330k - -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 <> Acked-by: Adam Jackson <> Part-of: <>
2020-07-14nouveau: enable HMMKarol Herbst1-1/+1
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 <> Part-of: <>
2020-07-14Revert Dänzer1-1/+1
It broke the CI pipeline on master: Revert for now, to allow other MRs to be merged. Part-of: <>
2020-07-14nouveau: enable HMMKarol Herbst1-1/+1
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 <> Part-of: <>
2020-07-10egl: automatically compile the `drm` platform when availableEric Engestrom1-7/+10
Signed-off-by: Eric Engestrom <> Reviewed-by: Emil Velikov <> Part-of: <>
2020-07-10meson: move xlib-lease block further downEric Engestrom1-14/+14
Signed-off-by: Eric Engestrom <> Reviewed-by: Emil Velikov <> Part-of: <>
2020-07-10egl: always compile surfacelessEric Engestrom1-19/+11
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 <> Reviewed-by: Emil Velikov <> Part-of: <>
2020-07-02meson: turn on Wimplicit-fallthrough project wideTimothy Arceri1-0/+1
This will help avoid coding errors and allows for less warnings from some static analysis tools. Reviewed-by: Marek Olšák <> Part-of: <>
2020-07-01meson: Do not enable USE_ELF_TLS for FreeBSDEmmanuel1-1/+1
Compiling with this option result in too much TLS usage and FreeBSD cannot handle that. Reviewed-by: Eric Engestrom <> Signed-off-by: Emmanuel <> Part-of: <>
2020-06-30meson: Revert commit overriding C++ standard with gnu++11 on ppc64elFrédéric Bonnard1-9/+0
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 <> Reviewed-by: Francisco Jerez <> Reviewed-by: Dylan Baker <> Part-of: <>
2020-06-28meson: Do not require shader cache for radv.Bas Nieuwenhuizen1-3/+0
We fixed the compile error a while ago. Fixes: cc10b34e9ed "util/disk_cache: Fix disk_cache_get_function_timestamp with disabled cache." Reviewed-by: Drew Davenport <> Reviewed-by: Kristian H. Kristensen <> Part-of: <>
2020-06-16meson: unbreak sysctl.h detection on BSDsJan Beich1-1/+8
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 <> <> Reviewed-by: Niclas Zeising <> Reviewed-by: Eric Engestrom <> Cc: mesa-stable Part-of: <>
2020-06-02meson: remove "empty array"/"array of an empty string" confusionEric Engestrom1-13/+7
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] Signed-off-by: Eric Engestrom <> Reviewed-by: Dylan Baker <> Part-of: <>
2020-06-01meson: deprecated 'true' and 'false' in combo options for 'enabled' and ↵Dylan Baker1-64/+197
'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 <> Reviewed-by: Eric Engestrom <> Part-of: <>
2020-06-01meson: use gnu_symbol_visibility argumentDylan Baker1-11/+0
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 <> Reviewed-by: Eric Engestrom <> Part-of: <>
2020-06-01meson: Use builtins for checking gnu __attributes__Dylan Baker1-31/+7
This requires less code, and will fast skip on compilers that are known to not have these, like MSVC. Acked-by: Matt Turner <> Reviewed-by: Eric Engestrom <> Part-of: <>
2020-06-01meson: Use the check_header functionDylan Baker1-1/+1
Instead of open coding it. This was new in 0.47 Acked-by: Matt Turner <> Reviewed-by: Eric Engestrom <> Part-of: <>
2020-06-01meson: Bump required version to 0.52.0Dylan Baker1-16/+6
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: Acked-by: Matt Turner <> Reviewed-by: Eric Engestrom <> Part-of: <>
2020-05-23tree-wide: fix deprecated GitLab URLsEric Engestrom1-2/+2
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: Cc: Signed-off-by: Eric Engestrom <> Acked-by: Alyssa Rosenzweig <> Part-of: <>
2020-05-21meson: Disable GCC's dead store elimination for memory zeroing custom newDanylo Piliaiev1-0/+5
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: <> Closes: Closes: Signed-off-by: Danylo Piliaiev <> Reviewed-by: Marek Olšák <> Part-of: <>
2020-05-15util/rand_xor: use getrandom() when availableEmmanuel Gil Peyrot1-1/+1
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 <> Reviewed-by: Eric Engestrom <> Part-of: <>
2020-04-24meson: Use dependency.partial_dependency()Quentin Glidic1-10/+3
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 <> Fixes: 53f9131205a63fa8b282ab2a7e96c48209447da0 ("meson: fix getting cflags from pkg-config") Reviewed-by: Dylan Baker <> Part-of: <>
2020-04-23meson: correct windows-version defineErik Faye-Lund1-1/+1
The macro "_WINVER" does nothing, the macro definitions that matter for windows API version selection are "_WIN32_WINNT" and "WINVER". The header "sdkddkver.h" (which is included from thousands of different windows-headers) defines "WINVER" to the same value as "_WIN32_WINNT" of only the latter is defined, which explains why this works right now. But we shouldn't depend on that kind of luck, and instead define the right maco. Fixes: 3aee462781a ("meson: add windows compiler checks and libraries") Acked-by: Dylan Baker <> Part-of: <>
2020-04-21meson: update llvm dependency logic for meson 0.54.0Dylan Baker1-6/+8
In meson 0.54.0 I fixed the llvm cmake dependency to return "not found" if shared linking is requested. This means that for 0.54.0 and later we don't need to do anything, and for earlier versions we only need to change the logic to force the config-tool method if shared linking is required. Fixes: 821cf6942a390f5f64d8a2cff9933b24c84f7dc1 ("meson: Use cmake to find LLVM when building for window") Acked-by: Marek Olšák <> Reviewed-by: Eric Engestrom <> Part-of: <>
2020-04-20meson: do not disable incremental linking for debug-buildsErik Faye-Lund1-1/+6
Meson specifies /EDITANDCONTINUE for MSVC projects when using the debug build-type. This collides with our across-the-board disabling of incremental linking. It's clear that we don't want to do incremental linking for release-builds; it increase the code-size, and adds some needless jumps to be able to patch in new code. But for debug-builds this seems like a good thing; we can now debug and on-the-fly recompile changes if we want to. This flag seems to have been simply forwarded from the SCons build system, where it makes a bit more sense; SCons doesn't really integrate with visual studio, so you can't properly debug with it. But Meson does, so let's keep some bells-and-whistles here. So let's avoid disabling incremental linking for debug-builds. For other builds we still want to do this, because Meson only disables it automatically for minsize-builds. This avoids a boat-loads of warnings on the form: warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification Acked-by: Jose Fonseca <> Acked-by: Dylan Baker <> Part-of: <>
2020-04-16meson: tell flex that we support c99Erik Faye-Lund1-1/+1
flexint.h uses stdint.h if the compiler claims to support C99. MSVC doesn't support enough of C99 to enable this flag, but it supports enough to keep flex happy. Without this, we end up with *both* some flex-specific definitions as well as our own definitions from mesa-headers, producing a slew of compiler warnings. Reviewed-by: Brian Paul <> Part-of: <>