Skip to content

Commit a8387dd

Browse files
committed
drm/amdgpu: fix vbios fetching for SR-IOV
SR-IOV fetches the vbios from VRAM in some cases. Re-enable the VRAM path for dGPUs and rename the function to make it clear that it is not IGP specific. Fixes: 042658d ("drm/amdgpu: clean up vbios fetching code") Reviewed-by: Yang Wang <[email protected]> Tested-by: Yang Wang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 3cb576b commit a8387dd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ static bool check_atom_bios(uint8_t *bios, size_t size)
8787
* part of the system bios. On boot, the system bios puts a
8888
* copy of the igp rom at the start of vram if a discrete card is
8989
* present.
90+
* For SR-IOV, the vbios image is also put in VRAM in the VF.
9091
*/
91-
static bool igp_read_bios_from_vram(struct amdgpu_device *adev)
92+
static bool amdgpu_read_bios_from_vram(struct amdgpu_device *adev)
9293
{
9394
uint8_t __iomem *bios;
9495
resource_size_t vram_base;
@@ -414,7 +415,7 @@ static bool amdgpu_get_bios_apu(struct amdgpu_device *adev)
414415
goto success;
415416
}
416417

417-
if (igp_read_bios_from_vram(adev)) {
418+
if (amdgpu_read_bios_from_vram(adev)) {
418419
dev_info(adev->dev, "Fetched VBIOS from VRAM BAR\n");
419420
goto success;
420421
}
@@ -448,6 +449,12 @@ static bool amdgpu_get_bios_dgpu(struct amdgpu_device *adev)
448449
goto success;
449450
}
450451

452+
/* this is required for SR-IOV */
453+
if (amdgpu_read_bios_from_vram(adev)) {
454+
dev_info(adev->dev, "Fetched VBIOS from VRAM BAR\n");
455+
goto success;
456+
}
457+
451458
if (amdgpu_read_platform_bios(adev)) {
452459
dev_info(adev->dev, "Fetched VBIOS from platform\n");
453460
goto success;

0 commit comments

Comments
 (0)