Skip to contentSkip to conversation

Allow disabling all native fbdev drivers and only keeping DRM emulation

PATCH Applied Javier Martinez Canillas 3 participants 14 messages Jul 19, 2023 – Jul 22, 2023

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v6 cover Allow disabling all native fbdev drivers and only keeping DRM emulation

This patch series splits the fbdev core support in two different Kconfig
symbols: FB and FB_CORE. The motivation for this is to allow CONFIG_FB to be disabled, while still having the the core fbdev support needed for the CONFIG_DRM_FBDEV_EMULATION to be enabled. The motivation is automatically disabling all fbdev drivers instead of having to be disabled individually.

The reason for doing this is that now with simpledrm, there's no need for the legacy fbdev (e.g: efifb or vesafb) drivers anymore and many distros now disable them. But it would simplify the config a lot fo have a single Kconfig symbol to disable all fbdev drivers.

I've built tested with possible combinations of CONFIG_FB, CONFIG_FB_CORE, CONFIG_DRM_FBDEV_EMULATION and CONFIG_FB_DEVICE symbols set to 'y' or 'n'.

Patch #1 moves the auxdisplay drivers to "Graphics support" Kconfig menu, patch #2 moves the core fbdev Kconfig symbols to a separate Kconfig file, patch #3 does the FB symbol split and introduces the FB_CORE symbol and finally patch #4 makes the DRM symbol to select FB_CORE if the DRM fbdev emualtion support was enabled.

Since this series touches three subsystems (auxdisplay, fbdev and DRM), I would like to merge it through DRM with the acks of these maintainers.

This is a v6 of the patch-set that addresses issues pointed out by Arnd Bergmann in the previous v5:

https://lists.freedesktop.org/archives/dri-devel/2023-July/413943.html

Changes in v6:
- Don't move FB_{HECUBA,SVGALIB,MACMODES} to config/Kcore (Arnd Bergmann).
- Fix link error when CONFIG_FB_CORE=y and CONFIG_FB=m (Arnd Bergmann).

Changes in v5:
- Take the auxdisplay/Kconfig source out of "if HAS_IOMEM" (Geert Uytterhoeven).
- Fix ifdef guard check in drivers/video/backlight/backlight.c (Arnd Bergmann).

Changes in v4:
- Fix menuconfig hierarchy that was broken in v3 (Arnd Bergmann).

Changes in v3:
- Really make a hidden symbol by removing the prompt (Arnd Bergmann).
- Change FB_CORE to config instead of menuconfig (Arnd Bergmann).
- Keep "depends on FB" for FIRMWARE_EDID (Arnd Bergmann).
- Compile out fb_backlight.o and fbmon.o that are only needed for FB (Arnd Bergmann).
- Make FB_DEVICE to depend on FB_CORE instead of selecting it.
- Make the DRM symbol to select FB_CORE if DRM_FBDEV_EMULATION is enabled (Arnd Bergmann).
- Also make DRM select FB_SYS_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
- Make DRM_FBDEV_EMULATION to depend on DRM instead of DRM_KMS_HELPER.

Changes in v2:
- Keep "depends on FB" for FB_DDC, FB_HECUBA, FB_SVGALIB, FB_MACMODES, FB_BACKLIGHT, FB_MODE_HELPERS and FB_TILEBLITTING (Arnd Bergmann).
- Don't change the fb.o object name (Arnd Bergmann).
- Make FB_CORE a non-visible Kconfig symbol instead (Thomas Zimmermann).
- Make CONFIG_DRM_FBDEV_EMULATION to select FB_CORE (Thomas Zimmermann).

Javier Martinez Canillas (4):
video: Add auxiliary display drivers to Graphics support menu
fbdev: Move core fbdev symbols to a separate Kconfig file
fbdev: Split frame buffer support in FB and FB_CORE symbols
drm: Make FB_CORE to be selected if DRM fbdev emulation is enabled

 arch/x86/Makefile                   |   2 +-
 arch/x86/video/Makefile             |   2 +-
 drivers/Kconfig                     |   2 -
 drivers/gpu/drm/Kconfig             |   7 +-
 drivers/video/Kconfig               |   2 +
 drivers/video/backlight/backlight.c |   6 +-
 drivers/video/console/Kconfig       |   2 +-
 drivers/video/fbdev/Kconfig         | 197 ++--------------------------
 drivers/video/fbdev/core/Kconfig    | 190 +++++++++++++++++++++++++++
 drivers/video/fbdev/core/Makefile   |  10 +-
 10 files changed, 218 insertions(+), 202 deletions(-)
 create mode 100644 drivers/video/fbdev/core/Kconfig
Signature · 1 line
2.41.0
#1 lore raw

PATCH v6 1/4 video: Add auxiliary display drivers to Graphics support menu

The drivers in this subsystem are for character-based LCD displays, which can fall into the same category of the DRM/KMS and fbdev drivers that are located under the "Graphics support" menu. Add auxdisplay there as well.

---

(no changes since v5)

Changes in v5:
- Take the auxdisplay/Kconfig source out of "if HAS_IOMEM" (Geert Uytterhoeven).

 drivers/Kconfig       | 2 --
 drivers/video/Kconfig | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/Kconfig +0 -2
index 514ae6b24cb2..496ca02ee18f 100644
@@ -129,8 +129,6 @@ source "drivers/dma-buf/Kconfig"
 
 source "drivers/dca/Kconfig"
 
-source "drivers/auxdisplay/Kconfig"
-
 source "drivers/uio/Kconfig"
 
 source "drivers/vfio/Kconfig"
drivers/video/Kconfig +2 -0
index 8b2b9ac37c3d..e5b1cc54cafa 100644
@@ -25,6 +25,8 @@ config VIDEO_NOMODESET
 	bool
 	default n
 
+source "drivers/auxdisplay/Kconfig"
+
 if HAS_IOMEM
 
 config HAVE_FB_ATMEL
Signature · 1 line
2.41.0
#2 lore raw

Re: [PATCH v6 1/4] video: Add auxiliary display drivers to Graphics support menu

Javier Martinez Canillas <[email protected]> writes:

[adding Miguel Ojeda who was not in the Cc list]

Hello Miguel, could you please ack this patch so that I can take the whole patch-set through the drm-misc tree?

Quoted 48 lines

The drivers in this subsystem are for character-based LCD displays, which can fall into the same category of the DRM/KMS and fbdev drivers that are located under the "Graphics support" menu. Add auxdisplay there as well.

---

(no changes since v5)

Changes in v5:
- Take the auxdisplay/Kconfig source out of "if HAS_IOMEM" (Geert Uytterhoeven).

 drivers/Kconfig       | 2 --
 drivers/video/Kconfig | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/Kconfig +0 -2
index 514ae6b24cb2..496ca02ee18f 100644
@@ -129,8 +129,6 @@ source "drivers/dma-buf/Kconfig"
 
 source "drivers/dca/Kconfig"
 
-source "drivers/auxdisplay/Kconfig"
-
 source "drivers/uio/Kconfig"
 
 source "drivers/vfio/Kconfig"
drivers/video/Kconfig +2 -0
index 8b2b9ac37c3d..e5b1cc54cafa 100644
@@ -25,6 +25,8 @@ config VIDEO_NOMODESET
 	bool
 	default n
 
+source "drivers/auxdisplay/Kconfig"
+
 if HAS_IOMEM
 
 config HAVE_FB_ATMEL
Signature · 1 line
2.41.0
Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
Acked-by
#3 lore raw

Re: [PATCH v6 1/4] video: Add auxiliary display drivers to Graphics support menu

Quoted 7 lines · Javier Martinez Canillas

Javier Martinez Canillas <[email protected]> writes:

[adding Miguel Ojeda who was not in the Cc list]

Hello Miguel, could you please ack this patch so that I can take the whole patch-set through the drm-misc tree?

A note below...

Quoted 3 lines
Quoted 3 lines

The drivers in this subsystem are for character-based LCD displays, which can fall into the same category of the DRM/KMS and fbdev drivers that are located under the "Graphics support" menu. Add auxdisplay there as well.

Nit: this is not exactly true, e.g. ks0108/cfag12864b (which were the first in the subsystem) were not character-based but a very simple black-or-white 128x64 grid, so we should probably reword slightly this.

In any case, if Helge thinks these may belong in the "Graphics support" menu, then I am fine with it:

Thanks!

Cheers,
Miguel

#4 lore raw

Re: [PATCH v6 1/4] video: Add auxiliary display drivers to Graphics support menu

Miguel Ojeda <[email protected]> writes:

Hello Miguel,

Quoted 12 lines
Quoted 7 lines · Javier Martinez Canillas

Javier Martinez Canillas <[email protected]> writes:

[adding Miguel Ojeda who was not in the Cc list]

Hello Miguel, could you please ack this patch so that I can take the whole patch-set through the drm-misc tree?

A note below...

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines

The drivers in this subsystem are for character-based LCD displays, which can fall into the same category of the DRM/KMS and fbdev drivers that are located under the "Graphics support" menu. Add auxdisplay there as well.

Nit: this is not exactly true, e.g. ks0108/cfag12864b (which were the first in the subsystem) were not character-based but a very simple black-or-white 128x64 grid, so we should probably reword slightly this.

Oh, interesting. I wonder why that couldn't had been a fbdev driver then using FB_VISUAL_MONO01? I'll reword then the commit message before apply to the following instead:

"The drivers in this subsystem are for either character-based or monochrome LCD controllers, which can fall into the same category of the DRM/KMS and fbdev drivers, that are located under the "Graphics support" menu.

Add the auxdisplay drivers there as well to have all display drivers under the same menu."

Quoted 5 lines

In any case, if Helge thinks these may belong in the "Graphics support" menu, then I am fine with it:

Perfect, thanks!

Quoted 5 lines

Thanks!

Cheers,
Miguel

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#5 lore raw

Re: [PATCH v6 1/4] video: Add auxiliary display drivers to Graphics support menu

Quoted 4 lines · Javier Martinez Canillas

Oh, interesting. I wonder why that couldn't had been a fbdev driver then using FB_VISUAL_MONO01? I'll reword then the commit message before apply to the following instead:

It is :)

.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_MONO10,

The original distinction was more about having a place where to put small, simple displays that were not your usual "screen", where you would typically draw a custom UI, probably controlled with a few custom buttons, etc.

Quoted 1 line

Perfect, thanks!

My pleasure!

Cheers,
Miguel

#6 lore raw

Re: [PATCH v6 1/4] video: Add auxiliary display drivers to Graphics support menu

Quoted 12 lines · Miguel Ojeda
Quoted 4 lines · Javier Martinez Canillas

Oh, interesting. I wonder why that couldn't had been a fbdev driver then using FB_VISUAL_MONO01? I'll reword then the commit message before apply to the following instead:

It is :)

.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_MONO10,

Ah! Should had read the driver before commenting then :)

Quoted 5 lines

The original distinction was more about having a place where to put small, simple displays that were not your usual "screen", where you would typically draw a custom UI, probably controlled with a few custom buttons, etc.

Got it. Then that's yet another argument for adding the auxdisplay drivers under the same "Graphics support" menu.

Quoted 7 lines
Quoted 1 line

Perfect, thanks!

My pleasure!

Cheers,
Miguel

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#7 lore raw

Re: [PATCH v6 1/4] video: Add auxiliary display drivers to Graphics support menu

Quoted 3 lines · Javier Martinez Canillas

Got it. Then that's yet another argument for adding the auxdisplay drivers under the same "Graphics support" menu.

Just in case it matters for Helge/you: these may also register an input device, e.g. the ht16k33 has a matrix keypad.

Cheers,
Miguel

#8 lore raw

PATCH v6 2/4 fbdev: Move core fbdev symbols to a separate Kconfig file

In reply to Javier Martinez Canillas

The drivers/video/fbdev/Kconfig defines both symbols for fbdev drivers and core fbdev symbols, that can be enabled independently of the fbdev drivers.

Split the Kconfig in two, one that only has the symbols for fbdev drivers and another one that contains the fbdev core symbols.

---

Changes in v6:
- Don't move FB_{HECUBA,SVGALIB,MACMODES} to config/Kcore (Arnd Bergmann).

 drivers/video/fbdev/Kconfig      | 187 +------------------------------
 drivers/video/fbdev/core/Kconfig | 186 ++++++++++++++++++++++++++++++
 2 files changed, 188 insertions(+), 185 deletions(-)
 create mode 100644 drivers/video/fbdev/core/Kconfig
drivers/video/fbdev/Kconfig +2 -185
index c12c166be7d1..ed881d5b3ee0 100644
@@ -3,9 +3,6 @@
 # fbdev configuration
 #
 
-config FB_NOTIFY
-	bool
-
 menuconfig FB
 	tristate "Support for frame buffer devices"
 	select FB_NOTIFY
@@ -42,153 +39,6 @@ menuconfig FB
 	  (e.g. an accelerated X server) and that are not frame buffer
 	  device-aware may cause unexpected results. If unsure, say N.
 
-config FIRMWARE_EDID
-	bool "Enable firmware EDID"
-	depends on FB
-	help
-	  This enables access to the EDID transferred from the firmware.
-	  On the i386, this is from the Video BIOS. Enable this if DDC/I2C
-	  transfers do not work for your driver and if you are using
-	  nvidiafb, i810fb or savagefb.
-
-	  In general, choosing Y for this option is safe.  If you
-	  experience extremely long delays while booting before you get
-	  something on your display, try setting this to N.  Matrox cards in
-	  combination with certain motherboards and monitors are known to
-	  suffer from this problem.
-
-config FB_DEVICE
-	bool "Provide legacy /dev/fb* device"
-	depends on FB
-	default y
-	help
-	  Say Y here if you want the legacy /dev/fb* device file and
-	  interfaces within sysfs anc procfs. It is only required if you
-	  have userspace programs that depend on fbdev for graphics output.
-	  This does not affect the framebuffer console. If unsure, say N.
-
-config FB_DDC
-	tristate
-	depends on FB
-	select I2C_ALGOBIT
-	select I2C
-
-config FB_CFB_FILLRECT
-	tristate
-	depends on FB
-	help
-	  Include the cfb_fillrect function for generic software rectangle
-	  filling. This is used by drivers that don't provide their own
-	  (accelerated) version.
-
-config FB_CFB_COPYAREA
-	tristate
-	depends on FB
-	help
-	  Include the cfb_copyarea function for generic software area copying.
-	  This is used by drivers that don't provide their own (accelerated)
-	  version.
-
-config FB_CFB_IMAGEBLIT
-	tristate
-	depends on FB
-	help
-	  Include the cfb_imageblit function for generic software image
-	  blitting. This is used by drivers that don't provide their own
-	  (accelerated) version.
-
-config FB_CFB_REV_PIXELS_IN_BYTE
-	bool
-	depends on FB
-	help
-	  Allow generic frame-buffer functions to work on displays with 1, 2
-	  and 4 bits per pixel depths which has opposite order of pixels in
-	  byte order to bytes in long order.
-
-config FB_SYS_FILLRECT
-	tristate
-	depends on FB
-	help
-	  Include the sys_fillrect function for generic software rectangle
-	  filling. This is used by drivers that don't provide their own
-	  (accelerated) version and the framebuffer is in system RAM.
-
-config FB_SYS_COPYAREA
-	tristate
-	depends on FB
-	help
-	  Include the sys_copyarea function for generic software area copying.
-	  This is used by drivers that don't provide their own (accelerated)
-	  version and the framebuffer is in system RAM.
-
-config FB_SYS_IMAGEBLIT
-	tristate
-	depends on FB
-	help
-	  Include the sys_imageblit function for generic software image
-	  blitting. This is used by drivers that don't provide their own
-	  (accelerated) version and the framebuffer is in system RAM.
-
-config FB_PROVIDE_GET_FB_UNMAPPED_AREA
-	bool
-	depends on FB
-	help
-	  Allow generic frame-buffer to provide get_fb_unmapped_area
-	  function to provide shareable character device support on nommu.
-
-menuconfig FB_FOREIGN_ENDIAN
-	bool "Framebuffer foreign endianness support"
-	depends on FB
-	help
-	  This menu will let you enable support for the framebuffers with
-	  non-native endianness (e.g. Little-Endian framebuffer on a
-	  Big-Endian machine). Most probably you don't have such hardware,
-	  so it's safe to say "n" here.
-
-choice
-	prompt "Choice endianness support"
-	depends on FB_FOREIGN_ENDIAN
-
-config FB_BOTH_ENDIAN
-	bool "Support for Big- and Little-Endian framebuffers"
-
-config FB_BIG_ENDIAN
-	bool "Support for Big-Endian framebuffers only"
-
-config FB_LITTLE_ENDIAN
-	bool "Support for Little-Endian framebuffers only"
-
-endchoice
-
-config FB_SYS_FOPS
-	tristate
-	depends on FB
-
-config FB_DEFERRED_IO
-	bool
-	depends on FB
-
-config FB_IO_HELPERS
-	bool
-	depends on FB
-	select FB_CFB_COPYAREA
-	select FB_CFB_FILLRECT
-	select FB_CFB_IMAGEBLIT
-
-config FB_SYS_HELPERS
-	bool
-	depends on FB
-	select FB_SYS_COPYAREA
-	select FB_SYS_FILLRECT
-	select FB_SYS_FOPS
-	select FB_SYS_IMAGEBLIT
-
-config FB_SYS_HELPERS_DEFERRED
-	bool
-	depends on FB
-	select FB_DEFERRED_IO
-	select FB_SYS_HELPERS
-
 config FB_HECUBA
 	tristate
 	depends on FB
@@ -205,41 +55,6 @@ config FB_MACMODES
 	tristate
 	depends on FB
 
-config FB_BACKLIGHT
-	tristate
-	depends on FB
-	select BACKLIGHT_CLASS_DEVICE
-
-config FB_MODE_HELPERS
-	bool "Enable Video Mode Handling Helpers"
-	depends on FB
-	help
-	  This enables functions for handling video modes using the
-	  Generalized Timing Formula and the EDID parser. A few drivers rely
-	  on this feature such as the radeonfb, rivafb, and the i810fb. If
-	  your driver does not take advantage of this feature, choosing Y will
-	  just increase the kernel size by about 5K.
-
-config FB_TILEBLITTING
-	bool "Enable Tile Blitting Support"
-	depends on FB
-	help
-	  This enables tile blitting.  Tile blitting is a drawing technique
-	  where the screen is divided into rectangular sections (tiles), whereas
-	  the standard blitting divides the screen into pixels. Because the
-	  default drawing element is a tile, drawing functions will be passed
-	  parameters in terms of number of tiles instead of number of pixels.
-	  For example, to draw a single character, instead of using bitmaps,
-	  an index to an array of bitmaps will be used.  To clear or move a
-	  rectangular section of a screen, the rectangle will be described in
-	  terms of number of tiles in the x- and y-axis.
-
-	  This is particularly important to one driver, matroxfb.  If
-	  unsure, say N.
-
-comment "Frame buffer hardware drivers"
-	depends on FB
-
 config FB_GRVGA
 	tristate "Aeroflex Gaisler framebuffer support"
 	depends on FB && SPARC
@@ -2223,3 +2038,5 @@ config FB_SM712
 source "drivers/video/fbdev/omap/Kconfig"
 source "drivers/video/fbdev/omap2/Kconfig"
 source "drivers/video/fbdev/mmp/Kconfig"
+
+source "drivers/video/fbdev/core/Kconfig"
drivers/video/fbdev/core/Kconfig new file +186 -0

186 lines not on this page · raw message

Signature · 1 line
2.41.0
#9 lore raw

PATCH v6 3/4 fbdev: Split frame buffer support in FB and FB_CORE symbols

In reply to Javier Martinez Canillas

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.

---

Changes in v6:
- Fix link error when CONFIG_FB_CORE=y and CONFIG_FB=m (Arnd Bergmann).

Changes in v5:
- Fix ifdef guard check in drivers/video/backlight/backlight.c (Arnd Bergmann).

Changes in v4:
- Fix menuconfig hierarchy that was broken in v3 (Arnd Bergmann).

Changes in v3:
- Really make a hidden symbol by removing the prompt (Arnd Bergmann).
- Change FB_CORE to config instead of menuconfig (Arnd Bergmann).
- Keep "depends on FB" for FIRMWARE_EDID (Arnd Bergmann).
- Compile out fb_backlight.o and fbmon.o that are only needed for FB (Arnd Bergmann).
- Make FB_DEVICE to depend on FB_CORE instead of selecting it.

Changes in v2:
- Keep "depends on FB" for FB_DDC, FB_HECUBA, FB_SVGALIB, FB_MACMODES, FB_BACKLIGHT, FB_MODE_HELPERS and FB_TILEBLITTING (Arnd Bergmann).
- Don't change the fb.o object name (Arnd Bergmann).
- Make FB_CORE a non-visible Kconfig symbol instead (Thomas Zimmermann).

 arch/x86/Makefile                   |  2 +-
 arch/x86/video/Makefile             |  2 +-
 drivers/video/backlight/backlight.c |  6 +++---
 drivers/video/console/Kconfig       |  2 +-
 drivers/video/fbdev/Kconfig         | 10 ++++++++--
 drivers/video/fbdev/core/Kconfig    | 30 ++++++++++++++++-------------
 drivers/video/fbdev/core/Makefile   | 10 ++++++----
 7 files changed, 37 insertions(+), 25 deletions(-)
arch/x86/Makefile +1 -1
index b39975977c03..89a02e69be5f 100644
@@ -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
arch/x86/video/Makefile +1 -1
index 11640c116115..5ebe48752ffc 100644
@@ -1,2 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_FB)               += fbdev.o
+obj-$(CONFIG_FB_CORE)		+= fbdev.o
drivers/video/backlight/backlight.c +3 -3
index 9a885d398c22..86e1cdc8e369 100644
@@ -79,8 +79,8 @@ static const char *const backlight_scale_types[] = {
 	[BACKLIGHT_SCALE_NON_LINEAR]	= "non-linear",
 };
 
-#if defined(CONFIG_FB) || (defined(CONFIG_FB_MODULE) && \
-			   defined(CONFIG_BACKLIGHT_CLASS_DEVICE_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)
drivers/video/console/Kconfig +1 -1
index a2a88d42edf0..1b5a319971ed 100644
@@ -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
drivers/video/fbdev/Kconfig +8 -2
index ed881d5b3ee0..c0b0419e98b6 100644
@@ -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.
 
drivers/video/fbdev/core/Kconfig +17 -13
index fd3b7f5b4b7a..528e4dd2199c 100644
@@ -3,6 +3,10 @@
 # fbdev core configuration
 #
 
+config FB_CORE
+	select VIDEO_CMDLINE
+	tristate
+
 config FB_NOTIFY
 	bool
 
@@ -23,7 +27,7 @@ config FIRMWARE_EDID
 
 config FB_DEVICE
 	bool "Provide legacy /dev/fb* device"
-	depends on FB
+	depends on FB_CORE
 	default y
 	help
 	  Say Y here if you want the legacy /dev/fb* device file and
@@ -39,7 +43,7 @@ config FB_DDC
 
 config FB_CFB_FILLRECT
 	tristate
-	depends on FB
+	depends on FB_CORE
 	help
 	  Include the cfb_fillrect function for generic software rectangle
 	  filling. This is used by drivers that don't provide their own
@@ -47,7 +51,7 @@ config FB_CFB_FILLRECT
 
 config FB_CFB_COPYAREA
 	tristate
-	depends on FB
+	depends on FB_CORE
 	help
 	  Include the cfb_copyarea function for generic software area copying.
 	  This is used by drivers that don't provide their own (accelerated)
@@ -55,7 +59,7 @@ config FB_CFB_COPYAREA
 
 config FB_CFB_IMAGEBLIT
 	tristate
-	depends on FB
+	depends on FB_CORE
 	help
 	  Include the cfb_imageblit function for generic software image
 	  blitting. This is used by drivers that don't provide their own
@@ -63,7 +67,7 @@ config FB_CFB_IMAGEBLIT
 
 config FB_CFB_REV_PIXELS_IN_BYTE
 	bool
-	depends on FB
+	depends on FB_CORE
 	help
 	  Allow generic frame-buffer functions to work on displays with 1, 2
 	  and 4 bits per pixel depths which has opposite order of pixels in
@@ -71,7 +75,7 @@ config FB_CFB_REV_PIXELS_IN_BYTE
 
 config FB_SYS_FILLRECT
 	tristate
-	depends on FB
+	depends on FB_CORE
 	help
 	  Include the sys_fillrect function for generic software rectangle
 	  filling. This is used by drivers that don't provide their own
@@ -79,7 +83,7 @@ config FB_SYS_FILLRECT
 
 config FB_SYS_COPYAREA
 	tristate
-	depends on FB
+	depends on FB_CORE
 	help
 	  Include the sys_copyarea function for generic software area copying.
 	  This is used by drivers that don't provide their own (accelerated)
@@ -87,7 +91,7 @@ config FB_SYS_COPYAREA
 
 config FB_SYS_IMAGEBLIT
 	tristate
-	depends on FB
+	depends on FB_CORE
 	help
 	  Include the sys_imageblit function for generic software image
 	  blitting. This is used by drivers that don't provide their own
@@ -126,22 +130,22 @@ endchoice
 
 config FB_SYS_FOPS
 	tristate
-	depends on FB
+	depends on FB_CORE
 
 config FB_DEFERRED_IO
 	bool
-	depends on FB
+	depends on FB_CORE
 
 config FB_IO_HELPERS
 	bool
-	depends on FB
+	depends on FB_CORE
 	select FB_CFB_COPYAREA
 	select FB_CFB_FILLRECT
 	select FB_CFB_IMAGEBLIT
 
 config FB_SYS_HELPERS
 	bool
-	depends on FB
+	depends on FB_CORE
 	select FB_SYS_COPYAREA
 	select FB_SYS_FILLRECT
 	select FB_SYS_FOPS
@@ -149,7 +153,7 @@ config FB_SYS_HELPERS
 
 config FB_SYS_HELPERS_DEFERRED
 	bool
-	depends on FB
+	depends on FB_CORE
 	select FB_DEFERRED_IO
 	select FB_SYS_HELPERS
 
drivers/video/fbdev/core/Makefile +6 -4
index 9150bafd9e89..edfde2948e5c 100644
@@ -1,10 +1,12 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_FB_NOTIFY)           += fb_notify.o
-obj-$(CONFIG_FB)                  += fb.o
-fb-y                              := fb_backlight.o \
-                                     fb_info.o \
-                                     fbmem.o fbmon.o fbcmap.o \
+obj-$(CONFIG_FB_CORE)             += fb.o
+fb-y                              := fb_info.o \
+                                     fbmem.o fbcmap.o \
                                      modedb.o fbcvt.o fb_cmdline.o fb_io_fops.o
+ifdef CONFIG_FB
+fb-y                              += fb_backlight.o fbmon.o
+endif
 fb-$(CONFIG_FB_DEFERRED_IO)       += fb_defio.o
 fb-$(CONFIG_FB_DEVICE)            += fb_chrdev.o \
                                      fb_procfs.o \
Signature · 1 line
2.41.0
#10 lore raw

PATCH v6 4/4 drm: Make FB_CORE to be selected if DRM fbdev emulation is enabled

In reply to Javier Martinez Canillas

Now that fbdev core has been split in FB_CORE and FB, make the DRM symbol to select the FB_CORE option if the DRM fbdev emulation layer is enabled.

This allows to disable the CONFIG_FB option if is not needed, which will avoid the need to explicitly disable each of the legacy fbdev drivers.

---

(no changes since v3)

Changes in v3:
- Make the DRM symbol to select FB_CORE if DRM_FBDEV_EMULATION is enabled (Arnd Bergmann).
- Also make DRM select FB_SYS_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
- Make DRM_FBDEV_EMULATION to depend on DRM instead of DRM_KMS_HELPER.

Changes in v2:
- Make CONFIG_DRM_FBDEV_EMULATION to select FB_CORE (Thomas Zimmermann).

 drivers/gpu/drm/Kconfig | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/Kconfig +4 -3
index 22c1ba9ea28c..4f209e5c958c 100644
@@ -9,6 +9,9 @@ menuconfig DRM
 	tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)"
 	depends on (AGP || AGP=n) && !EMULATED_CMPXCHG && HAS_DMA
 	select DRM_PANEL_ORIENTATION_QUIRKS
+	select DRM_KMS_HELPER if DRM_FBDEV_EMULATION
+	select FB_CORE if DRM_FBDEV_EMULATION
+	select FB_SYS_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
 	select HDMI
 	select I2C
 	select DMA_SHARED_BUFFER
@@ -96,7 +99,6 @@ config DRM_KUNIT_TEST
 config DRM_KMS_HELPER
 	tristate
 	depends on DRM
-	select FB_SYS_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
 	help
 	  CRTC helpers for KMS drivers.
 
@@ -132,8 +134,7 @@ config DRM_DEBUG_MODESET_LOCK
 
 config DRM_FBDEV_EMULATION
 	bool "Enable legacy fbdev support for your modesetting driver"
-	depends on DRM_KMS_HELPER
-	depends on FB=y || FB=DRM_KMS_HELPER
+	depends on DRM
 	select FRAMEBUFFER_CONSOLE if !EXPERT
 	select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
 	default y
Signature · 1 line
2.41.0
maintainer Acked-by on the v6 series
#11 lore raw
In reply to Javier Martinez Canillas

Hi Javier,

Quoted 3 lines · Javier Martinez Canillas

This patch series splits the fbdev core support in two different Kconfig
symbols: FB and FB_CORE. The motivation for this is to allow CONFIG_FB to be disabled, while still having the the core fbdev support needed for the

One "the" too much.
(correcting just because this is a cover letter)

Quoted 7 lines

CONFIG_DRM_FBDEV_EMULATION to be enabled. The motivation is automatically disabling all fbdev drivers instead of having to be disabled individually.

The reason for doing this is that now with simpledrm, there's no need for the legacy fbdev (e.g: efifb or vesafb) drivers anymore and many distros now disable them. > But it would simplify the config a lot fo have a single Kconfig symbol to disable all fbdev drivers.

I suggest to rephrase this, e.g.:
The reason for doing this is that with simpledrm, mainstream Linux distributions like Fedora, SUSE or Ubuntu can then more easily enable the DRM drivers only by switching off legacy fbdev drivers with one Kconfig option (e.g. for efifb or vesafb).

(note: there are quite many other distributions, e.g. debian and the derivates, which still need the fbdev drivers for the various other architectures)

Quoted 11 lines

I've built tested with possible combinations of CONFIG_FB, CONFIG_FB_CORE, CONFIG_DRM_FBDEV_EMULATION and CONFIG_FB_DEVICE symbols set to 'y' or 'n'.

Patch #1 moves the auxdisplay drivers to "Graphics support" Kconfig menu, patch #2 moves the core fbdev Kconfig symbols to a separate Kconfig file, patch #3 does the FB symbol split and introduces the FB_CORE symbol and finally patch #4 makes the DRM symbol to select FB_CORE if the DRM fbdev emualtion support was enabled.

Since this series touches three subsystems (auxdisplay, fbdev and DRM), I would like to merge it through DRM with the acks of these maintainers.

Sure. Ack from me.

The patch series look good otherwise. You may add:

Quoted 54 lines

This is a v6 of the patch-set that addresses issues pointed out by Arnd Bergmann in the previous v5:

https://lists.freedesktop.org/archives/dri-devel/2023-July/413943.html

Changes in v6:
- Don't move FB_{HECUBA,SVGALIB,MACMODES} to config/Kcore (Arnd Bergmann).
- Fix link error when CONFIG_FB_CORE=y and CONFIG_FB=m (Arnd Bergmann).

Changes in v5:
- Take the auxdisplay/Kconfig source out of "if HAS_IOMEM" (Geert Uytterhoeven).
- Fix ifdef guard check in drivers/video/backlight/backlight.c (Arnd Bergmann).

Changes in v4:
- Fix menuconfig hierarchy that was broken in v3 (Arnd Bergmann).

Changes in v3:
- Really make a hidden symbol by removing the prompt (Arnd Bergmann).
- Change FB_CORE to config instead of menuconfig (Arnd Bergmann).
- Keep "depends on FB" for FIRMWARE_EDID (Arnd Bergmann).
- Compile out fb_backlight.o and fbmon.o that are only needed for FB (Arnd Bergmann).
- Make FB_DEVICE to depend on FB_CORE instead of selecting it.
- Make the DRM symbol to select FB_CORE if DRM_FBDEV_EMULATION is enabled (Arnd Bergmann).
- Also make DRM select FB_SYS_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
- Make DRM_FBDEV_EMULATION to depend on DRM instead of DRM_KMS_HELPER.

Changes in v2:
- Keep "depends on FB" for FB_DDC, FB_HECUBA, FB_SVGALIB, FB_MACMODES, FB_BACKLIGHT, FB_MODE_HELPERS and FB_TILEBLITTING (Arnd Bergmann).
- Don't change the fb.o object name (Arnd Bergmann).
- Make FB_CORE a non-visible Kconfig symbol instead (Thomas Zimmermann).
- Make CONFIG_DRM_FBDEV_EMULATION to select FB_CORE (Thomas Zimmermann).

Javier Martinez Canillas (4):
video: Add auxiliary display drivers to Graphics support menu
fbdev: Move core fbdev symbols to a separate Kconfig file
fbdev: Split frame buffer support in FB and FB_CORE symbols
drm: Make FB_CORE to be selected if DRM fbdev emulation is enabled

  arch/x86/Makefile                   |   2 +-
  arch/x86/video/Makefile             |   2 +-
  drivers/Kconfig                     |   2 -
  drivers/gpu/drm/Kconfig             |   7 +-
  drivers/video/Kconfig               |   2 +
  drivers/video/backlight/backlight.c |   6 +-
  drivers/video/console/Kconfig       |   2 +-
  drivers/video/fbdev/Kconfig         | 197 ++--------------------------
  drivers/video/fbdev/core/Kconfig    | 190 +++++++++++++++++++++++++++
  drivers/video/fbdev/core/Makefile   |  10 +-
  10 files changed, 218 insertions(+), 202 deletions(-)

create mode 100644 drivers/video/fbdev/core/Kconfig

#12 lore raw

Helge Deller <[email protected]> writes:

Hello Helge,

Quoted 18 lines

Hi Javier,

Quoted 3 lines · Javier Martinez Canillas

This patch series splits the fbdev core support in two different Kconfig
symbols: FB and FB_CORE. The motivation for this is to allow CONFIG_FB to be disabled, while still having the the core fbdev support needed for the

One "the" too much.
(correcting just because this is a cover letter)

Quoted 7 lines

CONFIG_DRM_FBDEV_EMULATION to be enabled. The motivation is automatically disabling all fbdev drivers instead of having to be disabled individually.

The reason for doing this is that now with simpledrm, there's no need for the legacy fbdev (e.g: efifb or vesafb) drivers anymore and many distros now disable them. > But it would simplify the config a lot fo have a single Kconfig symbol to disable all fbdev drivers.

Quoted 9 lines

I suggest to rephrase this, e.g.:
The reason for doing this is that with simpledrm, mainstream Linux distributions like Fedora, SUSE or Ubuntu can then more easily enable the DRM drivers only by switching off legacy fbdev drivers with one Kconfig option (e.g. for efifb or vesafb).

(note: there are quite many other distributions, e.g. debian and the derivates, which still need the fbdev drivers for the various other architectures)

Right, I meant that there is no need anymore for the remaining fbdev drivers that many distributions used to enable only to have fallback fbcon/VT (like vesafb, efifb, simplefb, etc). But I'm OK with your rephrasing and agree that's more accurate to cover all the distros.

Quoted 9 lines
Quoted 9 lines

I've built tested with possible combinations of CONFIG_FB, CONFIG_FB_CORE, CONFIG_DRM_FBDEV_EMULATION and CONFIG_FB_DEVICE symbols set to 'y' or 'n'.

Patch #1 moves the auxdisplay drivers to "Graphics support" Kconfig menu, patch #2 moves the core fbdev Kconfig symbols to a separate Kconfig file, patch #3 does the FB symbol split and introduces the FB_CORE symbol and finally patch #4 makes the DRM symbol to select FB_CORE if the DRM fbdev emualtion support was enabled.

Quoted 8 lines
Quoted 2 lines

Since this series touches three subsystems (auxdisplay, fbdev and DRM), I would like to merge it through DRM with the acks of these maintainers.

Sure. Ack from me.

The patch series look good otherwise. You may add:

Thanks!

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#13 lore raw
In reply to Javier Martinez Canillas
Quoted 6 lines · Javier Martinez Canillas

This patch series splits the fbdev core support in two different Kconfig
symbols: FB and FB_CORE. The motivation for this is to allow CONFIG_FB to be disabled, while still having the the core fbdev support needed for the CONFIG_DRM_FBDEV_EMULATION to be enabled. The motivation is automatically disabling all fbdev drivers instead of having to be disabled individually.

Pushed to drm-misc (drm-misc-next). Thanks all!

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat