tests/amdgpu: disable VCN test if no VCN ring available(v2)

If KMD has no VCN support, remove the VCN test.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Tianci.Yin <tianci.yin@amd.com>
main
Tianci.Yin 2020-10-23 14:56:11 +08:00 committed by U-AMD\tiancyin
parent 3ec26b03ee
commit 3e9f211303
1 changed files with 8 additions and 4 deletions

View File

@ -94,6 +94,8 @@ CU_TestInfo vcn_tests[] = {
CU_BOOL suite_vcn_tests_enable(void) CU_BOOL suite_vcn_tests_enable(void)
{ {
struct drm_amdgpu_info_hw_ip info;
int r;
if (amdgpu_device_initialize(drm_amdgpu[0], &major_version, if (amdgpu_device_initialize(drm_amdgpu[0], &major_version,
&minor_version, &device_handle)) &minor_version, &device_handle))
@ -106,13 +108,15 @@ CU_BOOL suite_vcn_tests_enable(void)
chip_rev = device_handle->info.chip_rev; chip_rev = device_handle->info.chip_rev;
chip_id = device_handle->info.chip_external_rev; chip_id = device_handle->info.chip_external_rev;
r = amdgpu_query_hw_ip_info(device_handle, AMDGPU_HW_IP_VCN_DEC, 0, &info);
if (amdgpu_device_deinitialize(device_handle)) if (amdgpu_device_deinitialize(device_handle))
return CU_FALSE; return CU_FALSE;
if (r != 0 || !info.available_rings ||
if (family_id < AMDGPU_FAMILY_RV && (family_id < AMDGPU_FAMILY_RV &&
(family_id == AMDGPU_FAMILY_AI && (family_id == AMDGPU_FAMILY_AI &&
chip_id != (chip_rev + 0x32))) { /* Arcturus */ chip_id != (chip_rev + 0x32)))) { /* Arcturus */
printf("\n\nThe ASIC NOT support VCN, suite disabled\n"); printf("\n\nThe ASIC NOT support VCN, suite disabled\n");
return CU_FALSE; return CU_FALSE;
} }