From: Lijo Lazar <[email protected]> [ Upstream commit 9e32d17592950478baffaecdbda8e2e60935fd3d ]
Fetching from platform ROM doesn't work with hybrid ROM images. For default VGA devices also prefer ROM BAR. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Sasha Levin <[email protected]> --- LLM Generated explanations, may be completely bogus: The background `git log -S` search finished, but this stable tree’s shallow history isn’t useful here — it only surfaced baseline import commits (`19eef1d98eeda`, `ac3fd01e4c1ef`), not the real introduction. The function was added upstream in `27145f78f56a` (“drm/amdgpu: Prefer shadow rom when available”, March 2025), and that code is already present in v6.18.43. This patch is a small follow-up for default VGA devices with hybrid ROM images. **Verdict: YES** — backport to this tree. drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c index 4e60753e16e90..dec312b0f3b0a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c @@ -33,6 +33,7 @@ #include <linux/pci.h> #include <linux/slab.h> #include <linux/acpi.h> +#include <linux/vgaarb.h> /* * BIOS. */ @@ -491,7 +492,8 @@ 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); + return (res->flags & IORESOURCE_ROM_SHADOW) || + adev->pdev == vga_default_device(); } static bool amdgpu_get_bios_dgpu(struct amdgpu_device *adev) -- 2.53.0
