Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: merge bios post checking functions

Merge the post checking functions to avoid confusion and take
virtualization into account in all cases.

Signed-off-by: pding <Pixel.Ding@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

pding and committed by
Alex Deucher
91fe77eb 282dc832

+18 -23
+18 -23
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 744 744 { 745 745 uint32_t reg; 746 746 747 - if (adev->has_hw_reset) { 748 - adev->has_hw_reset = false; 749 - return true; 750 - } 751 - 752 - /* bios scratch used on CIK+ */ 753 - if (adev->asic_type >= CHIP_BONAIRE) 754 - return amdgpu_atombios_scratch_need_asic_init(adev); 755 - 756 - /* check MEM_SIZE for older asics */ 757 - reg = amdgpu_asic_get_config_memsize(adev); 758 - 759 - if ((reg != 0) && (reg != 0xffffffff)) 760 - return false; 761 - 762 - return true; 763 - 764 - } 765 - 766 - static bool amdgpu_vpost_needed(struct amdgpu_device *adev) 767 - { 768 747 if (amdgpu_sriov_vf(adev)) 769 748 return false; 770 749 ··· 766 787 return true; 767 788 } 768 789 } 769 - return amdgpu_need_post(adev); 790 + 791 + if (adev->has_hw_reset) { 792 + adev->has_hw_reset = false; 793 + return true; 794 + } 795 + 796 + /* bios scratch used on CIK+ */ 797 + if (adev->asic_type >= CHIP_BONAIRE) 798 + return amdgpu_atombios_scratch_need_asic_init(adev); 799 + 800 + /* check MEM_SIZE for older asics */ 801 + reg = amdgpu_asic_get_config_memsize(adev); 802 + 803 + if ((reg != 0) && (reg != 0xffffffff)) 804 + return false; 805 + 806 + return true; 770 807 } 771 808 772 809 /** ··· 2203 2208 amdgpu_device_detect_sriov_bios(adev); 2204 2209 2205 2210 /* Post card if necessary */ 2206 - if (amdgpu_vpost_needed(adev)) { 2211 + if (amdgpu_need_post(adev)) { 2207 2212 if (!adev->bios) { 2208 2213 dev_err(adev->dev, "no vBIOS found\n"); 2209 2214 amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_NO_VBIOS, 0, 0);