Skip to content

Commit 375b035

Browse files
committed
drm/amdgpu/bios: split vbios fetching between APU and dGPU
We need some different logic for dGPUs and the APU path can be simplified because there are some methods which are never used on APUs. This also fixes a regression on some older APUs causing the driver to fetch the unpatched ROM image rather than the patched image. Fixes: 9c081c1 ("drm/amdgpu: Reorder to read EFI exported ROM first") Reviewed-by: George Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent f2be7b3 commit 375b035

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,36 @@ static inline bool amdgpu_acpi_vfct_bios(struct amdgpu_device *adev)
414414
}
415415
#endif
416416

417-
bool amdgpu_get_bios(struct amdgpu_device *adev)
417+
static bool amdgpu_get_bios_apu(struct amdgpu_device *adev)
418+
{
419+
if (amdgpu_acpi_vfct_bios(adev)) {
420+
dev_info(adev->dev, "Fetched VBIOS from VFCT\n");
421+
goto success;
422+
}
423+
424+
if (igp_read_bios_from_vram(adev)) {
425+
dev_info(adev->dev, "Fetched VBIOS from VRAM BAR\n");
426+
goto success;
427+
}
428+
429+
if (amdgpu_read_bios(adev)) {
430+
dev_info(adev->dev, "Fetched VBIOS from ROM BAR\n");
431+
goto success;
432+
}
433+
434+
if (amdgpu_read_platform_bios(adev)) {
435+
dev_info(adev->dev, "Fetched VBIOS from platform\n");
436+
goto success;
437+
}
438+
439+
dev_err(adev->dev, "Unable to locate a BIOS ROM\n");
440+
return false;
441+
442+
success:
443+
return true;
444+
}
445+
446+
static bool amdgpu_get_bios_dgpu(struct amdgpu_device *adev)
418447
{
419448
if (amdgpu_atrm_get_bios(adev)) {
420449
dev_info(adev->dev, "Fetched VBIOS from ATRM\n");
@@ -455,10 +484,24 @@ bool amdgpu_get_bios(struct amdgpu_device *adev)
455484
return false;
456485

457486
success:
458-
adev->is_atom_fw = adev->asic_type >= CHIP_VEGA10;
459487
return true;
460488
}
461489

490+
bool amdgpu_get_bios(struct amdgpu_device *adev)
491+
{
492+
bool found;
493+
494+
if (adev->flags & AMD_IS_APU)
495+
found = amdgpu_get_bios_apu(adev);
496+
else
497+
found = amdgpu_get_bios_dgpu(adev);
498+
499+
if (found)
500+
adev->is_atom_fw = adev->asic_type >= CHIP_VEGA10;
501+
502+
return found;
503+
}
504+
462505
/* helper function for soc15 and onwards to read bios from rom */
463506
bool amdgpu_soc15_read_bios_from_rom(struct amdgpu_device *adev,
464507
u8 *bios, u32 length_bytes)

0 commit comments

Comments
 (0)