Skip to contentSkip to conversation

drm: fix up fbdev Kconfig defaults

PATCH Applied Arnd Bergmann 5 participants 16 messages Sep 11, 2023 – Sep 18, 2023

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

PATCH 1/1 drm: fix up fbdev Kconfig defaults

From: Arnd Bergmann <[email protected]>

As a result of the recent Kconfig reworks, the default settings for the framebuffer interfaces changed in unexpected ways:

Configurations that leave CONFIG_FB disabled but use DRM now get DRM_FBDEV_EMULATION by default. This also turns on the deprecated /dev/fb device nodes for machines that don't actually want it.

In turn, configurations that previously had DRM_FBDEV_EMULATION enabled now only get the /dev/fb front-end but not the more useful framebuffer console, which is not selected any more.

We had previously decided that any combination of the three frontends (FB_DEVICE, FRAMEBUFFER_CONSOLE and LOGO) should be selectable, but the new default settings mean that a lot of defconfig files would have to get adapted.

Change the defaults back to what they were in Linux 6.5:

- Leave DRM_FBDEV_EMULATION turned off unless CONFIG_FB
is enabled. Previously this was a hard dependency but now the two are independent. However, configurations that enable CONFIG_FB probably also want to keep the emulation for DRM, while those without FB presumably did that intentionally in the past.

- Leave FB_DEVICE turned off for FB=n. Following the same logic, the deprecated option should not automatically get enabled here, most users that had FB turned off in the past do not want it, even if they want the console

- Turn the FRAMEBUFFER_CONSOLE option on if DRM_FBDEV_EMULATION is set to avoid having to change defconfig files that relied on it being selected unconditionally in the past. This also makes sense since both LOGO and FB_DEVICE are now disabled by default for builds without CONFIG_FB, but DRM_FBDEV_EMULATION would make no sense if all three are disabled.

Fixes a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION")
Fixes 701d2054fa317 ("fbdev: Make support for userspace interfaces configurable")
---
 drivers/gpu/drm/Kconfig          | 2 +-
 drivers/video/console/Kconfig    | 1 +
 drivers/video/fbdev/core/Kconfig | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/Kconfig +1 -1
index 7df8b6875b121..144a9a1d31cea 100644
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
 	bool "Enable legacy fbdev support for your modesetting driver"
 	depends on DRM
 	select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-	default y
+	default FB
 	help
 	  Choose this option if you have a need for the legacy fbdev
 	  support. Note that this support also provides the linux console
drivers/video/console/Kconfig +1 -0
index b575cf54174af..83c2d7329ca58 100644
@@ -74,6 +74,7 @@ config DUMMY_CONSOLE_ROWS
 config FRAMEBUFFER_CONSOLE
 	bool "Framebuffer Console support"
 	depends on FB_CORE && !UML
+	default DRM_FBDEV_EMULATION
 	select VT_HW_CONSOLE_BINDING
 	select CRC32
 	select FONT_SUPPORT
drivers/video/fbdev/core/Kconfig +1 -1
index 114cb8aa6c8fd..804c2bec9b43c 100644
@@ -28,7 +28,7 @@ config FIRMWARE_EDID
 config FB_DEVICE
 	bool "Provide legacy /dev/fb* device"
 	depends on FB_CORE
-	default y
+	default FB
 	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
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw

Arnd Bergmann <[email protected]> writes:

Hello Arnd,

Quoted 38 lines

From: Arnd Bergmann <[email protected]>

As a result of the recent Kconfig reworks, the default settings for the framebuffer interfaces changed in unexpected ways:

Configurations that leave CONFIG_FB disabled but use DRM now get DRM_FBDEV_EMULATION by default. This also turns on the deprecated /dev/fb device nodes for machines that don't actually want it.

In turn, configurations that previously had DRM_FBDEV_EMULATION enabled now only get the /dev/fb front-end but not the more useful framebuffer console, which is not selected any more.

We had previously decided that any combination of the three frontends (FB_DEVICE, FRAMEBUFFER_CONSOLE and LOGO) should be selectable, but the new default settings mean that a lot of defconfig files would have to get adapted.

Change the defaults back to what they were in Linux 6.5:

- Leave DRM_FBDEV_EMULATION turned off unless CONFIG_FB
is enabled. Previously this was a hard dependency but now the two are independent. However, configurations that enable CONFIG_FB probably also want to keep the emulation for DRM, while those without FB presumably did that intentionally in the past.

- Leave FB_DEVICE turned off for FB=n. Following the same logic, the deprecated option should not automatically get enabled here, most users that had FB turned off in the past do not want it, even if they want the console

- Turn the FRAMEBUFFER_CONSOLE option on if DRM_FBDEV_EMULATION is set to avoid having to change defconfig files that relied on it being selected unconditionally in the past. This also makes sense since both LOGO and FB_DEVICE are now disabled by default for builds without CONFIG_FB, but DRM_FBDEV_EMULATION would make no sense if all three are disabled.

Quoted 5 lines
Fixes a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION")
Fixes 701d2054fa317 ("fbdev: Make support for userspace interfaces configurable")

---

Thanks for fixing this and sorry that I missed the defaults changed.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#2 lore raw
In reply to Arnd Bergmann

Hi Arnd,

Quoted 38 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

As a result of the recent Kconfig reworks, the default settings for the framebuffer interfaces changed in unexpected ways:

Configurations that leave CONFIG_FB disabled but use DRM now get DRM_FBDEV_EMULATION by default. This also turns on the deprecated /dev/fb device nodes for machines that don't actually want it.

In turn, configurations that previously had DRM_FBDEV_EMULATION enabled now only get the /dev/fb front-end but not the more useful framebuffer console, which is not selected any more.

We had previously decided that any combination of the three frontends (FB_DEVICE, FRAMEBUFFER_CONSOLE and LOGO) should be selectable, but the new default settings mean that a lot of defconfig files would have to get adapted.

Change the defaults back to what they were in Linux 6.5:

- Leave DRM_FBDEV_EMULATION turned off unless CONFIG_FB
is enabled. Previously this was a hard dependency but now the two are independent. However, configurations that enable CONFIG_FB probably also want to keep the emulation for DRM, while those without FB presumably did that intentionally in the past.

- Leave FB_DEVICE turned off for FB=n. Following the same logic, the deprecated option should not automatically get enabled here, most users that had FB turned off in the past do not want it, even if they want the console

- Turn the FRAMEBUFFER_CONSOLE option on if DRM_FBDEV_EMULATION is set to avoid having to change defconfig files that relied on it being selected unconditionally in the past. This also makes sense since both LOGO and FB_DEVICE are now disabled by default for builds without CONFIG_FB, but DRM_FBDEV_EMULATION would make no sense if all three are disabled.

Quoted 4 lines
Fixes a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION")
Fixes 701d2054fa317 ("fbdev: Make support for userspace interfaces configurable")

Thanks for your patch!

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 138

Quoted 8 lines
drivers/gpu/drm/Kconfig +1 -1
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
        bool "Enable legacy fbdev support for your modesetting driver"
        depends on DRM
        select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       default y
+       default FB

While this is true for existing configs, it is no longer true in general, as DRM_FBDEV_EMULATION is no longer related to FB.

drivers/video/console/Kconfig config DUMMY_CONSOLE_ROWS · line 77

Quoted 12 lines
drivers/gpu/drm/Kconfig +0 -0
        help
          Choose this option if you have a need for the legacy fbdev
          support. Note that this support also provides the linux console
drivers/video/console/Kconfig +1 -0
index b575cf54174af..83c2d7329ca58 100644
@@ -74,6 +74,7 @@ config DUMMY_CONSOLE_ROWS
 config FRAMEBUFFER_CONSOLE
        bool "Framebuffer Console support"
        depends on FB_CORE && !UML
+       default DRM_FBDEV_EMULATION

Sounds good to me, although it looks a bit strange at first sight (FRAMEBUFFER_CONSOLE defaults to n on a system with real fbdev, but y on emulated fbdev?).
So this is the fix for commit a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION").

drivers/video/fbdev/core/Kconfig config FIRMWARE_EDID · line 31

Quoted 13 lines
drivers/video/console/Kconfig +0 -0
        select VT_HW_CONSOLE_BINDING
        select CRC32
        select FONT_SUPPORT
drivers/video/fbdev/core/Kconfig +1 -1
index 114cb8aa6c8fd..804c2bec9b43c 100644
@@ -28,7 +28,7 @@ config FIRMWARE_EDID
 config FB_DEVICE
        bool "Provide legacy /dev/fb* device"
        depends on FB_CORE
-       default y
+       default FB

Changing this means possibly causing regressions on systems running an fbdev userspace.

drivers/video/fbdev/core/Kconfig config FIRMWARE_EDID · line 34

Quoted 3 lines
drivers/video/fbdev/core/Kconfig +0 -0
        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

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#3 lore raw
Quoted 12 lines · Geert Uytterhoeven

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 138

Quoted 8 lines · Arnd Bergmann
drivers/gpu/drm/Kconfig +1 -1
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
        bool "Enable legacy fbdev support for your modesetting driver"
        depends on DRM
        select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       default y
+       default FB

While this is true for existing configs, it is no longer true in general, as DRM_FBDEV_EMULATION is no longer related to FB.

I think it still makes some sense though, as configs that have both DRM and FB enabled almost certainly want this enabled.

Quoted 7 lines
Quoted 7 lines
drivers/video/console/Kconfig +0 -0
index b575cf54174af..83c2d7329ca58 100644
@@ -74,6 +74,7 @@ config DUMMY_CONSOLE_ROWS
 config FRAMEBUFFER_CONSOLE
        bool "Framebuffer Console support"
Quoted 8 lines

drivers/video/console/Kconfig config DUMMY_CONSOLE_ROWS · line 77

Quoted 2 lines
drivers/video/console/Kconfig +1 -0
        depends on FB_CORE && !UML
+       default DRM_FBDEV_EMULATION

Sounds good to me, although it looks a bit strange at first sight (FRAMEBUFFER_CONSOLE defaults to n on a system with real fbdev, but y on emulated fbdev?).
So this is the fix for commit a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION").

Correct, this should restore the console on configs that accidentally lost it. The real problem here is much older, the assymetry between framebuffer-only configs (with console default off) and DRM configs (with console selected unconditionally) started back in 2009 with commit 6fcefd56f5060 ("drm/kms: fix kms helper license + Kconfig").

I think that was a mistake, but there is little we can do to fix that now without breaking users.

The only alternative I can think of would be to default-enable or force-enable FRAMEBUFFER_CONSOLE for any config that includes both VT_CONSOLE and FB_CORE. This would increase defconfig builds for systems that currently only want CONFIG_FB for either FB_DEVICE or LOGO but don't care about FRAMEBUFFER_CONSOLE. I have no idea who uses such a config, but I think Javier previously said this was an important use case.

Quoted 5 lines
Quoted 5 lines
drivers/video/fbdev/core/Kconfig +0 -0
index 114cb8aa6c8fd..804c2bec9b43c 100644
@@ -28,7 +28,7 @@ config FIRMWARE_EDID
Quoted 8 lines

drivers/video/fbdev/core/Kconfig config FIRMWARE_EDID · line 31

Quoted 5 lines
drivers/video/fbdev/core/Kconfig +1 -1
 config FB_DEVICE
        bool "Provide legacy /dev/fb* device"
        depends on FB_CORE
-       default y
+       default FB

Changing this means possibly causing regressions on systems running an fbdev userspace.

How? FB_DEVICE is a new config that was just split out from CONFIG_FB in 6.6-rc1, so nobody should have any defconfig that disables CONFIG_FB but relies on the FB_DEVICE default yet.

Arnd

Reviewed-by
#4 lore raw

Hi Arnd,

Quoted 14 lines · Arnd Bergmann
Quoted 12 lines · Geert Uytterhoeven

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 138

Quoted 8 lines · Arnd Bergmann
drivers/gpu/drm/Kconfig +1 -1
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
        bool "Enable legacy fbdev support for your modesetting driver"
        depends on DRM
        select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       default y
+       default FB

While this is true for existing configs, it is no longer true in general, as DRM_FBDEV_EMULATION is no longer related to FB.

Quoted 2 lines

I think it still makes some sense though, as configs that have both DRM and FB enabled almost certainly want this enabled.

OK.

People who use DRM drivers only, and now realize they no longer need CONFIG_FB, may need to enable CONFIG_DRM_FBDEV_EMULATION manually when disabling CONFIG_FB, depending on their use case.

Quoted 23 lines
Quoted 7 lines
Quoted 7 lines
drivers/video/console/Kconfig +0 -0
index b575cf54174af..83c2d7329ca58 100644
@@ -74,6 +74,7 @@ config DUMMY_CONSOLE_ROWS
 config FRAMEBUFFER_CONSOLE
        bool "Framebuffer Console support"
Quoted 8 lines

drivers/video/console/Kconfig config DUMMY_CONSOLE_ROWS · line 77

Quoted 2 lines
drivers/video/console/Kconfig +1 -0
        depends on FB_CORE && !UML
+       default DRM_FBDEV_EMULATION

Sounds good to me, although it looks a bit strange at first sight (FRAMEBUFFER_CONSOLE defaults to n on a system with real fbdev, but y on emulated fbdev?).
So this is the fix for commit a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION").

Correct, this should restore the console on configs that accidentally lost it. The real problem here is much older, the assymetry between framebuffer-only configs (with console default off) and DRM configs (with console selected unconditionally) started back in 2009 with commit 6fcefd56f5060 ("drm/kms: fix kms helper license + Kconfig").

Quoted 2 lines

I think that was a mistake, but there is little we can do to fix that now without breaking users.

Right...

Quoted 24 lines

The only alternative I can think of would be to default-enable or force-enable FRAMEBUFFER_CONSOLE for any config that includes both VT_CONSOLE and FB_CORE. This would increase defconfig builds for systems that currently only want CONFIG_FB for either FB_DEVICE or LOGO but don't care about FRAMEBUFFER_CONSOLE. I have no idea who uses such a config, but I think Javier previously said this was an important use case.

Quoted 5 lines
Quoted 5 lines
drivers/video/fbdev/core/Kconfig +0 -0
index 114cb8aa6c8fd..804c2bec9b43c 100644
@@ -28,7 +28,7 @@ config FIRMWARE_EDID
Quoted 8 lines

drivers/video/fbdev/core/Kconfig config FIRMWARE_EDID · line 31

Quoted 5 lines
drivers/video/fbdev/core/Kconfig +1 -1
 config FB_DEVICE
        bool "Provide legacy /dev/fb* device"
        depends on FB_CORE
-       default y
+       default FB

Changing this means possibly causing regressions on systems running an fbdev userspace.

Quoted 3 lines

How? FB_DEVICE is a new config that was just split out from CONFIG_FB in 6.6-rc1, so nobody should have any defconfig that disables CONFIG_FB but relies on the FB_DEVICE default yet.

Right, from the PoV of running "make oldconfig" that is true.

(I was incorrectly considering the defconfigs which I maintain,
and where I already disabled CONFIG_FB after the FB/FB_CORE split in linux-next).

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#5 lore raw
In reply to Arnd Bergmann
Quoted 2 lines · Arnd Bergmann
Quoted 1 line · Geert Uytterhoeven

On Mon, Sep 11, 2023 at 10:53 PM Arnd Bergmann <[email protected]> wrote:

[...]

Quoted 10 lines

The only alternative I can think of would be to default-enable or force-enable FRAMEBUFFER_CONSOLE for any config that includes both VT_CONSOLE and FB_CORE. This would increase defconfig builds for systems that currently only want CONFIG_FB for either FB_DEVICE or LOGO but don't care about FRAMEBUFFER_CONSOLE. I have no idea who uses such a config, but I think Javier previously said this was an important use case.

Yes, IMO that should be a possible combination.

Quoted 14 lines
Quoted 5 lines
Quoted 5 lines
drivers/video/fbdev/core/Kconfig +0 -0
index 114cb8aa6c8fd..804c2bec9b43c 100644
@@ -28,7 +28,7 @@ config FIRMWARE_EDID
Quoted 8 lines

drivers/video/fbdev/core/Kconfig config FIRMWARE_EDID · line 31

Quoted 5 lines
drivers/video/fbdev/core/Kconfig +1 -1
 config FB_DEVICE
        bool "Provide legacy /dev/fb* device"
        depends on FB_CORE
-       default y
+       default FB

Changing this means possibly causing regressions on systems running an fbdev userspace.

Quoted 4 lines

How? FB_DEVICE is a new config that was just split out from CONFIG_FB in 6.6-rc1, so nobody should have any defconfig that disables CONFIG_FB but relies on the FB_DEVICE default yet.

Ah, scratch my previous comment about making this default 'y' then. For some reasons I thought that FB_DEVICE was added in v6.5 but see now that commit 701d2054fa31 ("fbdev: Make support for userspace interfaces configurable") landed in v6.6-rc1:

$ git tag --contains 701d2054fa31 | tail -1
v6.6-rc1
Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#6 lore raw
In reply to Geert Uytterhoeven

Geert Uytterhoeven <[email protected]> writes:

Hello Geert,

Quoted 3 lines

Hi Arnd,

On Mon, Sep 11, 2023 at 10:53 PM Arnd Bergmann <[email protected]> wrote:

[...]

Quoted 12 lines

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 138

Quoted 8 lines
drivers/gpu/drm/Kconfig +1 -1
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
        bool "Enable legacy fbdev support for your modesetting driver"
        depends on DRM
        select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       default y
+       default FB

While this is true for existing configs, it is no longer true in general, as DRM_FBDEV_EMULATION is no longer related to FB.

Maybe default y if (FB_DEVICE || FRAMEBUFFER_CONSOLE) ?

Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/Kconfig +0 -0
        help
          Choose this option if you have a need for the legacy fbdev
          support. Note that this support also provides the linux console
drivers/video/console/Kconfig +0 -0
index b575cf54174af..83c2d7329ca58 100644
@@ -74,6 +74,7 @@ config DUMMY_CONSOLE_ROWS
Quoted 8 lines

drivers/video/console/Kconfig config DUMMY_CONSOLE_ROWS · line 77

Quoted 4 lines
drivers/video/console/Kconfig +1 -0
 config FRAMEBUFFER_CONSOLE
        bool "Framebuffer Console support"
        depends on FB_CORE && !UML
+       default DRM_FBDEV_EMULATION

Sounds good to me, although it looks a bit strange at first sight (FRAMEBUFFER_CONSOLE defaults to n on a system with real fbdev, but y on emulated fbdev?).

And there Maybe default y if (FB || DRM_FBDEV_EMULATION) ?

Quoted 20 lines

So this is the fix for commit a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION").

drivers/video/fbdev/core/Kconfig config FIRMWARE_EDID · line 31

Quoted 13 lines
drivers/video/console/Kconfig +0 -0
        select VT_HW_CONSOLE_BINDING
        select CRC32
        select FONT_SUPPORT
drivers/video/fbdev/core/Kconfig +1 -1
index 114cb8aa6c8fd..804c2bec9b43c 100644
@@ -28,7 +28,7 @@ config FIRMWARE_EDID
 config FB_DEVICE
        bool "Provide legacy /dev/fb* device"
        depends on FB_CORE
-       default y
+       default FB

Changing this means possibly causing regressions on systems running an fbdev userspace.

Right, specially if using DRM fbdev emulation since then the default will be different between v6.5 and v6.6 (that's what this patch tries to avoid).

So probably we could keept that default as 'y'.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#7 lore raw

Hi Javier,

Quoted 17 lines · Javier Martinez Canillas
Quoted 1 line · Geert Uytterhoeven

On Mon, Sep 11, 2023 at 10:53 PM Arnd Bergmann <[email protected]> wrote:

[...]

Quoted 11 lines

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 138

Quoted 8 lines
drivers/gpu/drm/Kconfig +1 -1
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
        bool "Enable legacy fbdev support for your modesetting driver"
        depends on DRM
        select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       default y
+       default FB

While this is true for existing configs, it is no longer true in general, as DRM_FBDEV_EMULATION is no longer related to FB.

Quoted 1 line

Maybe default y if (FB_DEVICE || FRAMEBUFFER_CONSOLE) ?

Which is almost if FB_CORE? ;-)

Won't a dependency on FRAMEBUFFER_CONSOLE here introduce a circular dependency, when combined with the hunk below?

Quoted 17 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/Kconfig +0 -0
        help
          Choose this option if you have a need for the legacy fbdev
          support. Note that this support also provides the linux console
drivers/video/console/Kconfig +0 -0
index b575cf54174af..83c2d7329ca58 100644
@@ -74,6 +74,7 @@ config DUMMY_CONSOLE_ROWS
Quoted 8 lines

drivers/video/console/Kconfig config DUMMY_CONSOLE_ROWS · line 77

Quoted 4 lines
drivers/video/console/Kconfig +1 -0
 config FRAMEBUFFER_CONSOLE
        bool "Framebuffer Console support"
        depends on FB_CORE && !UML
+       default DRM_FBDEV_EMULATION

Sounds good to me, although it looks a bit strange at first sight (FRAMEBUFFER_CONSOLE defaults to n on a system with real fbdev, but y on emulated fbdev?).

Quoted 4 lines

And there Maybe default y if (FB || DRM_FBDEV_EMULATION) ?

Quoted 2 lines

So this is the fix for commit a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION").

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#8 lore raw
In reply to Javier Martinez Canillas
Quoted 15 lines · Javier Martinez Canillas
Quoted 13 lines · Geert Uytterhoeven

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 138

Quoted 8 lines · Arnd Bergmann
drivers/gpu/drm/Kconfig +1 -1
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
        bool "Enable legacy fbdev support for your modesetting driver"
        depends on DRM
        select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       default y
+       default FB

While this is true for existing configs, it is no longer true in general, as DRM_FBDEV_EMULATION is no longer related to FB.

Quoted 1 line

Maybe default y if (FB_DEVICE || FRAMEBUFFER_CONSOLE) ?

That wouldn't work unless we swap around the 'select DRM_CORE', which currently gets selected when DRM_FBDEV_EMULATION is turned on.

Quoted 17 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/Kconfig +0 -0
        help
          Choose this option if you have a need for the legacy fbdev
          support. Note that this support also provides the linux console
drivers/video/console/Kconfig +0 -0
index b575cf54174af..83c2d7329ca58 100644
@@ -74,6 +74,7 @@ config DUMMY_CONSOLE_ROWS
Quoted 8 lines

drivers/video/console/Kconfig config DUMMY_CONSOLE_ROWS · line 77

Quoted 4 lines
drivers/video/console/Kconfig +1 -0
 config FRAMEBUFFER_CONSOLE
        bool "Framebuffer Console support"
        depends on FB_CORE && !UML
+       default DRM_FBDEV_EMULATION

Sounds good to me, although it looks a bit strange at first sight (FRAMEBUFFER_CONSOLE defaults to n on a system with real fbdev, but y on emulated fbdev?).

Quoted 1 line

And there Maybe default y if (FB || DRM_FBDEV_EMULATION) ?

That would be the same as a plain 'default y' based on the dependencies. We can definitely do that, but it does change the behavior for FB-only users.

At the moment, we have 21 defconfig files in the kernel that enable CONFIG_FB but not CONFIG_FRAMEBUFFER_CONSOLE:

$ git grep -l CONFIG_FB=y  arch/*configs/ | xargs grep -L "FRAMEBUFFER_CONSOLE=\|DRM="
arch/arm/configs/am200epdkit_defconfig
arch/arm/configs/assabet_defconfig
arch/arm/configs/clps711x_defconfig
arch/arm/configs/ep93xx_defconfig
arch/arm/configs/footbridge_defconfig
arch/arm/configs/h3600_defconfig
arch/arm/configs/multi_v4t_defconfig
arch/arm/configs/mvebu_v5_defconfig
arch/arm/configs/pxa910_defconfig
arch/arm/configs/s3c6400_defconfig
arch/arm/configs/wpcm450_defconfig
arch/microblaze/configs/mmu_defconfig
arch/mips/configs/cobalt_defconfig
arch/mips/configs/generic/board-ranchu.config
arch/mips/configs/malta_qemu_32r6_defconfig
arch/mips/configs/maltaaprp_defconfig
arch/mips/configs/maltasmvp_defconfig
arch/mips/configs/maltasmvp_eva_defconfig
arch/mips/configs/maltaup_defconfig
arch/sh/configs/r7785rp_defconfig
arch/sh/configs/se7343_defconfig
Quoted 21 lines
Quoted 20 lines

So this is the fix for commit a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION").

drivers/video/fbdev/core/Kconfig config FIRMWARE_EDID · line 31

Quoted 13 lines
drivers/video/console/Kconfig +0 -0
        select VT_HW_CONSOLE_BINDING
        select CRC32
        select FONT_SUPPORT
drivers/video/fbdev/core/Kconfig +1 -1
index 114cb8aa6c8fd..804c2bec9b43c 100644
@@ -28,7 +28,7 @@ config FIRMWARE_EDID
 config FB_DEVICE
        bool "Provide legacy /dev/fb* device"
        depends on FB_CORE
-       default y
+       default FB

Changing this means possibly causing regressions on systems running an fbdev userspace.

Quoted 4 lines

Right, specially if using DRM fbdev emulation since then the default will be different between v6.5 and v6.6 (that's what this patch tries to avoid).

So probably we could keept that default as 'y'.

I really don't want to start enabling this for configs that didn't have it in the past.

Arnd

#9 lore raw
In reply to Geert Uytterhoeven

Hi

Am 12.09.23 um 09:14 schrieb Geert Uytterhoeven:
[...]

Quoted 11 lines

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 138

Quoted 8 lines
drivers/gpu/drm/Kconfig +1 -1
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
         bool "Enable legacy fbdev support for your modesetting driver"
         depends on DRM
         select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       default y
+       default FB

While this is true for existing configs, it is no longer true in general, as DRM_FBDEV_EMULATION is no longer related to FB.

Would it make sense to make FRAMEBUFFER_CONSOLE an independent option and have FBDEV_EMULATION depend on it? Something like this:

FRAMEBUFFER_CONSOLE

	depends on DRM || FB
	select FB_CORE

FBDEV_EMULATION
depends on DRM
depends on FRAMEBUFFER_CONSOLE
default y

So if any graphics subsystems are enabled, FRAMEBUFFER_CONSOLE is select-able. But for DRM, FBDEV_EMULATION disables the console. That option remains more for historical reasons than actual usefulness.

Best regards
Thomas

Quoted 45 lines

drivers/video/console/Kconfig config DUMMY_CONSOLE_ROWS · line 77

Quoted 13 lines
drivers/gpu/drm/Kconfig +0 -0
         help
           Choose this option if you have a need for the legacy fbdev
           support. Note that this support also provides the linux console
drivers/video/console/Kconfig +1 -0
index b575cf54174af..83c2d7329ca58 100644
@@ -74,6 +74,7 @@ config DUMMY_CONSOLE_ROWS
  config FRAMEBUFFER_CONSOLE
         bool "Framebuffer Console support"
         depends on FB_CORE && !UML
+       default DRM_FBDEV_EMULATION

Sounds good to me, although it looks a bit strange at first sight (FRAMEBUFFER_CONSOLE defaults to n on a system with real fbdev, but y on emulated fbdev?).
So this is the fix for commit a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION").

drivers/video/fbdev/core/Kconfig config FIRMWARE_EDID · line 31

Quoted 13 lines
drivers/video/console/Kconfig +0 -0
         select VT_HW_CONSOLE_BINDING
         select CRC32
         select FONT_SUPPORT
drivers/video/fbdev/core/Kconfig +1 -1
index 114cb8aa6c8fd..804c2bec9b43c 100644
@@ -28,7 +28,7 @@ config FIRMWARE_EDID
  config FB_DEVICE
         bool "Provide legacy /dev/fb* device"
         depends on FB_CORE
-       default y
+       default FB

Changing this means possibly causing regressions on systems running an fbdev userspace.

drivers/video/fbdev/core/Kconfig config FIRMWARE_EDID · line 34

Quoted 3 lines
drivers/video/fbdev/core/Kconfig +0 -0
         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

Gr{oetje,eeting}s,

Geert

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
#10 lore raw

Hi Thomas,

Quoted 17 lines · Thomas Zimmermann

Am 12.09.23 um 09:14 schrieb Geert Uytterhoeven:
[...]

Quoted 11 lines

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 138

Quoted 8 lines
drivers/gpu/drm/Kconfig +1 -1
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
         bool "Enable legacy fbdev support for your modesetting driver"
         depends on DRM
         select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       default y
+       default FB

While this is true for existing configs, it is no longer true in general, as DRM_FBDEV_EMULATION is no longer related to FB.

Would it make sense to make FRAMEBUFFER_CONSOLE an independent option and have FBDEV_EMULATION depend on it? Something like this:

Quoted 8 lines

FRAMEBUFFER_CONSOLE

        depends on DRM || FB
        select FB_CORE

FBDEV_EMULATION
depends on DRM
depends on FRAMEBUFFER_CONSOLE
default y

Oops, now you can no longer have FBDEV_EMULATION without FRAMEBUFFER_CONSOLE, which is useful to be able to enable FB_DEVICE...

And what's the point (if DRM is enabled) of having FB_CORE with FBDEV_EMULATION disabled?

Quoted 2 lines

So if any graphics subsystems are enabled, FRAMEBUFFER_CONSOLE is select-able. But for DRM, FBDEV_EMULATION disables the console. That

Huh?

/me looks at his morning coffee, and confirms the cup is empty...

Quoted 36 lines

option remains more for historical reasons than actual usefulness.

Quoted 34 lines

drivers/video/console/Kconfig config DUMMY_CONSOLE_ROWS · line 77

Quoted 7 lines
drivers/video/console/Kconfig +1 -0
@@ -74,6 +74,7 @@ config DUMMY_CONSOLE_ROWS
  config FRAMEBUFFER_CONSOLE
         bool "Framebuffer Console support"
         depends on FB_CORE && !UML
+       default DRM_FBDEV_EMULATION

Sounds good to me, although it looks a bit strange at first sight (FRAMEBUFFER_CONSOLE defaults to n on a system with real fbdev, but y on emulated fbdev?).
So this is the fix for commit a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION").

drivers/video/fbdev/core/Kconfig config FIRMWARE_EDID · line 31

Quoted 13 lines
drivers/video/console/Kconfig +0 -0
         select VT_HW_CONSOLE_BINDING
         select CRC32
         select FONT_SUPPORT
drivers/video/fbdev/core/Kconfig +1 -1
index 114cb8aa6c8fd..804c2bec9b43c 100644
@@ -28,7 +28,7 @@ config FIRMWARE_EDID
  config FB_DEVICE
         bool "Provide legacy /dev/fb* device"
         depends on FB_CORE
-       default y
+       default FB

Changing this means possibly causing regressions on systems running an fbdev userspace.

Quoted 3 lines
drivers/video/fbdev/core/Kconfig +0 -0
         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

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#11 lore raw

Hi Geert

Am 12.09.23 um 10:18 schrieb Geert Uytterhoeven:

Quoted 24 lines

Hi Thomas,

Quoted 21 lines · Thomas Zimmermann

Am 12.09.23 um 09:14 schrieb Geert Uytterhoeven:
[...]

Quoted 11 lines

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 138

Quoted 8 lines
drivers/gpu/drm/Kconfig +1 -1
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
          bool "Enable legacy fbdev support for your modesetting driver"
          depends on DRM
          select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       default y
+       default FB

While this is true for existing configs, it is no longer true in general, as DRM_FBDEV_EMULATION is no longer related to FB.

Would it make sense to make FRAMEBUFFER_CONSOLE an independent option and have FBDEV_EMULATION depend on it? Something like this:

FRAMEBUFFER_CONSOLE

         depends on DRM || FB
         select FB_CORE
Quoted 8 lines
Quoted 4 lines

FBDEV_EMULATION
depends on DRM
depends on FRAMEBUFFER_CONSOLE
default y

Oops, now you can no longer have FBDEV_EMULATION without FRAMEBUFFER_CONSOLE, which is useful to be able to enable FB_DEVICE...

And if it depends on FB_CORE instead of FRAMEBUFFER_CONSOLE? I'm aware that this would require more Kconfig changes than outlined here.

Quoted 10 lines

And what's the point (if DRM is enabled) of having FB_CORE with FBDEV_EMULATION disabled?

Quoted 2 lines

So if any graphics subsystems are enabled, FRAMEBUFFER_CONSOLE is select-able. But for DRM, FBDEV_EMULATION disables the console. That

Huh?

/me looks at his morning coffee, and confirms the cup is empty...

Decaf maybe?

But there's really no need to get snarky. My though is that FRAMEBUFFER_CONSOLE configures an end-user feature. The user sits there an thinks "I want a console". FBDEV_EMULATION controls a driver functionality. It's not useful by itself, but enables the enduser feature. The features would be FRAMEBUFFER_CONSOLE and FRAMEBUFFER_DEVICE.

Best regards
Thomas

Quoted 42 lines
Quoted 37 lines

option remains more for historical reasons than actual usefulness.

Quoted 34 lines

drivers/video/console/Kconfig config DUMMY_CONSOLE_ROWS · line 77

Quoted 7 lines
drivers/video/console/Kconfig +1 -0
@@ -74,6 +74,7 @@ config DUMMY_CONSOLE_ROWS
   config FRAMEBUFFER_CONSOLE
          bool "Framebuffer Console support"
          depends on FB_CORE && !UML
+       default DRM_FBDEV_EMULATION

Sounds good to me, although it looks a bit strange at first sight (FRAMEBUFFER_CONSOLE defaults to n on a system with real fbdev, but y on emulated fbdev?).
So this is the fix for commit a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION").

drivers/video/fbdev/core/Kconfig config FIRMWARE_EDID · line 31

Quoted 13 lines
drivers/video/console/Kconfig +0 -0
          select VT_HW_CONSOLE_BINDING
          select CRC32
          select FONT_SUPPORT
drivers/video/fbdev/core/Kconfig +1 -1
index 114cb8aa6c8fd..804c2bec9b43c 100644
@@ -28,7 +28,7 @@ config FIRMWARE_EDID
   config FB_DEVICE
          bool "Provide legacy /dev/fb* device"
          depends on FB_CORE
-       default y
+       default FB

Changing this means possibly causing regressions on systems running an fbdev userspace.

Quoted 3 lines
drivers/video/fbdev/core/Kconfig +0 -0
          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

Gr{oetje,eeting}s,

Geert

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
#12 lore raw

Hi Thomas,

Quoted 43 lines · Thomas Zimmermann

Am 12.09.23 um 10:18 schrieb Geert Uytterhoeven:

Quoted 22 lines · Thomas Zimmermann
Quoted 21 lines

Am 12.09.23 um 09:14 schrieb Geert Uytterhoeven:
[...]

Quoted 11 lines

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 138

Quoted 8 lines
drivers/gpu/drm/Kconfig +1 -1
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
          bool "Enable legacy fbdev support for your modesetting driver"
          depends on DRM
          select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       default y
+       default FB

While this is true for existing configs, it is no longer true in general, as DRM_FBDEV_EMULATION is no longer related to FB.

Would it make sense to make FRAMEBUFFER_CONSOLE an independent option and have FBDEV_EMULATION depend on it? Something like this:

FRAMEBUFFER_CONSOLE

         depends on DRM || FB
         select FB_CORE
Quoted 8 lines
Quoted 4 lines

FBDEV_EMULATION
depends on DRM
depends on FRAMEBUFFER_CONSOLE
default y

Oops, now you can no longer have FBDEV_EMULATION without FRAMEBUFFER_CONSOLE, which is useful to be able to enable FB_DEVICE...

And if it depends on FB_CORE instead of FRAMEBUFFER_CONSOLE? I'm aware that this would require more Kconfig changes than outlined here.

Quoted 7 lines

And what's the point (if DRM is enabled) of having FB_CORE with FBDEV_EMULATION disabled?

Quoted 2 lines

So if any graphics subsystems are enabled, FRAMEBUFFER_CONSOLE is select-able. But for DRM, FBDEV_EMULATION disables the console. That

Quoted 7 lines
Quoted 3 lines

Huh?

/me looks at his morning coffee, and confirms the cup is empty...

Decaf maybe?

But there's really no need to get snarky. My though is that

Sorry, I was surprised by "FBDEV_EMULATION disables the console", which is not what the Kconfig snippet you suggested does?

Quoted 4 lines

FRAMEBUFFER_CONSOLE configures an end-user feature. The user sits there an thinks "I want a console". FBDEV_EMULATION controls a driver functionality. It's not useful by itself, but enables the enduser feature. The features would be FRAMEBUFFER_CONSOLE and FRAMEBUFFER_DEVICE.

The latter is currently called FB_DEVICE.

If you want to have this controlled by user-visible features, then either FRAMEBUFFER_CONSOLE and FRAMEBUFFER_DEVICE should "select FBDEV_EMULATION if DRM", right?

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#13 lore raw
In reply to Geert Uytterhoeven
Quoted 27 lines · Geert Uytterhoeven
Quoted 17 lines · Thomas Zimmermann

Am 12.09.23 um 09:14 schrieb Geert Uytterhoeven:
[...]

Quoted 11 lines

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 138

Quoted 8 lines
drivers/gpu/drm/Kconfig +1 -1
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
         bool "Enable legacy fbdev support for your modesetting driver"
         depends on DRM
         select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       default y
+       default FB

While this is true for existing configs, it is no longer true in general, as DRM_FBDEV_EMULATION is no longer related to FB.

Would it make sense to make FRAMEBUFFER_CONSOLE an independent option and have FBDEV_EMULATION depend on it? Something like this:

Quoted 8 lines

FRAMEBUFFER_CONSOLE

        depends on DRM || FB
        select FB_CORE

FBDEV_EMULATION
depends on DRM
depends on FRAMEBUFFER_CONSOLE
default y

Quoted 6 lines

Oops, now you can no longer have FBDEV_EMULATION without FRAMEBUFFER_CONSOLE, which is useful to be able to enable FB_DEVICE...

And what's the point (if DRM is enabled) of having FB_CORE with FBDEV_EMULATION disabled?

I think we technically have the choice between selecting FB_CORE from all the providers (FB and DRM_FBDEV_EMULATION) or from all the consumers (FRAMEBUFFER_CONSOLE, FB_DEVICE and LOGO). We chose to have it the former way at the moment, and I think what Thomas suggests here is to change it to the latter.

The downside of the current approach is that you can have pointless configuration with

CONFIG_FB=y
CONFIG_DRM=y
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_FRAMEBUFFER_CONSOLE=n
CONFIG_FB_DEVICE=n
CONFIG_LOGO=n

where the fb_core module gets initialized but it is impossible for anything to draw on it.

Another option we have would be to try to separate the Kconfig options for DRM and FB a little further, in anticipation of reducing the amount of shared code in the long run (a lot of FB code is built but never used when enabling console on DRM).

So adding a new

config DRM_CONSOLE
bool "enable console on DRM devices" depends on DRM
depends on VT_CONSOLE
depends on !UML
select FB_CORE
select FRAMEBUFFER_CONSOLE_CORE # new helper sym select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY default y

would give us a path to minimize the shared code further, allowing the console code to be reused as before, but without having to pull in the code that is now only needed for FB_DEVICE. In this scenario, we'd still have CONFIG_DRM_FBDEV_EMULATION like

config DRM_FBDEV_EMULATION
bool "full emulation of fbdev layer for DRM" select FB_CORE
select FB_DEVICE
default FB # if enabled already, use it

but only use that if we actually want FB_DEVICE.

Arnd

maintainer Acked-by on v1 1/1
#14 lore raw
In reply to Arnd Bergmann

Hi

Am 11.09.23 um 22:52 schrieb Arnd Bergmann:

Quoted 38 lines

From: Arnd Bergmann <[email protected]>

As a result of the recent Kconfig reworks, the default settings for the framebuffer interfaces changed in unexpected ways:

Configurations that leave CONFIG_FB disabled but use DRM now get DRM_FBDEV_EMULATION by default. This also turns on the deprecated /dev/fb device nodes for machines that don't actually want it.

In turn, configurations that previously had DRM_FBDEV_EMULATION enabled now only get the /dev/fb front-end but not the more useful framebuffer console, which is not selected any more.

We had previously decided that any combination of the three frontends (FB_DEVICE, FRAMEBUFFER_CONSOLE and LOGO) should be selectable, but the new default settings mean that a lot of defconfig files would have to get adapted.

Change the defaults back to what they were in Linux 6.5:

- Leave DRM_FBDEV_EMULATION turned off unless CONFIG_FB
is enabled. Previously this was a hard dependency but now the two are independent. However, configurations that enable CONFIG_FB probably also want to keep the emulation for DRM, while those without FB presumably did that intentionally in the past.

- Leave FB_DEVICE turned off for FB=n. Following the same logic, the deprecated option should not automatically get enabled here, most users that had FB turned off in the past do not want it, even if they want the console

- Turn the FRAMEBUFFER_CONSOLE option on if DRM_FBDEV_EMULATION is set to avoid having to change defconfig files that relied on it being selected unconditionally in the past. This also makes sense since both LOGO and FB_DEVICE are now disabled by default for builds without CONFIG_FB, but DRM_FBDEV_EMULATION would make no sense if all three are disabled.

Quoted 4 lines
Fixes a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION")
Fixes 701d2054fa317 ("fbdev: Make support for userspace interfaces configurable")
Quoted 44 lines
---
  drivers/gpu/drm/Kconfig          | 2 +-
  drivers/video/console/Kconfig    | 1 +
  drivers/video/fbdev/core/Kconfig | 2 +-
  3 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/Kconfig +1 -1
index 7df8b6875b121..144a9a1d31cea 100644
@@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
  	bool "Enable legacy fbdev support for your modesetting driver"
  	depends on DRM
  	select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-	default y
+	default FB
  	help
  	  Choose this option if you have a need for the legacy fbdev
  	  support. Note that this support also provides the linux console
drivers/video/console/Kconfig +1 -0
index b575cf54174af..83c2d7329ca58 100644
@@ -74,6 +74,7 @@ config DUMMY_CONSOLE_ROWS
  config FRAMEBUFFER_CONSOLE
  	bool "Framebuffer Console support"
  	depends on FB_CORE && !UML
+	default DRM_FBDEV_EMULATION
  	select VT_HW_CONSOLE_BINDING
  	select CRC32
  	select FONT_SUPPORT
drivers/video/fbdev/core/Kconfig +1 -1
index 114cb8aa6c8fd..804c2bec9b43c 100644
@@ -28,7 +28,7 @@ config FIRMWARE_EDID
  config FB_DEVICE
  	bool "Provide legacy /dev/fb* device"
  	depends on FB_CORE
-	default y
+	default FB
  	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
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
#15 lore raw
Quoted 41 lines · Thomas Zimmermann

Hi

Am 11.09.23 um 22:52 schrieb Arnd Bergmann:

Quoted 38 lines

From: Arnd Bergmann <[email protected]>

As a result of the recent Kconfig reworks, the default settings for the framebuffer interfaces changed in unexpected ways:

Configurations that leave CONFIG_FB disabled but use DRM now get DRM_FBDEV_EMULATION by default. This also turns on the deprecated /dev/fb device nodes for machines that don't actually want it.

In turn, configurations that previously had DRM_FBDEV_EMULATION enabled now only get the /dev/fb front-end but not the more useful framebuffer console, which is not selected any more.

We had previously decided that any combination of the three frontends (FB_DEVICE, FRAMEBUFFER_CONSOLE and LOGO) should be selectable, but the new default settings mean that a lot of defconfig files would have to get adapted.

Change the defaults back to what they were in Linux 6.5:

- Leave DRM_FBDEV_EMULATION turned off unless CONFIG_FB
is enabled. Previously this was a hard dependency but now the two are independent. However, configurations that enable CONFIG_FB probably also want to keep the emulation for DRM, while those without FB presumably did that intentionally in the past.

- Leave FB_DEVICE turned off for FB=n. Following the same logic, the deprecated option should not automatically get enabled here, most users that had FB turned off in the past do not want it, even if they want the console

- Turn the FRAMEBUFFER_CONSOLE option on if DRM_FBDEV_EMULATION is set to avoid having to change defconfig files that relied on it being selected unconditionally in the past. This also makes sense since both LOGO and FB_DEVICE are now disabled by default for builds without CONFIG_FB, but DRM_FBDEV_EMULATION would make no sense if all three are disabled.

Quoted 7 lines
Quoted 4 lines
Fixes a5ae331edb02b ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION")
Fixes 701d2054fa317 ("fbdev: Make support for userspace interfaces configurable")

Pushed to drm-misc (drm-misc-fixes). Thanks!

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat