radv/tests: require drm-shim and use it instead of RADV_FORCE_FAMILY

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38507>
This commit is contained in:
Samuel Pitoiset 2025-11-18 14:46:21 +01:00 committed by Marge Bot
parent 8fd91a1ee9
commit b2a13ce92c
4 changed files with 11 additions and 7 deletions

View file

@ -370,6 +370,9 @@ endif
if with_radv_tests and not with_amd_vk
error('RADV tests require RADV')
endif
if with_radv_tests and not with_tools.contains('drm-shim')
error('RADV tests require AMDGPU drm-shim')
endif
with_microsoft_clc = get_option('microsoft-clc').enabled()
with_spirv_to_dxil = get_option('spirv-to-dxil')

View file

@ -3,6 +3,10 @@
inc_amd = include_directories('.')
if with_tools.contains('drm-shim')
subdir('drm-shim')
endif
if with_amd_vk or with_gallium_radeonsi
subdir('addrlib')
subdir('common')
@ -21,10 +25,6 @@ if with_amd_vk
endif
endif
if with_tools.contains('drm-shim')
subdir('drm-shim')
endif
if with_gallium_radeonsi
subdir('vpelib')
subdir('gmlib')

View file

@ -349,5 +349,9 @@ if with_radv_tests
),
suite : ['compiler', 'nir'],
protocol : 'gtest',
env : [
'LD_PRELOAD=@0@'.format(libamdgpu_noop_drm_shim.full_path()),
'AMDGPU_GPU_ID=navi21',
],
)
endif

View file

@ -13,14 +13,11 @@ PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(VkInstance instance, con
radv_test::radv_test()
{
/* Force the driver to create a noop device that doesn't require AMDGPU. */
setenv("RADV_FORCE_FAMILY", "navi21", 1);
}
radv_test::~radv_test()
{
assert(envvars.size() == 0);
unsetenv("RADV_FORCE_FAMILY");
}
void