amd/common: add vcn dec ip info query
authorLeo Liu <leo.liu@amd.com>
Wed, 3 May 2017 18:06:35 +0000 (14:06 -0400)
committerLeo Liu <leo.liu@amd.com>
Thu, 25 May 2017 15:40:20 +0000 (11:40 -0400)
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/amd/common/ac_gpu_info.c

index 56645c4863290d239fa55b499c1203fe545c3e05..a23b9bbd4c54d6685ec5b8fa86cb2819a6c5be98 100644 (file)
@@ -88,7 +88,7 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
 {
        struct amdgpu_buffer_size_alignments alignment_info = {};
        struct amdgpu_heap_info vram, vram_vis, gtt;
-       struct drm_amdgpu_info_hw_ip dma = {}, compute = {}, uvd = {}, vce = {};
+       struct drm_amdgpu_info_hw_ip dma = {}, compute = {}, uvd = {}, vce = {}, vcn_dec = {};
        uint32_t vce_version = 0, vce_feature = 0, uvd_version = 0, uvd_feature = 0;
        uint32_t unused_feature;
        int r, i, j;
@@ -157,6 +157,12 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
                return false;
        }
 
+       r = amdgpu_query_hw_ip_info(dev, AMDGPU_HW_IP_VCN_DEC, 0, &vcn_dec);
+       if (r) {
+               fprintf(stderr, "amdgpu: amdgpu_query_hw_ip_info(vcn_dec) failed.\n");
+               return false;
+       }
+
        r = amdgpu_query_firmware_version(dev, AMDGPU_INFO_FW_GFX_ME, 0, 0,
                                        &info->me_fw_version, &unused_feature);
        if (r) {