Skip to contentSkip to conversation

drm/amdgpu: Prefer ROM BAR for default VGA device

PATCH In review Lijo Lazar 2 participants 2 messages Apr 29

Subsystems (2)
lore
Share & tools
lore

Lijo Lazar

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Prefer ROM BAR for default VGA device

Fetching from platform ROM doesn't work with hybrid ROM images. For default VGA devices also prefer ROM BAR.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c +3 -1
index 35d04e69aec0..aa039e148a5e 100644
@@ -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)
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw

AMD General

Regards,
Hawking
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Wednesday, April 29, 2026 6:11 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Li, Candice <[email protected]>
Subject: [PATCH] drm/amdgpu: Prefer ROM BAR for default VGA device

Fetching from platform ROM doesn't work with hybrid ROM images. For default VGA devices also prefer ROM BAR.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c +3 -2
index 35d04e69aec0..aa039e148a5e 100644
@@ -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)
--

2.49.0