]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: Prefer ROM BAR for default VGA device
authorLijo Lazar <lijo.lazar@amd.com>
Wed, 29 Apr 2026 10:04:57 +0000 (15:34 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 May 2026 13:56:51 +0000 (09:56 -0400)
Fetching from platform ROM doesn't work with hybrid ROM images. For
default VGA devices also prefer ROM BAR.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c

index 35d04e69aec0976849b12c475caad18567aea655..aa039e148a5ee795fa5635b6c684691c64a5e80c 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
+#include <linux/vgaarb.h>
 /*
  * BIOS.
  */
@@ -467,7 +468,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)