diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2021-04-12 16:10:43 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2021-04-14 10:00:04 +0300 |
commit | 603dc7ed917f2f443f966370acf75e817965de97 (patch) | |
tree | a03e889a9d78255db4100b59f410a7ed17c15985 /drivers/gpu | |
parent | 6848c291a54f8cd1e8b32f4d6e0f681acc8d5095 (diff) | |
download | linux-603dc7ed917f2f443f966370acf75e817965de97.tar.xz |
drm/aperture: Inline fbdev conflict helpers into aperture helpers
Fbdev's helpers for handling conflicting framebuffer drivers are
related to framebuffer apertures, not console emulation. Therefore
remove them from drm_fb_helper.h and inline them into the aperture
helpers. No functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210412131043.5787-4-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_aperture.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_aperture.c b/drivers/gpu/drm/drm_aperture.c index 929dcbc0758a..e034dd7f9b09 100644 --- a/drivers/gpu/drm/drm_aperture.c +++ b/drivers/gpu/drm/drm_aperture.c @@ -1,7 +1,9 @@ // SPDX-License-Identifier: MIT +#include <linux/fb.h> +#include <linux/vgaarb.h> + #include <drm/drm_aperture.h> -#include <drm/drm_fb_helper.h> /** * DOC: overview @@ -78,6 +80,7 @@ int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_size_t size, bool primary, const char *name) { +#if IS_REACHABLE(CONFIG_FB) struct apertures_struct *a; int ret; @@ -88,10 +91,13 @@ int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_ a->ranges[0].base = base; a->ranges[0].size = size; - ret = drm_fb_helper_remove_conflicting_framebuffers(a, name, primary); + ret = remove_conflicting_framebuffers(a, name, primary); kfree(a); return ret; +#else + return 0; +#endif } EXPORT_SYMBOL(drm_aperture_remove_conflicting_framebuffers); @@ -109,6 +115,17 @@ EXPORT_SYMBOL(drm_aperture_remove_conflicting_framebuffers); */ int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev, const char *name) { - return drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, name); + int ret = 0; + + /* + * 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, name); +#endif + if (ret == 0) + ret = vga_remove_vgacon(pdev); + return ret; } EXPORT_SYMBOL(drm_aperture_remove_conflicting_pci_framebuffers); |