Commit 27145f78 authored by Lijo Lazar's avatar Lijo Lazar Committed by Alex Deucher
Browse files

drm/amdgpu: Prefer shadow rom when available



Fetch VBIOS from shadow ROM when available before trying other methods
like EFI method.

Signed-off-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Fixes: 9c081c11 ("drm/amdgpu: Reorder to read EFI exported ROM first")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4066


Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent 942de4ea
Loading
Loading
Loading
Loading
+27 −7
Original line number Diff line number Diff line
@@ -447,6 +447,13 @@ static bool amdgpu_get_bios_apu(struct amdgpu_device *adev)
	return true;
}

static bool amdgpu_prefer_rom_resource(struct amdgpu_device *adev)
{
	struct resource *res = &adev->pdev->resource[PCI_ROM_RESOURCE];

	return (res->flags & IORESOURCE_ROM_SHADOW);
}

static bool amdgpu_get_bios_dgpu(struct amdgpu_device *adev)
{
	if (amdgpu_atrm_get_bios(adev)) {
@@ -465,6 +472,18 @@ static bool amdgpu_get_bios_dgpu(struct amdgpu_device *adev)
		goto success;
	}

	if (amdgpu_prefer_rom_resource(adev)) {
		if (amdgpu_read_bios(adev)) {
			dev_info(adev->dev, "Fetched VBIOS from ROM BAR\n");
			goto success;
		}

		if (amdgpu_read_platform_bios(adev)) {
			dev_info(adev->dev, "Fetched VBIOS from platform\n");
			goto success;
		}

	} else {
		if (amdgpu_read_platform_bios(adev)) {
			dev_info(adev->dev, "Fetched VBIOS from platform\n");
			goto success;
@@ -474,6 +493,7 @@ static bool amdgpu_get_bios_dgpu(struct amdgpu_device *adev)
			dev_info(adev->dev, "Fetched VBIOS from ROM BAR\n");
			goto success;
		}
	}

	if (amdgpu_read_bios_from_rom(adev)) {
		dev_info(adev->dev, "Fetched VBIOS from ROM\n");