[PATCH RESEND i-g-t v4 13/31] tools/intel_gpu_frequency: link with minimal sub-libraries

Sebastian Brzezinka <[email protected]> Wed, 29 Jul 2026 13:03:30 +0200
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <cc5550d4b89b9ce64648ff1381af6a90fd2d95f2.1785152675.git.sebastian.brzezinka@intel.com>
intel_gpu_frequency needs only intel_gen/devid helpers and a DRM device
opener to query the GPU frequency.  Link it against lib_igt_chipset for
the devid helpers and lib_igt_drm_stub for driver detection and device
opening, instead of the full libigt.so stack.

ldd before: 35  (ldd intel_gpu_frequency | wc -l)
ldd after:   5  (ldd intel_gpu_frequency | wc -l)

Signed-off-by: Sebastian Brzezinka <[email protected]>
Acked-by: Ashutosh Dixit <[email protected]>
Reviewed-by: Krzysztof Niemiec <[email protected]>
Reviewed-by: Krzysztof Karas <[email protected]>
---
 tools/meson.build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/meson.build b/tools/meson.build
index 53aa31056..01400f53e 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -23,7 +23,6 @@ tools_progs = [
 	'intel_dump_decode',
 	'intel_error_decode',
 	'intel_forcewaked',
-	'intel_gpu_frequency',
 	'intel_framebuffer_dump',
 	'intel_gpu_time',
 	'intel_gtt',
@@ -66,6 +65,11 @@ executable('intel_firmware_decode', 'intel_firmware_decode.c',
 	   install_rpath : bindir_rpathdir,
 	   install : true)
 
+executable('intel_gpu_frequency', 'intel_gpu_frequency.c',
+	   dependencies : [lib_igt_chipset, lib_igt_tools_stub, lib_igt_drm_stub],
+	   install_rpath : bindir_rpathdir,
+	   install : true)
+
 if libudev.found()
 	intel_dp_compliance_src = [
 		'intel_dp_compliance.c',
-- 
2.53.0