* [igt-dev] [PATCH i-g-t v2 1/5] tests/meson.build: Simplify builds for core and i915 targets
2023-07-06 11:13 [igt-dev] [PATCH i-g-t v2 0/5] Speedup IGT build time Mauro Carvalho Chehab
@ 2023-07-06 11:13 ` Mauro Carvalho Chehab
2023-07-06 11:13 ` [igt-dev] [PATCH i-g-t v2 2/5] lib/igt_core: use the macro when checking for list_subtests Mauro Carvalho Chehab
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Mauro Carvalho Chehab @ 2023-07-06 11:13 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
There are some tests that either require:
- extra dependencies
- extra source files
Right now, they have special executable() targets that are handled
outside the normal way. remove those special targets, converting
them into simple ones, and using two extra dictionaries to map
those extra requirements.
This makes the meson.build file a lot simpler, and makes easier
to add other rules when creating test lists.
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
tests/meson.build | 223 +++++++++++++---------------------------------
1 file changed, 61 insertions(+), 162 deletions(-)
diff --git a/tests/meson.build b/tests/meson.build
index ee066b84900b..3116c458d60b 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -3,12 +3,14 @@ test_progs = [
'core_getclient',
'core_getstats',
'core_getversion',
+ 'core_hotunplug',
'core_setmaster',
'core_setmaster_vs_auth',
'debugfs_test',
'dmabuf',
'dmabuf_sync_file',
'device_reset',
+ 'dumb_buffer',
'drm_buddy',
'drm_mm',
'drm_read',
@@ -21,6 +23,7 @@ test_progs = [
'kms_atomic_interruptible',
'kms_atomic_transition',
'kms_bw',
+ 'kms_color',
'kms_concurrent',
'kms_content_protection',
'kms_cursor_crc',
@@ -77,7 +80,9 @@ test_progs = [
'syncobj_basic',
'syncobj_wait',
'syncobj_timeline',
+ 'sw_sync',
'template',
+ 'testdisplay',
'tools_test',
'vgem_basic',
'vgem_slow',
@@ -86,16 +91,19 @@ test_progs = [
i915_progs = [
'api_intel_allocator',
'api_intel_bb',
+ 'drm_fdinfo',
'gen3_mixed_blits',
'gen3_render_linear_blits',
'gen3_render_mixed_blits',
'gen3_render_tiledx_blits',
'gen3_render_tiledy_blits',
'gem_bad_reloc',
+ 'gem_barrier_race',
'gem_basic',
'gem_blits',
'gem_busy',
'gem_caching',
+ 'gem_create',
'gem_ccs',
'gem_close',
'gem_close_race',
@@ -105,16 +113,20 @@ i915_progs = [
'gem_ctx_create',
'gem_ctx_engines',
'gem_ctx_exec',
+ 'gem_ctx_freq',
'gem_ctx_isolation',
'gem_ctx_param',
'gem_ctx_persistence',
'gem_ctx_shared',
+ 'gem_ctx_sseu',
'gem_ctx_switch',
+ 'gem_eio',
'gem_evict_alignment',
'gem_evict_everything',
'gem_exec_alignment',
'gem_exec_async',
'gem_exec_await',
+ 'gem_exec_balancer',
'gem_exec_basic',
'gem_exec_big',
'gem_exec_capture',
@@ -157,6 +169,7 @@ i915_progs = [
'gem_media_vme',
'gem_mmap',
'gem_mmap_gtt',
+ 'gem_mmap_offset',
'gem_mmap_wc',
'gem_partial_pwrite_pread',
'gem_pipe_control_store_loop',
@@ -200,6 +213,8 @@ i915_progs = [
'gem_wait',
'gem_watchdog',
'gem_workarounds',
+ 'perf',
+ 'perf_pmu',
'i915_fb_tiling',
'i915_getparams_basic',
'i915_pm_freq_api',
@@ -209,9 +224,11 @@ i915_progs = [
'i915_pciid',
'i915_pipe_stress',
'i915_pm_backlight',
+ 'i915_pm_freq_mult',
'i915_pm_lpsp',
'i915_pm_rpm',
'i915_pm_dc',
+ 'i915_pm_rc6_residency',
'i915_pm_rps',
'i915_pm_sseu',
'i915_power',
@@ -224,6 +241,7 @@ i915_progs = [
'kms_ccs',
'kms_cdclk',
'kms_draw_crc',
+ 'kms_dsc',
'kms_fb_coherency',
'kms_fbcon_fbt',
'kms_fence_pin_leak',
@@ -234,6 +252,7 @@ i915_progs = [
'kms_mmap_write_crc',
'kms_pipe_b_c_ivb',
'kms_psr',
+ 'kms_psr2_sf',
'kms_psr2_su',
'kms_psr_stress_test',
'kms_pwrite_crc',
@@ -301,12 +320,41 @@ if libdrm_nouveau.found()
test_deps += libdrm_nouveau
endif
+# Extra sources used on core and Intel drivers
+extra_sources = {
+ 'core_hotunplug': [ 'core_hotunplug.c' ],
+ 'dumb_buffer': ['dumb_buffer.c' ],
+ 'testdisplay': [ 'testdisplay_hotplug.c' ],
+ 'kms_color': [ 'kms_color_helper.c' ],
+ 'kms_dsc': [ join_paths ('i915', 'kms_dsc_helper.c') ],
+ 'kms_psr2_sf': [ join_paths ('i915', 'kms_dsc_helper.c') ],
+}
+
+# Extra dependencies used on core and Intel drivers
+extra_dependencies = {
+ 'core_hotunplug': [ lib_igt_i915_perf ],
+ 'drm_fdinfo': [ lib_igt_drm_fdinfo ],
+ 'dumb_buffer': [ libatomic ],
+ 'gem_barrier_race': [ lib_igt_i915_perf ],
+ 'gem_create': [ libatomic ],
+ 'gem_ctx_freq': [ lib_igt_perf ],
+ 'gem_ctx_sseu': [ lib_igt_perf ],
+ 'gem_eio': [ realtime ],
+ 'gem_exec_balancer': [ lib_igt_perf ],
+ 'gem_mmap_offset': [ libatomic ],
+ 'i915_pm_freq_mult': [ lib_igt_perf ],
+ 'i915_pm_rc6_residency': [ lib_igt_perf ],
+ 'perf': [ lib_igt_i915_perf ],
+ 'perf_pmu': [ lib_igt_perf ],
+ 'sw_sync': [ libatomic ],
+}
+
test_executables = []
test_list = []
foreach prog : test_progs
- test_executables += executable(prog, prog + '.c',
- dependencies : test_deps,
+ test_executables += executable(prog, [prog + '.c'] + extra_sources.get(prog, []),
+ dependencies : test_deps + extra_dependencies.get(prog, []),
install_dir : libexecdir,
install_rpath : libexecdir_rpathdir,
install : true)
@@ -315,8 +363,8 @@ endforeach
foreach prog : i915_progs
test_executables += executable(prog,
- join_paths('i915', prog + '.c'),
- dependencies : test_deps,
+ [join_paths('i915', prog + '.c')] + extra_sources.get(prog, []),
+ dependencies : test_deps + extra_dependencies.get(prog, []),
install_dir : libexecdir,
install_rpath : libexecdir_rpathdir,
install : true)
@@ -326,8 +374,8 @@ endforeach
if build_xe
foreach prog : xe_progs
test_executables += executable(prog,
- join_paths('xe', prog + '.c'),
- dependencies : test_deps,
+ [join_paths('xe', prog + '.c')] + extra_sources.get(prog, []),
+ dependencies : test_deps + extra_dependencies.get(prog, []),
install_dir : libexecdir,
install_rpath : libexecdir_rpathdir,
install : true)
@@ -357,165 +405,16 @@ if chamelium.found()
test_list += prog
endforeach
test_deps += chamelium
-endif
-
-test_executables += executable('drm_fdinfo',
- join_paths('i915', 'drm_fdinfo.c'),
- dependencies : test_deps + [ lib_igt_drm_fdinfo ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'drm_fdinfo'
-
-test_executables += executable('dumb_buffer', 'dumb_buffer.c',
- dependencies : test_deps + [ libatomic ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'dumb_buffer'
-
-test_executables += executable('gem_create',
- join_paths('i915', 'gem_create.c'),
- dependencies : test_deps + [ libatomic ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'gem_create'
-
-test_executables += executable('gem_ctx_freq',
- join_paths('i915', 'gem_ctx_freq.c'),
- dependencies : test_deps + [ lib_igt_perf ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'gem_ctx_freq'
-
-test_executables += executable('gem_ctx_sseu',
- join_paths('i915', 'gem_ctx_sseu.c'),
- dependencies : test_deps + [ lib_igt_perf ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'gem_ctx_sseu'
-
-test_executables += executable('gem_eio',
- join_paths('i915', 'gem_eio.c'),
- dependencies : test_deps + [ realtime ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'gem_eio'
-
-test_executables += executable('gem_exec_balancer', 'i915/gem_exec_balancer.c',
- dependencies : test_deps + [ lib_igt_perf ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'gem_exec_balancer'
-
-test_executables += executable('gem_mmap_offset',
- join_paths('i915', 'gem_mmap_offset.c'),
- dependencies : test_deps + [ libatomic ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'gem_mmap_offset'
-
-test_executables += executable('i915_pm_freq_mult',
- join_paths('i915', 'i915_pm_freq_mult.c'),
- dependencies : test_deps + [ lib_igt_perf ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'i915_pm_freq_mult'
-test_executables += executable('i915_pm_rc6_residency',
- join_paths('i915', 'i915_pm_rc6_residency.c'),
- dependencies : test_deps + [ lib_igt_perf ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'i915_pm_rc6_residency'
-
-test_executables += executable('gem_barrier_race',
- join_paths('i915', 'gem_barrier_race.c'),
- dependencies : test_deps + [ lib_igt_i915_perf ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'gem_barrier_race'
-
-test_executables += executable('perf_pmu',
- join_paths('i915', 'perf_pmu.c'),
- dependencies : test_deps + [ lib_igt_perf ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'perf_pmu'
-
-test_executables += executable('perf',
- join_paths('i915', 'perf.c'),
- dependencies : test_deps + [ lib_igt_i915_perf ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'perf'
-
-test_executables += executable('core_hotunplug', 'core_hotunplug.c',
- dependencies : test_deps + [ lib_igt_i915_perf ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'core_hotunplug'
-
-executable('testdisplay', ['testdisplay.c', 'testdisplay_hotplug.c'],
- dependencies : test_deps,
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'testdisplay'
-
-test_executables += executable('kms_color',
- [ 'kms_color.c', 'kms_color_helper.c' ],
- dependencies : test_deps,
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'kms_color'
-
-test_executables += executable('kms_dsc',
- [ join_paths('i915', 'kms_dsc.c'), join_paths ('i915', 'kms_dsc_helper.c')],
- dependencies : test_deps,
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'kms_dsc'
-
-test_executables += executable('kms_psr2_sf',
- [ join_paths('i915', 'kms_psr2_sf.c'), join_paths ('i915', 'kms_dsc_helper.c')],
- dependencies : test_deps,
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'kms_psr2_sf'
-
-if chamelium.found()
- test_executables += executable('kms_chamelium_color',
- [ 'chamelium/kms_chamelium_color.c', 'kms_color_helper.c' ],
- dependencies : test_deps + [ chamelium ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
- test_list += 'kms_chamelium_color'
+ test_executables += executable('kms_chamelium_color',
+ [ 'chamelium/kms_chamelium_color.c', 'kms_color_helper.c' ],
+ dependencies : test_deps + [ chamelium ],
+ install_dir : libexecdir,
+ install_rpath : libexecdir_rpathdir,
+ install : true)
+ test_list += 'kms_chamelium_color'
endif
-test_executables += executable('sw_sync', 'sw_sync.c',
- dependencies : test_deps + [ libatomic ],
- install_dir : libexecdir,
- install_rpath : libexecdir_rpathdir,
- install : true)
-test_list += 'sw_sync'
-
subdir('amdgpu')
subdir('v3d')
--
2.40.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [igt-dev] [PATCH i-g-t v2 4/5] tests/meson.build: create testlists for tests
2023-07-06 11:13 [igt-dev] [PATCH i-g-t v2 0/5] Speedup IGT build time Mauro Carvalho Chehab
` (2 preceding siblings ...)
2023-07-06 11:13 ` [igt-dev] [PATCH i-g-t v2 3/5] lib/igt_core: add an option to show the testlist Mauro Carvalho Chehab
@ 2023-07-06 11:13 ` Mauro Carvalho Chehab
2023-07-06 11:13 ` [igt-dev] [PATCH i-g-t v2 5/5] scripts/test_list.py: speedup testlist check logic Mauro Carvalho Chehab
2023-07-06 13:36 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Speedup IGT build time (rev2) Patchwork
5 siblings, 0 replies; 7+ messages in thread
From: Mauro Carvalho Chehab @ 2023-07-06 11:13 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
Let's dynamically create testlists for during build time, as this
can speed up a lot the validation check for testplan.
Ideally, all it would need to to that would be to use this
logic at the end of tests/meson.build:
foreach testexe : test_executables
prog = testexe.name()
output = prog.split('/').get(-1) + '.testlist'
custom_target(output,
build_by_default : true,
command : [ testexe.full_path(), '--show-testlist'],
capture : true,
depends : testexe,
output : output)
Unfortunately, this requies Meson >= 0.54. So, we need to add
one custom_target per executable() call.
Also, meson does a very crappy job when checking for dependencies
created with executable targets, as it tries to find all binaries
during meson runtime, and not while running ninja. Due to that,
we also had to change the logic to call an existing binary with:
- command : [ testexe.full_path(), '--show-testlist'],
+ command : [ '/usr/bin/sh', '-c', testexe.full_path() + ' --show-testlist']
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
tests/meson.build | 60 +++++++++++++++++++++++++++++++++++++++++------
1 file changed, 53 insertions(+), 7 deletions(-)
diff --git a/tests/meson.build b/tests/meson.build
index 3116c458d60b..9b7301dbf569 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -353,33 +353,57 @@ test_executables = []
test_list = []
foreach prog : test_progs
- test_executables += executable(prog, [prog + '.c'] + extra_sources.get(prog, []),
+ testexe = executable(prog, [prog + '.c'] + extra_sources.get(prog, []),
dependencies : test_deps + extra_dependencies.get(prog, []),
install_dir : libexecdir,
install_rpath : libexecdir_rpathdir,
install : true)
+ test_executables += testexe
test_list += prog
+ name = prog.split('/').get(-1)
+ custom_target(name + '.testlist',
+ build_by_default : true,
+ command : [ '/usr/bin/sh', '-c', testexe.full_path() + ' --show-testlist'],
+ capture : true,
+ depends : testexe,
+ output : name + '.testlist')
endforeach
foreach prog : i915_progs
- test_executables += executable(prog,
+ testexe = executable(prog,
[join_paths('i915', prog + '.c')] + extra_sources.get(prog, []),
dependencies : test_deps + extra_dependencies.get(prog, []),
install_dir : libexecdir,
install_rpath : libexecdir_rpathdir,
install : true)
+ test_executables += testexe
test_list += prog
+ name = prog.split('/').get(-1)
+ custom_target(name + '.testlist',
+ build_by_default : true,
+ command : [ '/usr/bin/sh', '-c', testexe.full_path() + ' --show-testlist'],
+ capture : true,
+ depends : testexe,
+ output : name + '.testlist')
endforeach
if build_xe
foreach prog : xe_progs
- test_executables += executable(prog,
+ testexe = executable(prog,
[join_paths('xe', prog + '.c')] + extra_sources.get(prog, []),
dependencies : test_deps + extra_dependencies.get(prog, []),
install_dir : libexecdir,
install_rpath : libexecdir_rpathdir,
install : true)
test_list += prog
+ test_executables += testexe
+ name = prog.split('/').get(-1)
+ custom_target(name + '.testlist',
+ build_by_default : true,
+ command : [ '/usr/bin/sh', '-c', testexe.full_path() + ' --show-testlist'],
+ capture : true,
+ depends : testexe,
+ output : name + '.testlist')
endforeach
build_info += 'Xe **experimental** tests enabled.'
endif
@@ -395,7 +419,7 @@ endforeach
if chamelium.found()
foreach prog : chamelium_progs
- test_executables += executable(prog,
+ testexe = executable(prog,
[join_paths('chamelium', prog + '.c'),
join_paths('chamelium', 'kms_chamelium_helper.c')],
dependencies : test_deps,
@@ -403,16 +427,32 @@ if chamelium.found()
install_rpath : libexecdir_rpathdir,
install : true)
test_list += prog
+ test_executables += testexe
+ name = prog.split('/').get(-1)
+ custom_target(name + '.testlist',
+ build_by_default : true,
+ command : [ '/usr/bin/sh', '-c', testexe.full_path() + ' --show-testlist'],
+ capture : true,
+ depends : testexe,
+ output : name + '.testlist')
endforeach
test_deps += chamelium
- test_executables += executable('kms_chamelium_color',
+ name = 'kms_chamelium_color'
+ testexe = executable('kms_chamelium_color',
[ 'chamelium/kms_chamelium_color.c', 'kms_color_helper.c' ],
dependencies : test_deps + [ chamelium ],
install_dir : libexecdir,
install_rpath : libexecdir_rpathdir,
install : true)
- test_list += 'kms_chamelium_color'
+ test_list += name
+ test_executables += testexe
+ custom_target(name + '.testlist',
+ build_by_default : true,
+ command : [ '/usr/bin/sh', '-c', testexe.full_path() + ' --show-testlist'],
+ capture : true,
+ depends : testexe,
+ output : name + '.testlist')
endif
subdir('amdgpu')
@@ -448,11 +488,17 @@ foreach prog : test_list
test('testcase check ' + prog, test_script, args : prog)
endforeach
-executable('gem_stress', 'i915/gem_stress.c',
+testexe = executable('gem_stress', 'i915/gem_stress.c',
install : true,
install_dir : libexecdir,
install_rpath : libexecdir_rpathdir,
dependencies : igt_deps)
+custom_target('gem_stress.testlist',
+ build_by_default : true,
+ command : [ '/usr/bin/sh', '-c', testexe.full_path() + ' --show-testlist'],
+ capture : true,
+ depends : testexe,
+ output : 'gem_stress.testlist')
image_files = [
'1080p-left.png',
--
2.40.1
^ permalink raw reply related [flat|nested] 7+ messages in thread