Skip to content

Commit b117a4e

Browse files
martinezjavierheftig
authored andcommitted
drivers/firmware: skip simpledrm if nvidia-drm.modeset=1 is set
The Nvidia proprietary driver has some bugs that leads to issues if used with the simpledrm driver. The most noticeable is that does not register an emulated fbdev device. It just relies on a fbdev to be registered by another driver, that could be that could be attached to the framebuffer console. On UEFI machines, this is the efifb driver. This means that disabling the efifb driver will cause virtual consoles to not be present in the system when using the Nvidia driver. Legacy BIOS is not affected just because fbcon is not used there, but instead vgacon. Unless a VGA mode is specified using the vga= kernel command line option, in that case the vesafb driver is used instead and its fbdev attached to the fbcon. This is a problem because with CONFIG_SYSFB_SIMPLEFB=y, the sysfb platform code attempts to register a "simple-framebuffer" platform device (that is matched against simpledrm) and only registers either an "efi-framebuffer" or "vesa-framebuffer" if this fails to be registered due the video modes not being compatible. The Nvidia driver relying on another driver to register the fbdev is quite fragile, since it can't really assume those will stick around. For example there are patches posted to remove the EFI and VESA platform devices once a real DRM or fbdev driver probes. But in any case, moving to a simpledrm + emulated fbdev only breaks this assumption and causes users to not have VT if the Nvidia driver is used. So to prevent this, let's add a workaround and make the sysfb to skip the "simple-framebuffer" registration when nvidia-drm.modeset=1 option is set. This is quite horrible, but honestly I can't think of any other approach. For this to work, the CONFIG_FB_EFI and CONFIG_FB_VESA config options must be enabled besides CONFIG_DRM_SIMPLEDRM. Signed-off-by: Javier Martinez Canillas <[email protected]> Cherry-picked-for: https://bugs.archlinux.org/task/73720 Cherry-picked-for: https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/issues/94
1 parent 7bcf0db commit b117a4e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

drivers/firmware/sysfb.c

+17-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@
3535
#include <linux/screen_info.h>
3636
#include <linux/sysfb.h>
3737

38+
static int skip_simpledrm;
39+
40+
static int __init simpledrm_disable(char *opt)
41+
{
42+
if (!opt)
43+
return -EINVAL;
44+
45+
get_option(&opt, &skip_simpledrm);
46+
47+
if (skip_simpledrm)
48+
pr_info("The simpledrm driver will not be probed\n");
49+
50+
return 0;
51+
}
52+
early_param("nvidia-drm.modeset", simpledrm_disable);
53+
3854
static struct platform_device *pd;
3955
static DEFINE_MUTEX(disable_lock);
4056
static bool disabled;
@@ -164,7 +180,7 @@ static __init int sysfb_init(void)
164180

165181
/* try to create a simple-framebuffer device */
166182
compatible = sysfb_parse_mode(si, &mode);
167-
if (compatible) {
183+
if (compatible && !skip_simpledrm) {
168184
pd = sysfb_create_simplefb(si, &mode, parent);
169185
if (!IS_ERR(pd))
170186
goto put_device;

0 commit comments

Comments
 (0)