2022-07-26 10:24:12 +02:00
|
|
|
drm_partial = drm.partial_dependency(compile_args: true, includes: true)
|
|
|
|
|
2019-09-13 09:33:49 +02:00
|
|
|
# This mock library will replace libdrm
|
|
|
|
mock_drm_lib = shared_library(
|
|
|
|
'drm',
|
|
|
|
files('libdrm_mock.c'),
|
2022-07-26 10:24:12 +02:00
|
|
|
dependencies: drm_partial,
|
2019-09-13 09:33:49 +02:00
|
|
|
soversion: drm.version().split('.')[0], # TODO: get it from the real dep
|
|
|
|
)
|
|
|
|
|
|
|
|
mock_liftoff = declare_dependency(
|
|
|
|
link_with: [mock_drm_lib, liftoff_lib],
|
2021-08-13 22:04:28 +02:00
|
|
|
include_directories: [liftoff_inc],
|
2022-07-26 10:24:12 +02:00
|
|
|
dependencies: drm_partial,
|
2019-09-13 09:33:49 +02:00
|
|
|
)
|
|
|
|
|
2021-08-12 18:15:50 +02:00
|
|
|
test('check_ndebug', executable('check_ndebug', 'check_ndebug.c'))
|
|
|
|
|
2019-10-30 21:08:31 +01:00
|
|
|
bench_exe = executable(
|
|
|
|
'bench',
|
|
|
|
files('bench.c'),
|
|
|
|
dependencies: mock_liftoff,
|
|
|
|
)
|
|
|
|
|
2019-10-14 17:19:06 +02:00
|
|
|
tests = {
|
|
|
|
'alloc': [
|
|
|
|
'basic',
|
2020-05-26 20:08:12 +02:00
|
|
|
'no-props-fail',
|
|
|
|
'zero-fb-id-fail',
|
2022-01-31 14:05:58 +01:00
|
|
|
'composition-no-props',
|
2019-11-29 10:57:24 +01:00
|
|
|
'empty',
|
2019-10-14 17:19:06 +02:00
|
|
|
'simple-1x',
|
|
|
|
'simple-1x-fail',
|
|
|
|
'simple-3x',
|
2021-12-14 17:02:30 +01:00
|
|
|
'zpos-2x-fail',
|
2019-10-14 17:19:06 +02:00
|
|
|
'zpos-3x',
|
|
|
|
'zpos-3x-intersect-fail',
|
|
|
|
'zpos-3x-intersect-partial',
|
|
|
|
'zpos-3x-disjoint-partial',
|
|
|
|
'zpos-3x-disjoint',
|
|
|
|
'zpos-4x-intersect-partial',
|
|
|
|
'zpos-4x-disjoint',
|
|
|
|
'zpos-4x-disjoint-alt',
|
|
|
|
'zpos-4x-domino-fail',
|
|
|
|
'zpos-4x-domino-partial',
|
|
|
|
'composition-3x',
|
|
|
|
'composition-3x-fail',
|
|
|
|
'composition-3x-partial',
|
2019-12-13 11:36:09 +01:00
|
|
|
'composition-3x-force',
|
2021-12-14 17:13:49 +01:00
|
|
|
'zpos-2x-reverse',
|
2022-01-31 14:26:20 +01:00
|
|
|
'zpos-3x-zero-fb-id',
|
2022-01-31 14:29:16 +01:00
|
|
|
'zpos-3x-zero-alpha',
|
2019-10-14 17:19:06 +02:00
|
|
|
],
|
2019-10-14 17:43:45 +02:00
|
|
|
'dynamic': [
|
|
|
|
'same',
|
2020-12-05 11:53:56 +01:00
|
|
|
'change-fb',
|
2023-02-09 12:34:08 +01:00
|
|
|
'change-fb-modifier',
|
2020-12-05 12:36:34 +01:00
|
|
|
'unset-fb',
|
|
|
|
'set-fb',
|
2019-11-24 13:25:59 +01:00
|
|
|
'add-layer',
|
|
|
|
'remove-layer',
|
2019-12-12 23:22:18 +01:00
|
|
|
'change-composition-layer',
|
2020-12-05 13:06:44 +01:00
|
|
|
'change-alpha',
|
|
|
|
'set-alpha-from-opaque',
|
|
|
|
'set-alpha-from-transparent',
|
|
|
|
'unset-alpha-to-opaque',
|
|
|
|
'unset-alpha-to-transparent',
|
2020-12-05 12:44:08 +01:00
|
|
|
'change-in-fence-fd',
|
2020-12-05 14:36:47 +01:00
|
|
|
'change-fb-damage-clips',
|
2019-10-14 17:43:45 +02:00
|
|
|
],
|
2019-10-30 20:41:25 +01:00
|
|
|
'priority': [
|
Keep output layers ordered by allocation priority
To optimize for offloading success, the list of output layers can be
ordered by allocation priority, improving the chances of a higher
allocation score before the deadline.
The allocation algorithm picks DRM planes first, then tests output
layers against them. To reduce the number of tests, the layers can be
ordered such that it matches the DRM plane order. DRM planes in
libliftoff are ordered by primary, followed by all other planes in
descending z-order. We order the layers similarly, with the composition
layer first, followed by layers of descending priority.
In addition to layer priority, it's z-pos and intersection with other
layers are considered. Since to offload a high priority layer, all
intersection layers with higher z-pos will also need to be offloaded.
This also changes when reallocation is necessary. On top of the existing
criteria, reallocation is done when a layer's ordering changes.
With layer priority now considered, the priority test now passes --
enable it.
2023-10-02 23:55:55 +02:00
|
|
|
'basic',
|
2019-10-30 20:41:25 +01:00
|
|
|
],
|
2020-05-22 17:44:41 +02:00
|
|
|
'prop': [
|
2020-05-26 21:30:31 +02:00
|
|
|
'default-alpha',
|
|
|
|
'default-rotation',
|
|
|
|
'ignore-alpha',
|
2020-12-05 18:52:52 +01:00
|
|
|
'immutable-zpos',
|
2021-09-30 14:54:33 +02:00
|
|
|
'unmatched',
|
2022-08-05 23:08:24 +02:00
|
|
|
'unset',
|
2023-02-13 12:36:53 +01:00
|
|
|
'in-formats',
|
2023-02-15 20:11:18 +01:00
|
|
|
'range',
|
|
|
|
'signed-range',
|
|
|
|
'enum',
|
|
|
|
'bitmask',
|
2020-05-22 17:44:41 +02:00
|
|
|
],
|
2023-02-09 10:38:03 +01:00
|
|
|
'candidate': [
|
|
|
|
'basic',
|
|
|
|
],
|
2019-10-14 17:19:06 +02:00
|
|
|
}
|
2019-09-13 18:47:00 +02:00
|
|
|
|
2019-10-14 17:19:06 +02:00
|
|
|
foreach test_name, subtests : tests
|
|
|
|
test_exe = executable(
|
|
|
|
'test-' + test_name,
|
|
|
|
files('test_' + test_name + '.c'),
|
|
|
|
dependencies: mock_liftoff,
|
2019-09-13 18:47:00 +02:00
|
|
|
)
|
2019-10-14 17:19:06 +02:00
|
|
|
foreach subtest_name : subtests
|
|
|
|
test(
|
|
|
|
test_name + '@' + subtest_name,
|
|
|
|
test_exe,
|
|
|
|
args: [subtest_name],
|
|
|
|
)
|
|
|
|
endforeach
|
2019-09-13 18:47:00 +02:00
|
|
|
endforeach
|