Skip to contentSkip to conversation

PCI/VGA: Don't assume the only VGA device on a system is `boot_vga`

PATCH RESEND In review Mario Limonciello (AMD) 2 participants 2 messages Jan 6 PCI

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 PCI/VGA: Don't assume the only VGA device on a system is `boot_vga`

Some systems ship with multiple display class devices but not all of them are VGA devices. If the "only" VGA device on the system is not used for displaying the image on the screen marking it as boot_vga because nothing was found is totally wrong.

This behavior actually leads to mistakes of the wrong device being advertised to userspace and then userspace can make incorrect decisions.

As there is an accurate boot_display sysfs file stop lying about boot_vga by assuming if nothing is found it's the right device.

---
This was probably lost in the holiday shuffle, so resend it.
v2: https://lore.kernel.org/linux-pci/[email protected]/

 drivers/pci/vgaarb.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/pci/vgaarb.c +0 -7
index 436fa7f4c3873..baa242b140993 100644
@@ -652,13 +652,6 @@ static bool vga_is_boot_device(struct vga_device *vgadev)
 		return true;
 	}
 
-	/*
-	 * Vgadev has neither IO nor MEM enabled.  If we haven't found any
-	 * other VGA devices, it is the best candidate so far.
-	 */
-	if (!boot_vga)
-		return true;
-
 	return false;
 }
 
Signature · 1 line
2.43.0
#1 lore raw

Hi

Am 06.01.26 um 05:46 schrieb Mario Limonciello (AMD):

Quoted 18 lines

Some systems ship with multiple display class devices but not all of them are VGA devices. If the "only" VGA device on the system is not used for displaying the image on the screen marking it as boot_vga because nothing was found is totally wrong.

This behavior actually leads to mistakes of the wrong device being advertised to userspace and then userspace can make incorrect decisions.

As there is an accurate boot_display sysfs file stop lying about boot_vga by assuming if nothing is found it's the right device.

Quoted 2 lines

---
This was probably lost in the holiday shuffle, so resend it.

Merged now into drm-misc-fixes.

Best regards
Thomas

Quoted 22 lines

v2: https://lore.kernel.org/linux-pci/[email protected]/

  drivers/pci/vgaarb.c | 7 -------
  1 file changed, 7 deletions(-)
drivers/pci/vgaarb.c +0 -7
index 436fa7f4c3873..baa242b140993 100644
@@ -652,13 +652,6 @@ static bool vga_is_boot_device(struct vga_device *vgadev)
  		return true;
  	}
 
-	/*
-	 * Vgadev has neither IO nor MEM enabled.  If we haven't found any
-	 * other VGA devices, it is the best candidate so far.
-	 */
-	if (!boot_vga)
-		return true;
-
  	return false;
  }
 
Signature · 6 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)