2017-09-14 17:57:17 -07:00
|
|
|
# Copyright © 2017 Intel Corporation
|
|
|
|
|
|
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
|
# SOFTWARE.
|
|
|
|
|
|
2022-11-10 12:34:47 +08:00
|
|
|
# inc_util only depends inc_include, this folder and nothing else under src
|
|
|
|
|
# so we use include_directories('..') instead of inc_src to tell the fact
|
|
|
|
|
# util is self contained.
|
|
|
|
|
inc_util = [inc_include, include_directories('..')]
|
2017-09-14 17:57:17 -07:00
|
|
|
|
android: Introduce the Android buffer info abstraction
Both EGL and Vulkan implementations require obtaining buffer metadata,
e.g., format, modifier, offsets, strides, etc.
Currently, mesa3d doesn't have a generic solution, and every Vulkan
implementation uses its getters. Most of the getters rely on
kernel metadata storage that is available for x86-based GPU drivers.
ARM-based Vulkan drivers rely on userspace metadata sharing, making it
important to use advanced metadata API. Otherwise, the driver will work
with limited functionality (no YUV, lack of support for modifiers, etc.)
Current EGL buffer getter implementation is advanced enough and used as
a base for a common Android buffer-getter logic.
Use example:
void
android_buffer_test(android_handle_type *a_handle)
{
// First, get the gralloc object. It will be created if it doesn't
// exist. Use U_GRALLOC_TYPE_AUTO to let the implementation choose
// the best gralloc
struct u_gralloc *gralloc = u_gralloc_create(U_GRALLOC_TYPE_AUTO);
// Prepare the internal handle structure (hal_format and
// pixel_stride are required for the fallback implementation).
// Both Vulkan and EGL clients expose HAL format / pixel stride
// in their structures.
u_gralloc_buffer_handle hnd = {
.handle = a_handle->native_handle,
.hal_format = a_handle->hal_format,
.pixel_stride = a_handle->pixel_stride,
};
// Get the basic buffer info
u_gralloc_buffer_basic_info basic_info;
int ret = u_gralloc_get_buffer_basic_info(gralloc, &hnd, &basic_info);
if (ret) {
// Handle the error
}
// Get the color info
u_gralloc_buffer_color_info color_info;
ret = u_gralloc_get_buffer_color_info(gralloc, &hnd, &color_info);
if (ret) {
// Handle the error
}
// unref the gralloc object
u_gralloc_destroy(&gralloc);
}
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18215>
2022-08-23 20:08:22 +03:00
|
|
|
if with_platform_android
|
|
|
|
|
subdir('u_gralloc')
|
|
|
|
|
endif
|
|
|
|
|
|
2023-03-30 16:21:57 +09:00
|
|
|
subdir('blake3')
|
2017-09-20 20:11:32 -07:00
|
|
|
|
2017-09-14 17:57:17 -07:00
|
|
|
files_mesa_util = files(
|
2018-01-18 23:29:14 +03:00
|
|
|
'anon_file.h',
|
|
|
|
|
'anon_file.c',
|
2017-12-29 13:30:32 -08:00
|
|
|
'bigmath.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'bitscan.c',
|
|
|
|
|
'bitscan.h',
|
|
|
|
|
'bitset.h',
|
2023-07-11 10:06:47 -04:00
|
|
|
'blend.h',
|
2019-09-18 14:32:00 -05:00
|
|
|
'blob.c',
|
|
|
|
|
'blob.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'build_id.c',
|
|
|
|
|
'build_id.h',
|
2020-10-31 16:18:34 -07:00
|
|
|
'cnd_monotonic.h',
|
2020-03-25 21:11:44 -04:00
|
|
|
'compiler.h',
|
2021-03-04 16:34:34 +11:00
|
|
|
'compress.c',
|
|
|
|
|
'compress.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'crc32.c',
|
|
|
|
|
'crc32.h',
|
2019-02-27 11:12:59 -08:00
|
|
|
'dag.c',
|
2017-09-14 17:57:17 -07:00
|
|
|
'disk_cache.c',
|
|
|
|
|
'disk_cache.h',
|
2020-07-30 14:50:02 +10:00
|
|
|
'disk_cache_os.c',
|
|
|
|
|
'disk_cache_os.h',
|
2018-09-06 16:01:34 +02:00
|
|
|
'double.c',
|
|
|
|
|
'double.h',
|
2020-08-31 18:29:10 +02:00
|
|
|
'enum_operators.h',
|
2018-09-23 12:57:51 -04:00
|
|
|
'fast_idiv_by_const.c',
|
|
|
|
|
'fast_idiv_by_const.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'format_r11g11b10f.h',
|
|
|
|
|
'format_rgb9e5.h',
|
|
|
|
|
'format_srgb.h',
|
2020-10-19 14:33:44 +11:00
|
|
|
'fossilize_db.c',
|
|
|
|
|
'fossilize_db.h',
|
2022-09-03 16:58:05 +08:00
|
|
|
'futex.c',
|
2017-10-22 17:38:26 +02:00
|
|
|
'futex.h',
|
2022-11-02 22:43:19 +08:00
|
|
|
'glheader.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'half_float.c',
|
|
|
|
|
'half_float.h',
|
|
|
|
|
'hash_table.c',
|
|
|
|
|
'hash_table.h',
|
2023-04-17 22:08:24 +09:00
|
|
|
'hex.h',
|
2020-09-08 20:41:14 +02:00
|
|
|
'u_idalloc.c',
|
|
|
|
|
'u_idalloc.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'list.h',
|
mesa: Promote Intel's simple logging façade for Android to util/
I'm bringing up freedreno Vulkan on an Android phone, and my pains are
exactly what Chad said when working on Intel's vulkan for Android in
aa716db0f64d ("intel: Add simple logging façade for Android (v2)"):
On Android, stdio goes to /dev/null. On Android, remote gdb is even
more painful than the usual remote gdb. On Android, nothing works like
you expect and debugging is hell. I need logging.
This patch introduces a small, simple logging API that can easily wrap
Android's API. On non-Android platforms, this logger does nothing
fancy. It follows the time-honored Unix tradition of spewing
everything to stderr with minimal fuss.
My goal here is not perfection. My goal is to make a minimal, clean API,
that people hate merely a little instead of a lot, and that's good
enough to let me bring up Android Vulkan. And it needs to be fast,
which means it must be small. No one wants to their game to miss frames
while aiming a flaming bow into the jaws of an angry robot t-rex, and
thus become t-rex breakfast, because some fool had too much fun desiging
a bloated, ideal logging API.
Compared to trusty fprintf, _mesa_log[ewi]() is actually usable on
Android. Compared to os_log_message(), this has different error levels
and supports format arguments.
The only code change in the move is wrapping flockfile/funlockfile in
!DETECT_OS_WINDOWS, since mingw32 doesn't have it. Windows likely wants
different logging code, anyway.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6806>
2020-09-21 12:53:14 -07:00
|
|
|
'log.c',
|
2017-09-14 17:57:17 -07:00
|
|
|
'macros.h',
|
2020-08-04 10:58:11 -07:00
|
|
|
'memstream.c',
|
|
|
|
|
'memstream.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'mesa-sha1.c',
|
|
|
|
|
'mesa-sha1.h',
|
2023-04-17 22:41:43 +09:00
|
|
|
'mesa-blake3.c',
|
|
|
|
|
'mesa-blake3.h',
|
2017-10-22 17:38:44 +02:00
|
|
|
'os_time.c',
|
|
|
|
|
'os_time.h',
|
2019-01-28 15:44:12 +00:00
|
|
|
'os_file.c',
|
2021-08-11 10:17:46 +02:00
|
|
|
'os_memory_fd.c',
|
2018-10-29 11:21:07 -07:00
|
|
|
'os_misc.c',
|
|
|
|
|
'os_misc.h',
|
2019-12-11 15:01:11 -08:00
|
|
|
'os_socket.c',
|
|
|
|
|
'os_socket.h',
|
2021-11-04 12:23:05 -04:00
|
|
|
'ptralloc.h',
|
2021-05-24 12:11:46 +03:00
|
|
|
'perf/u_trace.h',
|
|
|
|
|
'perf/u_trace.c',
|
|
|
|
|
'perf/u_trace_priv.h',
|
2018-07-10 15:00:13 -07:00
|
|
|
'u_process.c',
|
|
|
|
|
'u_process.h',
|
2020-11-10 11:00:54 -06:00
|
|
|
'u_qsort.cpp',
|
|
|
|
|
'u_qsort.h',
|
2022-09-03 18:04:49 +08:00
|
|
|
'rwlock.c',
|
2020-10-13 21:06:21 -07:00
|
|
|
'rwlock.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'sha1/sha1.c',
|
|
|
|
|
'sha1/sha1.h',
|
|
|
|
|
'ralloc.c',
|
|
|
|
|
'ralloc.h',
|
|
|
|
|
'rand_xor.c',
|
|
|
|
|
'rand_xor.h',
|
2018-04-05 08:21:49 -07:00
|
|
|
'rb_tree.c',
|
|
|
|
|
'rb_tree.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'register_allocate.c',
|
|
|
|
|
'register_allocate.h',
|
|
|
|
|
'rgtc.c',
|
|
|
|
|
'rgtc.h',
|
|
|
|
|
'rounding.h',
|
|
|
|
|
'set.c',
|
|
|
|
|
'set.h',
|
2022-08-17 01:42:52 +08:00
|
|
|
'simple_mtx.c',
|
2017-10-16 18:06:49 +11:00
|
|
|
'simple_mtx.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'slab.c',
|
|
|
|
|
'slab.h',
|
2019-02-12 09:51:31 +01:00
|
|
|
'softfloat.c',
|
|
|
|
|
'softfloat.h',
|
2019-10-05 14:07:50 -05:00
|
|
|
'sparse_array.c',
|
|
|
|
|
'sparse_array.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'string_buffer.c',
|
|
|
|
|
'string_buffer.h',
|
|
|
|
|
'strndup.h',
|
|
|
|
|
'strtod.c',
|
|
|
|
|
'strtod.h',
|
2019-07-29 12:54:04 +03:00
|
|
|
'timespec.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'u_atomic.c',
|
|
|
|
|
'u_atomic.h',
|
2022-06-18 23:55:49 +08:00
|
|
|
'u_call_once.c',
|
|
|
|
|
'u_call_once.h',
|
2022-06-30 19:25:19 -07:00
|
|
|
'u_dl.c',
|
|
|
|
|
'u_dl.h',
|
2023-04-05 11:55:51 +02:00
|
|
|
'u_dynarray.c',
|
2017-09-14 17:57:17 -07:00
|
|
|
'u_dynarray.h',
|
|
|
|
|
'u_endian.h',
|
2021-09-30 10:34:38 -04:00
|
|
|
'u_hash_table.c',
|
|
|
|
|
'u_hash_table.h',
|
2022-06-30 19:25:19 -07:00
|
|
|
'u_pointer.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'u_queue.c',
|
|
|
|
|
'u_queue.h',
|
|
|
|
|
'u_string.h',
|
2022-10-15 00:48:34 +08:00
|
|
|
'u_thread.c',
|
2017-09-14 17:57:17 -07:00
|
|
|
'u_thread.h',
|
|
|
|
|
'u_vector.c',
|
|
|
|
|
'u_vector.h',
|
2018-08-16 17:20:38 -07:00
|
|
|
'u_math.c',
|
|
|
|
|
'u_math.h',
|
2020-04-01 08:44:08 +10:00
|
|
|
'u_memset.h',
|
2019-11-28 21:49:02 +01:00
|
|
|
'u_mm.c',
|
|
|
|
|
'u_mm.h',
|
2023-06-04 17:22:09 +08:00
|
|
|
'u_pack_color.h',
|
2018-10-01 11:55:27 -07:00
|
|
|
'u_debug.c',
|
|
|
|
|
'u_debug.h',
|
2020-02-10 13:08:28 +01:00
|
|
|
'u_debug_memory.c',
|
2018-10-01 11:59:21 -07:00
|
|
|
'u_cpu_detect.c',
|
|
|
|
|
'u_cpu_detect.h',
|
2022-03-30 06:54:45 +08:00
|
|
|
'u_printf.c',
|
2020-11-18 16:20:50 +10:00
|
|
|
'u_printf.h',
|
2022-04-19 11:57:45 -04:00
|
|
|
'u_worklist.c',
|
|
|
|
|
'u_worklist.h',
|
2021-11-12 14:30:37 +10:00
|
|
|
'vl_vlc.h',
|
|
|
|
|
'vl_rbsp.h',
|
2018-01-06 17:28:01 -08:00
|
|
|
'vma.c',
|
|
|
|
|
'vma.h',
|
2020-01-18 00:47:19 -05:00
|
|
|
'xxhash.h',
|
2022-06-13 19:31:20 +03:00
|
|
|
'mesa_cache_db.c',
|
|
|
|
|
'mesa_cache_db.h',
|
2022-10-24 13:24:16 +03:00
|
|
|
'mesa_cache_db_multipart.c',
|
|
|
|
|
'mesa_cache_db_multipart.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
)
|
|
|
|
|
|
2019-02-26 12:32:04 +00:00
|
|
|
files_drirc = files('00-mesa-defaults.conf')
|
|
|
|
|
|
2022-11-30 10:12:38 +01:00
|
|
|
if with_amd_vk
|
|
|
|
|
files_drirc += files('00-radv-defaults.conf')
|
|
|
|
|
endif
|
|
|
|
|
|
2019-02-26 12:32:04 +00:00
|
|
|
if with_tests
|
|
|
|
|
prog_xmllint = find_program('xmllint', required : false, native : true)
|
|
|
|
|
if prog_xmllint.found()
|
|
|
|
|
test(
|
|
|
|
|
'drirc xml validation',
|
|
|
|
|
prog_xmllint,
|
|
|
|
|
args : ['--noout', '--valid', files_drirc],
|
|
|
|
|
suite : ['util'],
|
|
|
|
|
)
|
|
|
|
|
endif
|
|
|
|
|
endif
|
2017-09-14 17:57:17 -07:00
|
|
|
|
|
|
|
|
files_xmlconfig = files(
|
|
|
|
|
'xmlconfig.c',
|
|
|
|
|
'xmlconfig.h',
|
|
|
|
|
)
|
|
|
|
|
|
2021-02-21 11:28:37 -08:00
|
|
|
files_xmlconfig += custom_target(
|
|
|
|
|
'driconf_static.h',
|
2022-11-30 10:36:40 +01:00
|
|
|
input: ['driconf_static.py'] + files_drirc,
|
2021-02-21 11:28:37 -08:00
|
|
|
output: 'driconf_static.h',
|
|
|
|
|
command: [
|
2022-11-30 10:36:40 +01:00
|
|
|
prog_python, '@INPUT@', '@OUTPUT@',
|
2021-02-21 11:28:37 -08:00
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2017-09-14 17:57:17 -07:00
|
|
|
format_srgb = custom_target(
|
|
|
|
|
'format_srgb',
|
|
|
|
|
input : ['format_srgb.py'],
|
|
|
|
|
output : 'format_srgb.c',
|
2018-08-09 10:27:26 +02:00
|
|
|
command : [prog_python, '@INPUT0@'],
|
2017-09-14 17:57:17 -07:00
|
|
|
capture : true,
|
|
|
|
|
)
|
|
|
|
|
|
2019-09-03 11:43:40 -07:00
|
|
|
deps_for_libmesa_util = [
|
|
|
|
|
dep_zlib,
|
|
|
|
|
dep_clock,
|
|
|
|
|
dep_thread,
|
|
|
|
|
dep_atomic,
|
|
|
|
|
dep_m,
|
2019-09-18 14:32:00 -05:00
|
|
|
dep_valgrind,
|
2019-10-31 13:26:00 -07:00
|
|
|
dep_zstd,
|
2020-07-28 22:02:31 -07:00
|
|
|
dep_dl,
|
|
|
|
|
dep_unwind,
|
2022-07-08 11:16:44 -07:00
|
|
|
dep_futex,
|
2023-04-17 22:41:43 +09:00
|
|
|
idep_blake3,
|
2022-02-19 13:19:08 +08:00
|
|
|
idep_mesautilc11
|
2019-09-03 11:43:40 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if with_platform_android
|
|
|
|
|
deps_for_libmesa_util += dep_android
|
2020-07-28 22:02:31 -07:00
|
|
|
files_debug_stack = files('u_debug_stack_android.cpp')
|
2023-06-04 17:22:09 +08:00
|
|
|
else
|
2020-07-28 22:02:31 -07:00
|
|
|
files_debug_stack = files(
|
2023-06-04 17:22:09 +08:00
|
|
|
'dbghelp.h',
|
2020-07-28 22:02:31 -07:00
|
|
|
'u_debug_stack.c',
|
|
|
|
|
'u_debug_symbol.c',
|
|
|
|
|
'u_debug_symbol.h',
|
|
|
|
|
)
|
2019-09-03 11:43:40 -07:00
|
|
|
endif
|
|
|
|
|
|
2021-01-04 22:10:08 -06:00
|
|
|
if with_platform_haiku
|
|
|
|
|
deps_for_libmesa_util += dep_network
|
|
|
|
|
endif
|
|
|
|
|
|
2021-03-22 10:55:35 -07:00
|
|
|
if with_perfetto
|
|
|
|
|
files_mesa_util += files(
|
2022-08-25 14:26:58 -07:00
|
|
|
'perf/u_perfetto.cc',
|
|
|
|
|
'perf/u_perfetto.h',
|
2021-03-22 10:55:35 -07:00
|
|
|
)
|
|
|
|
|
deps_for_libmesa_util += dep_perfetto
|
|
|
|
|
endif
|
|
|
|
|
|
2021-05-24 12:11:46 +03:00
|
|
|
u_trace_py = files('perf/u_trace.py')
|
|
|
|
|
|
2022-06-02 10:02:57 -04:00
|
|
|
libmesa_util_sse41 = static_library(
|
2022-11-04 10:33:47 +08:00
|
|
|
'mesa_util_sse41',
|
|
|
|
|
files('streaming-load-memcpy.c'),
|
|
|
|
|
c_args : [c_msvc_compat_args, sse41_args],
|
2022-11-08 16:12:10 +08:00
|
|
|
include_directories : [inc_util],
|
2022-11-04 10:33:47 +08:00
|
|
|
gnu_symbol_visibility : 'hidden',
|
2022-06-02 10:02:57 -04:00
|
|
|
)
|
|
|
|
|
|
2022-11-08 16:12:10 +08:00
|
|
|
# subdir format provide files_mesa_format
|
|
|
|
|
subdir('format')
|
|
|
|
|
files_mesa_util += files_mesa_format
|
|
|
|
|
|
2019-07-22 14:50:15 +01:00
|
|
|
_libmesa_util = static_library(
|
2017-09-14 17:57:17 -07:00
|
|
|
'mesa_util',
|
2023-01-16 16:03:11 -06:00
|
|
|
[files_mesa_util, files_debug_stack, format_srgb],
|
2022-11-08 16:12:10 +08:00
|
|
|
include_directories : [inc_util, include_directories('format')],
|
2019-09-03 11:43:40 -07:00
|
|
|
dependencies : deps_for_libmesa_util,
|
2022-11-08 16:12:10 +08:00
|
|
|
link_with: [libmesa_util_sse41],
|
2020-04-24 13:10:41 -07:00
|
|
|
c_args : [c_msvc_compat_args],
|
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
2017-09-14 17:57:17 -07:00
|
|
|
build_by_default : false
|
|
|
|
|
)
|
|
|
|
|
|
2019-07-22 14:50:15 +01:00
|
|
|
idep_mesautil = declare_dependency(
|
|
|
|
|
link_with : _libmesa_util,
|
2022-11-08 16:12:10 +08:00
|
|
|
include_directories : [inc_util],
|
2022-11-04 09:57:22 +08:00
|
|
|
dependencies : deps_for_libmesa_util,
|
2019-07-22 14:50:15 +01:00
|
|
|
)
|
|
|
|
|
|
2022-11-09 15:50:03 -05:00
|
|
|
# Only install the drirc file if we build with support for parsing drirc files
|
|
|
|
|
if use_xmlconfig
|
|
|
|
|
install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
|
|
|
|
|
endif
|
|
|
|
|
|
2020-09-29 09:37:50 -07:00
|
|
|
xmlconfig_deps = []
|
2022-11-09 14:30:31 -05:00
|
|
|
if use_xmlconfig
|
2020-09-29 09:37:50 -07:00
|
|
|
xmlconfig_deps += dep_expat
|
|
|
|
|
endif
|
2021-02-24 20:28:38 +01:00
|
|
|
xmlconfig_deps += dep_regex
|
2020-09-29 09:37:50 -07:00
|
|
|
|
2022-11-09 14:30:31 -05:00
|
|
|
c_xmlconfig_arg = '-DWITH_XMLCONFIG=@0@'.format(use_xmlconfig.to_int())
|
|
|
|
|
|
2019-07-22 15:25:28 +01:00
|
|
|
_libxmlconfig = static_library(
|
2017-09-14 17:57:17 -07:00
|
|
|
'xmlconfig',
|
|
|
|
|
files_xmlconfig,
|
2020-09-29 09:37:50 -07:00
|
|
|
dependencies : [idep_mesautil, dep_m, xmlconfig_deps],
|
2018-01-23 10:28:08 -08:00
|
|
|
c_args : [
|
2020-04-24 13:10:41 -07:00
|
|
|
c_msvc_compat_args,
|
2022-11-09 14:23:41 -05:00
|
|
|
c_xmlconfig_arg,
|
2018-01-23 10:28:08 -08:00
|
|
|
'-DSYSCONFDIR="@0@"'.format(
|
|
|
|
|
join_paths(get_option('prefix'), get_option('sysconfdir'))
|
|
|
|
|
),
|
2018-08-06 11:41:33 +08:00
|
|
|
'-DDATADIR="@0@"'.format(
|
|
|
|
|
join_paths(get_option('prefix'), get_option('datadir'))
|
|
|
|
|
),
|
2018-01-23 10:28:08 -08:00
|
|
|
],
|
2020-04-24 13:10:41 -07:00
|
|
|
gnu_symbol_visibility : 'hidden',
|
2017-09-14 17:57:17 -07:00
|
|
|
build_by_default : false,
|
|
|
|
|
)
|
|
|
|
|
|
2019-10-27 00:48:36 +01:00
|
|
|
idep_xmlconfig = declare_dependency(
|
2020-09-29 09:37:50 -07:00
|
|
|
dependencies : xmlconfig_deps,
|
2019-07-22 15:25:28 +01:00
|
|
|
link_with : _libxmlconfig,
|
2019-05-22 16:37:10 +01:00
|
|
|
)
|
|
|
|
|
|
2020-03-31 14:05:59 -07:00
|
|
|
files_xxd = files('xxd.py')
|
2022-10-17 17:39:03 +03:00
|
|
|
glsl2spirv = files('glsl2spirv.py')
|
2020-03-31 14:05:59 -07:00
|
|
|
|
2017-09-14 17:57:17 -07:00
|
|
|
if with_tests
|
2020-09-25 12:56:22 -07:00
|
|
|
# DRI_CONF macros use designated initializers (required for union
|
|
|
|
|
# initializaiton), so we need c++2a since gtest forces us to use c++
|
2020-10-06 00:04:57 -07:00
|
|
|
if host_machine.system() != 'windows' and cpp.has_argument('-std=c++2a')
|
2020-09-10 15:13:03 -07:00
|
|
|
test('xmlconfig',
|
|
|
|
|
executable('xmlconfig_test',
|
|
|
|
|
files('tests/xmlconfig.cpp'),
|
|
|
|
|
dependencies : [idep_mesautil, idep_xmlconfig, idep_gtest],
|
2020-09-25 12:56:22 -07:00
|
|
|
override_options : ['cpp_std=c++2a'],
|
2022-11-09 14:23:41 -05:00
|
|
|
cpp_args: ['-Wno-write-strings', c_xmlconfig_arg]
|
2020-09-10 15:13:03 -07:00
|
|
|
),
|
|
|
|
|
suite : ['util'],
|
2020-10-07 09:59:43 -07:00
|
|
|
env: ['HOME=' + join_paths(meson.current_source_dir(),
|
|
|
|
|
'tests', 'drirc_home'),
|
|
|
|
|
'DRIRC_CONFIGDIR=' + join_paths(meson.current_source_dir(),
|
2021-01-13 13:10:21 -08:00
|
|
|
'tests', 'drirc_configdir')],
|
2023-02-23 10:49:37 +00:00
|
|
|
protocol : 'gtest',
|
2021-01-13 13:10:21 -08:00
|
|
|
)
|
2020-09-10 15:13:03 -07:00
|
|
|
endif
|
|
|
|
|
|
2021-10-18 13:16:29 -07:00
|
|
|
files_util_tests = files(
|
2021-10-20 20:53:24 -07:00
|
|
|
'tests/bitset_test.cpp',
|
|
|
|
|
'tests/blob_test.cpp',
|
2021-10-18 13:16:29 -07:00
|
|
|
'tests/dag_test.cpp',
|
2021-10-18 14:00:14 -07:00
|
|
|
'tests/fast_idiv_by_const_test.cpp',
|
|
|
|
|
'tests/fast_urem_by_const_test.cpp',
|
2023-06-07 12:13:22 +01:00
|
|
|
'tests/gc_alloc_tests.cpp',
|
2022-04-28 11:38:46 -07:00
|
|
|
'tests/half_float_test.cpp',
|
2021-10-18 13:16:29 -07:00
|
|
|
'tests/int_min_max.cpp',
|
2022-03-31 07:48:50 +08:00
|
|
|
'tests/mesa-sha1_test.cpp',
|
2022-11-10 20:06:14 +08:00
|
|
|
'tests/os_mman_test.cpp',
|
2022-11-04 01:56:34 +08:00
|
|
|
'tests/perf/u_trace_test.cpp',
|
2021-10-20 20:53:24 -07:00
|
|
|
'tests/rb_tree_test.cpp',
|
|
|
|
|
'tests/register_allocate_test.cpp',
|
|
|
|
|
'tests/roundeven_test.cpp',
|
2021-10-18 14:00:14 -07:00
|
|
|
'tests/set_test.cpp',
|
2022-03-31 07:48:50 +08:00
|
|
|
'tests/string_buffer_test.cpp',
|
2022-03-31 01:49:12 +08:00
|
|
|
'tests/timespec_test.cpp',
|
2021-10-20 20:53:24 -07:00
|
|
|
'tests/u_atomic_test.cpp',
|
2022-08-31 15:15:00 +08:00
|
|
|
'tests/u_call_once_test.cpp',
|
2021-10-20 20:53:24 -07:00
|
|
|
'tests/u_debug_stack_test.cpp',
|
2022-11-01 05:59:26 +08:00
|
|
|
'tests/u_debug_test.cpp',
|
2022-03-31 02:58:48 +08:00
|
|
|
'tests/u_printf_test.cpp',
|
2021-10-20 20:53:24 -07:00
|
|
|
'tests/u_qsort_test.cpp',
|
2021-10-18 14:00:14 -07:00
|
|
|
'tests/vector_test.cpp',
|
2021-10-18 13:16:29 -07:00
|
|
|
)
|
|
|
|
|
|
2022-07-29 02:42:42 +08:00
|
|
|
# FIXME: this test cause a big timeout on MacOS
|
|
|
|
|
if host_machine.system() != 'darwin'
|
|
|
|
|
files_util_tests += files(
|
|
|
|
|
'tests/sparse_array_test.cpp',
|
|
|
|
|
)
|
|
|
|
|
endif
|
|
|
|
|
|
2021-12-03 13:34:08 -08:00
|
|
|
if with_shader_cache
|
|
|
|
|
files_util_tests += files(
|
|
|
|
|
'tests/cache_test.cpp',
|
|
|
|
|
)
|
|
|
|
|
endif
|
|
|
|
|
|
2021-10-18 13:16:29 -07:00
|
|
|
test(
|
|
|
|
|
'util_tests',
|
|
|
|
|
executable(
|
|
|
|
|
'util_tests',
|
|
|
|
|
files_util_tests,
|
|
|
|
|
dependencies : [idep_mesautil, idep_gtest],
|
|
|
|
|
),
|
|
|
|
|
suite : ['util'],
|
2023-02-23 10:49:37 +00:00
|
|
|
protocol : 'gtest',
|
2021-10-18 13:16:29 -07:00
|
|
|
timeout : 180,
|
|
|
|
|
)
|
2020-07-28 21:29:37 -07:00
|
|
|
|
2020-03-16 10:49:17 +01:00
|
|
|
process_test_exe = executable(
|
|
|
|
|
'process_test',
|
2021-10-20 20:53:24 -07:00
|
|
|
files('tests/process_test.c'),
|
2020-03-16 10:49:17 +01:00
|
|
|
dependencies : idep_mesautil,
|
|
|
|
|
c_args : [c_msvc_compat_args],
|
|
|
|
|
)
|
2020-04-24 17:06:01 +03:00
|
|
|
if (host_machine.system() == 'windows' and build_machine.system() != 'windows')
|
|
|
|
|
# This conversion is only required on mingw crosscompilers, otherwise we hit at least one of these issues
|
|
|
|
|
# https://gitlab.freedesktop.org/mesa/mesa/-/issues/2690
|
|
|
|
|
# https://gitlab.freedesktop.org/mesa/mesa/-/issues/2788
|
|
|
|
|
prog_winepath = find_program('winepath')
|
2020-03-16 10:49:17 +01:00
|
|
|
process_test_exe_full_path = run_command(
|
2022-04-06 20:09:27 +02:00
|
|
|
prog_winepath, '-w', process_test_exe.full_path(),
|
|
|
|
|
check : true
|
2020-03-16 10:49:17 +01:00
|
|
|
).stdout().strip()
|
2020-03-26 14:07:39 +01:00
|
|
|
else
|
|
|
|
|
process_test_exe_full_path = process_test_exe.full_path()
|
2020-03-16 10:49:17 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
test(
|
|
|
|
|
'process',
|
|
|
|
|
process_test_exe,
|
|
|
|
|
suite : ['util'],
|
|
|
|
|
env: ['BUILD_FULL_PATH='+process_test_exe_full_path]
|
|
|
|
|
)
|
|
|
|
|
|
2023-01-19 10:20:15 -08:00
|
|
|
test(
|
|
|
|
|
'process_with_overrides',
|
|
|
|
|
process_test_exe,
|
|
|
|
|
suite : ['util'],
|
|
|
|
|
env: [
|
|
|
|
|
'BUILD_FULL_PATH='+process_test_exe_full_path,
|
|
|
|
|
'MESA_PROCESS_NAME=hello',
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
|
2017-09-14 17:57:17 -07:00
|
|
|
subdir('tests/hash_table')
|
2018-05-04 17:11:13 -07:00
|
|
|
subdir('tests/vma')
|
2019-11-07 17:33:19 +00:00
|
|
|
subdir('tests/format')
|
2017-09-14 17:57:17 -07:00
|
|
|
endif
|