diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-07-22 06:21:52 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-07-22 06:21:52 +0000 |
commit | 5495980ef63d2bf667ae81b3d59fddd0dcd7c22b (patch) | |
tree | c4b8754d744b30e7ba56244f18fc295bb70f978e /sys | |
parent | 6cc6e1f708ff127013d44791174273026959f5e7 (diff) |
drm/aperture: Run fbdev removal before internal helpers
From Thomas Zimmermann
31f351eb534e889d11cd149de547d99eb5a15c64 in linux 5.15.y/5.15.56
bf43e4521ff3223a613f3a496991a22a4d78e04b in mainline linux
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/drm_aperture.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sys/dev/pci/drm/drm_aperture.c b/sys/dev/pci/drm/drm_aperture.c index 547dc8ca401..1605635e78a 100644 --- a/sys/dev/pci/drm/drm_aperture.c +++ b/sys/dev/pci/drm/drm_aperture.c @@ -339,7 +339,20 @@ int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev, return 0; #ifdef notyet resource_size_t base, size; - int bar, ret = 0; + int bar, ret; + + /* + * WARNING: Apparently we must kick fbdev drivers before vgacon, + * otherwise the vga fbdev driver falls over. + */ +#if IS_REACHABLE(CONFIG_FB) + ret = remove_conflicting_pci_framebuffers(pdev, req_driver->name); + if (ret) + return ret; +#endif + ret = vga_remove_vgacon(pdev); + if (ret) + return ret; for (bar = 0; bar < PCI_STD_NUM_BARS; ++bar) { if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) @@ -349,16 +362,7 @@ int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev, drm_aperture_detach_drivers(base, size); } - /* - * WARNING: Apparently we must kick fbdev drivers before vgacon, - * otherwise the vga fbdev driver falls over. - */ -#if IS_REACHABLE(CONFIG_FB) - ret = remove_conflicting_pci_framebuffers(pdev, req_driver->name); -#endif - if (ret == 0) - ret = vga_remove_vgacon(pdev); - return ret; + return 0; #endif } EXPORT_SYMBOL(drm_aperture_remove_conflicting_pci_framebuffers); |