Unverified Commit 55bffc81 authored by Javier Martinez Canillas's avatar Javier Martinez Canillas
Browse files

fbdev: Split frame buffer support in FB and FB_CORE symbols



Currently the CONFIG_FB option has to be enabled even if no legacy fbdev
drivers are needed (e.g: only to have support for framebuffer consoles).

The DRM subsystem has a fbdev emulation layer, but depends on CONFIG_FB
and so it can only be enabled if that dependency is enabled as well.

That means fbdev drivers have to be explicitly disabled if users want to
enable CONFIG_FB, only to use fbcon and/or the DRM fbdev emulation layer.

This patch introduces a non-visible CONFIG_FB_CORE symbol that could be
enabled just to have core support needed for CONFIG_DRM_FBDEV_EMULATION,
allowing CONFIG_FB to be disabled (and automatically disabling all the
fbdev drivers).

Nothing from fb_backlight.o and fbmon.o is used by the DRM fbdev emulation
layer so these two objects can be compiled out when CONFIG_FB is disabled.

Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Tested-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarHelge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230719081544.741051-4-javierm@redhat.com
parent df791524
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -259,7 +259,7 @@ drivers-$(CONFIG_PCI) += arch/x86/pci/
# suspend and hibernation support
drivers-$(CONFIG_PM) += arch/x86/power/

drivers-$(CONFIG_FB) += arch/x86/video/
drivers-$(CONFIG_FB_CORE) += arch/x86/video/

####
# boot loader support. Several targets are kept for legacy purposes
+1 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_FB)               += fbdev.o
obj-$(CONFIG_FB_CORE)		+= fbdev.o
+3 −3
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ static const char *const backlight_scale_types[] = {
	[BACKLIGHT_SCALE_NON_LINEAR]	= "non-linear",
};

#if defined(CONFIG_FB) || (defined(CONFIG_FB_MODULE) && \
#if defined(CONFIG_FB_CORE) || (defined(CONFIG_FB_CORE_MODULE) && \
				defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE))
/*
 * fb_notifier_callback
@@ -155,7 +155,7 @@ static inline int backlight_register_fb(struct backlight_device *bd)
static inline void backlight_unregister_fb(struct backlight_device *bd)
{
}
#endif /* CONFIG_FB */
#endif /* CONFIG_FB_CORE */

static void backlight_generate_event(struct backlight_device *bd,
				     enum backlight_update_reason reason)
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ config DUMMY_CONSOLE_ROWS

config FRAMEBUFFER_CONSOLE
	bool "Framebuffer Console support"
	depends on FB && !UML
	depends on FB_CORE && !UML
	select VT_HW_CONSOLE_BINDING
	select CRC32
	select FONT_SUPPORT
+8 −2
Original line number Diff line number Diff line
@@ -4,9 +4,9 @@
#

menuconfig FB
	tristate "Support for frame buffer devices"
	tristate "Support for frame buffer device drivers"
	select FB_CORE
	select FB_NOTIFY
	select VIDEO_CMDLINE
	help
	  The frame buffer device provides an abstraction for the graphics
	  hardware. It represents the frame buffer of some video hardware and
@@ -30,6 +30,12 @@ menuconfig FB
	  <http://www.munted.org.uk/programming/Framebuffer-HOWTO-1.3.html> for more
	  information.

	  This enables support for native frame buffer device (fbdev) drivers.

	  The DRM subsystem provides support for emulated frame buffer devices
	  on top of KMS drivers, but this option allows legacy fbdev drivers to
	  be enabled as well.

	  Say Y here and to the driver for your graphics board below if you
	  are compiling a kernel for a non-x86 architecture.

Loading