diff options
author | Marek Olšák <[email protected]> | 2019-06-11 22:49:18 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-06-14 13:31:18 -0400 |
commit | abe9a51d27049971c77a0072693511caf9b793e2 (patch) | |
tree | b020b10528853daf4b6660b89f7d973195d75226 /src/amd/common/ac_gpu_info.c | |
parent | bbbbea243aea8297a4b7006be9e8f8e85c493b81 (diff) |
ac: add radeon_info::is_amdgpu instead of checking drm_major == 3
and clean up
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd/common/ac_gpu_info.c')
-rw-r--r-- | src/amd/common/ac_gpu_info.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c index 13fba8df047..4de6882f15e 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -117,6 +117,9 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev, info->pci_func = devinfo->businfo.pci->func; drmFreeDevice(&devinfo); + assert(info->drm_major == 3); + info->is_amdgpu = true; + /* Query hardware and driver information. */ r = amdgpu_query_gpu_info(dev, amdinfo); if (r) { @@ -161,7 +164,7 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev, return false; } - if (info->drm_major == 3 && info->drm_minor >= 17) { + if (info->drm_minor >= 17) { r = amdgpu_query_hw_ip_info(dev, AMDGPU_HW_IP_UVD_ENC, 0, &uvd_enc); if (r) { fprintf(stderr, "amdgpu: amdgpu_query_hw_ip_info(uvd_enc) failed.\n"); @@ -169,7 +172,7 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev, } } - if (info->drm_major == 3 && info->drm_minor >= 17) { + if (info->drm_minor >= 17) { 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"); @@ -177,7 +180,7 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev, } } - if (info->drm_major == 3 && info->drm_minor >= 17) { + if (info->drm_minor >= 17) { r = amdgpu_query_hw_ip_info(dev, AMDGPU_HW_IP_VCN_ENC, 0, &vcn_enc); if (r) { fprintf(stderr, "amdgpu: amdgpu_query_hw_ip_info(vcn_enc) failed.\n"); @@ -185,7 +188,7 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev, } } - if (info->drm_major == 3 && info->drm_minor >= 27) { + if (info->drm_minor >= 27) { r = amdgpu_query_hw_ip_info(dev, AMDGPU_HW_IP_VCN_JPEG, 0, &vcn_jpeg); if (r) { fprintf(stderr, "amdgpu: amdgpu_query_hw_ip_info(vcn_jpeg) failed.\n"); @@ -744,7 +747,7 @@ ac_get_raster_config(struct radeon_info *info, /* drm/radeon on Kaveri is buggy, so disable 1 RB to work around it. * This decreases performance by up to 50% when the RB is the bottleneck. */ - if (info->family == CHIP_KAVERI && info->drm_major == 2) + if (info->family == CHIP_KAVERI && !info->is_amdgpu) raster_config = 0x00000000; /* Fiji: Old kernels have incorrect tiling config. This decreases |