Commit fd390ff1 authored by Mario Limonciello (AMD)'s avatar Mario Limonciello (AMD) Committed by Thomas Zimmermann
Browse files

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.

Reported-by: default avatarAaron Erhardt <aer@tuxedocomputers.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220712


Tested-by: default avatarAaron Erhardt <aer@tuxedocomputers.com>
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Fixes: ad90860b ("fbcon: Use screen info to find primary device")
Tested-by: default avatarLuke D. Jones <luke@ljones.dev>
Signed-off-by: default avatarMario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260106044638.52906-1-superm1@kernel.org
parent e8b3627b
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -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;
}