]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amdgpu: clean up discovery testing
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 28 May 2020 21:06:59 +0000 (17:06 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 29 May 2020 17:55:07 +0000 (13:55 -0400)
Rather than checking of the variable is enabled and the
chip is the right family check for the presence of the
discovery table.

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Acked-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index b7373c03d47184c3296bd63322e440d818c6ba6d..b633171281f89eae882c42640b0f6abee79cdc24 100644 (file)
@@ -1533,7 +1533,7 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
 
        adev->firmware.gpu_info_fw = NULL;
 
-       if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10) {
+       if (adev->discovery_bin) {
                amdgpu_discovery_get_gfx_info(adev);
                return 0;
        }
@@ -3374,7 +3374,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
        sysfs_remove_files(&adev->dev->kobj, amdgpu_dev_attributes);
        if (IS_ENABLED(CONFIG_PERF_EVENTS))
                amdgpu_pmu_fini(adev);
-       if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10)
+       if (adev->discovery_bin)
                amdgpu_discovery_fini(adev);
 }