ac/gpu_info: don't fail on amdgpu_query_video_caps_info failures

When VCN is unsupported, we don't want to break GL or Vulkan.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13871>
This commit is contained in:
Marek Olšák 2021-11-01 10:50:04 -04:00 committed by Marge Bot
parent a9b4aef0f2
commit d830d213b6
1 changed files with 4 additions and 13 deletions

View File

@ -535,19 +535,10 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info,
info->vram_size_kb = DIV_ROUND_UP(info->vram_size, 1024);
if (info->drm_minor >= 41) {
r = amdgpu_query_video_caps_info(dev, AMDGPU_INFO_VIDEO_CAPS_DECODE,
sizeof(info->dec_caps), &(info->dec_caps));
if (r) {
fprintf(stderr, "amdgpu: amdgpu_query_video_caps_info for decode failed.\n");
return r;
}
r = amdgpu_query_video_caps_info(dev, AMDGPU_INFO_VIDEO_CAPS_ENCODE,
sizeof(info->enc_caps), &(info->enc_caps));
if (r) {
fprintf(stderr, "amdgpu: amdgpu_query_video_caps_info for encode failed.\n");
return r;
}
amdgpu_query_video_caps_info(dev, AMDGPU_INFO_VIDEO_CAPS_DECODE,
sizeof(info->dec_caps), &(info->dec_caps));
amdgpu_query_video_caps_info(dev, AMDGPU_INFO_VIDEO_CAPS_ENCODE,
sizeof(info->enc_caps), &(info->enc_caps));
}
/* Add some margin of error, though this shouldn't be needed in theory. */