[PATCH i-g-t v2 1/3] lib/meson.build: Add AMDGPU_USERQ_ENABLED check for user queues

Jesse.zhang@amd.com jesse.zhang at amd.com
Wed Apr 9 07:56:51 UTC 2025


From: "Jesse.zhang at amd.com" <Jesse.zhang at amd.com>

Detect whether libdrm provides amdgpu_create_userqueue() and define
AMDGPU_USERQ_ENABLED if available. This enables user queue support
when building against newer libdrm while maintaining compatibility
with older versions that lack this function.

Signed-off-by: Jesse.Zhang <Jesse.zhang at amd.com>
---
 lib/meson.build | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/meson.build b/lib/meson.build
index d7bb72c57..8517cd540 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -172,6 +172,11 @@ if libdrm_amdgpu.found()
 		lib_sources +=[ 'amdgpu/amd_dispatch.c',]
 	else
 		warning('libdrm <= 2.4.99 found, amdgpu_cs_query_reset_state2 not applicable')
+	endif
+
+	if cc.has_function('amdgpu_create_userqueue', dependencies: libdrm_amdgpu)
+		add_project_arguments('-DAMDGPU_USERQ_ENABLED=1', language: 'c')
+		#conf.set('AMDGPU_USERQ_ENABLED', 1)
 	endif	
 endif
 
-- 
2.25.1



More information about the igt-dev mailing list