Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 1/5] tests/meson.build: Simplify builds for core and i915 targets
Date: Thu,  6 Jul 2023 13:13:24 +0200	[thread overview]
Message-ID: <20230706111328.508790-2-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230706111328.508790-1-mauro.chehab@linux.intel.com>

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

  reply	other threads:[~2023-07-06 11:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
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 ` [igt-dev] [PATCH i-g-t v2 4/5] tests/meson.build: create testlists for tests 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230706111328.508790-2-mauro.chehab@linux.intel.com \
    --to=mauro.chehab@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox