From a81c232edd3c2dad22ce53581a13624a41f695a4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 1 Nov 2023 14:36:04 +0000 Subject: [PATCH] Revert "video/aperture: Move vga handling to pci function" This reverts commit 28916927b7626ed3c44d902eafbf9d00691266e1 which is commit f1d599d315fb7b7343cddaf365e671aaa8453aca upstream. It breaks the Android ABI and can be brought back later in an abi-safe way if needed. Bug: 161946584 Change-Id: Iffad2c2b492da2aa7b87dba8d9bd792be74b3b58 Signed-off-by: Greg Kroah-Hartman --- drivers/video/aperture.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c index 3e4a1f55f51b..7ea18086e659 100644 --- a/drivers/video/aperture.c +++ b/drivers/video/aperture.c @@ -298,6 +298,14 @@ int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t si aperture_detach_devices(base, size); + /* + * If this is the primary adapter, there could be a VGA device + * that consumes the VGA framebuffer I/O range. Remove this device + * as well. + */ + if (primary) + aperture_detach_devices(VGA_FB_PHYS_BASE, VGA_FB_PHYS_SIZE); + return 0; } EXPORT_SYMBOL(aperture_remove_conflicting_devices); @@ -337,13 +345,6 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na } if (primary) { - /* - * If this is the primary adapter, there could be a VGA device - * that consumes the VGA framebuffer I/O range. Remove this - * device as well. - */ - aperture_detach_devices(VGA_FB_PHYS_BASE, VGA_FB_PHYS_SIZE); - /* * WARNING: Apparently we must kick fbdev drivers before vgacon, * otherwise the vga fbdev driver falls over.