summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianci.Yin <tianci.yin@amd.com>2020-10-23 14:56:11 +0800
committerU-AMD\tiancyin <tiancyin@USEXA16-NVEU08.amd.com>2020-10-23 16:22:11 +0800
commit3e9f2113038ed92a66a9fbda6ba5c6eec998b312 (patch)
tree624cd41da390017d8ee87a67aaf41590884ddd63
parent3ec26b03eec156df5adac6ca71cea1561386b486 (diff)
downloadlibdrm-3e9f2113038ed92a66a9fbda6ba5c6eec998b312.tar.gz
libdrm-3e9f2113038ed92a66a9fbda6ba5c6eec998b312.tar.bz2
libdrm-3e9f2113038ed92a66a9fbda6ba5c6eec998b312.zip
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>
-rw-r--r--tests/amdgpu/vcn_tests.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/amdgpu/vcn_tests.c b/tests/amdgpu/vcn_tests.c
index ecea197e..e85174a9 100644
--- a/tests/amdgpu/vcn_tests.c
+++ b/tests/amdgpu/vcn_tests.c
@@ -94,6 +94,8 @@ CU_TestInfo vcn_tests[] = {
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,
&minor_version, &device_handle))
@@ -106,13 +108,15 @@ CU_BOOL suite_vcn_tests_enable(void)
chip_rev = device_handle->info.chip_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))
return CU_FALSE;
-
- if (family_id < AMDGPU_FAMILY_RV &&
- (family_id == AMDGPU_FAMILY_AI &&
- chip_id != (chip_rev + 0x32))) { /* Arcturus */
+ if (r != 0 || !info.available_rings ||
+ (family_id < AMDGPU_FAMILY_RV &&
+ (family_id == AMDGPU_FAMILY_AI &&
+ chip_id != (chip_rev + 0x32)))) { /* Arcturus */
printf("\n\nThe ASIC NOT support VCN, suite disabled\n");
return CU_FALSE;
}