Skip to contentSkip to conversation

Linux >= 5.14.12 and 5.15-rc5 fail to show anything on the screen with CONFIG_DRM_SIMPLEDRM=y

PATCH Artem S. Tashkinov 3 participants 3 messages Oct 22, 2021

lore
Share & tools
lore
#0 lore raw

Hello,

Kernel 5.14.12 introduced this change, git commit
ec7cc3f74b4236860ce612656aa5be7936d1c594:

linux-5.14.12/drivers/video/fbdev/Kconfig renamed from linux-5.14.11/drivers/video/fbdev/Kconfig +3 -2
@@ -2191,8 +2191,9 @@ config FB_HYPERV
      This framebuffer driver supports Microsoft Hyper-V Synthetic Video.
 
 config FB_SIMPLE
-   bool "Simple framebuffer support"
-   depends on (FB = y) && !DRM_SIMPLEDRM
+   tristate "Simple framebuffer support"
+   depends on FB
+   depends on !DRM_SIMPLEDRM
    select FB_CFB_FILLRECT
    select FB_CFB_COPYAREA
    select FB_CFB_IMAGEBLIT

However if you enable CONFIG_DRM_SIMPLEDRM=y along with it, the system will show a black screen on boot while logging these messages:

[drm] Initialized simpledrm 1.0.0 20200625 for simple-framebuffer.0 on minor 0
simple-framebuffer simple-framebuffer.0: [drm] *ERROR* fbdev: Failed to setup generic emulation (ret=-22)
fbcon: Taking over console

When CONFIG_DRM_SIMPLEDRM is disabled it proceeds to boot normally:

simple-framebuffer simple-framebuffer.0: framebuffer at 0xe1000000, 0x300000 bytes
simple-framebuffer simple-framebuffer.0: format=a8r8g8b8, mode=1024x768x32, linelength=4096
fbcon: Deferring console take-over
simple-framebuffer simple-framebuffer.0: fb0: simplefb registered!

This is discussed here: https://bugzilla.kernel.org/show_bug.cgi?id=214723

I really don't know what to make of it but I definitely don't like this situation.

Best regards,
Artem

#1 lore raw
Quoted 19 lines · Artem S. Tashkinov

Kernel 5.14.12 introduced this change, git commit
ec7cc3f74b4236860ce612656aa5be7936d1c594:

linux-5.14.12/drivers/video/fbdev/Kconfig renamed from linux-5.14.11/drivers/video/fbdev/Kconfig +3 -2
@@ -2191,8 +2191,9 @@ config FB_HYPERV
       This framebuffer driver supports Microsoft Hyper-V Synthetic Video.
 
  config FB_SIMPLE
-   bool "Simple framebuffer support"
-   depends on (FB = y) && !DRM_SIMPLEDRM
+   tristate "Simple framebuffer support"
+   depends on FB
+   depends on !DRM_SIMPLEDRM
     select FB_CFB_FILLRECT
     select FB_CFB_COPYAREA
     select FB_CFB_IMAGEBLIT
Quoted 8 lines

However if you enable CONFIG_DRM_SIMPLEDRM=y along with it, the system will show a black screen on boot while logging these messages:

[drm] Initialized simpledrm 1.0.0 20200625 for simple-framebuffer.0 on minor 0
simple-framebuffer simple-framebuffer.0: [drm] *ERROR* fbdev: Failed to setup generic emulation (ret=-22)
fbcon: Taking over console

If you want to help debug this, you can try adding a few printk statements around this code that could run into -EINVAL (22):

drm_file_alloc()
...

        if (dev->driver->open) {
                ret = dev->driver->open(dev, file);
                if (ret < 0)
                        goto out_prime_destroy;
        }

or
static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
int preferred_bpp)
...

        ret = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes);
or
static int do_fbcon_takeover(int show_logo)
...
        if (!num_registered_fb)
                return -ENODEV;

and then go from there.

Quoted 7 lines

When CONFIG_DRM_SIMPLEDRM is disabled it proceeds to boot normally:
simple-framebuffer simple-framebuffer.0: framebuffer at 0xe1000000, 0x300000 bytes
simple-framebuffer simple-framebuffer.0: format=a8r8g8b8, mode=1024x768x32, linelength=4096
fbcon: Deferring console take-over
simple-framebuffer simple-framebuffer.0: fb0: simplefb registered!

Ok, good, so FB_SIMPLE continues to work as expected if it's built-in.

When the driver is a loadable module, it should work once you load the module, but that is only after the system is fully booted. It's possible that there is a bug with the module loading.

In the meantime I would suggest to keep using FB_SIMPLE=y if that works for you.

Arnd

#2 lore raw
In reply to Artem S. Tashkinov

Hi

Am 22.10.21 um 14:15 schrieb Artem S. Tashkinov:

Quoted 41 lines

Hello,

Kernel 5.14.12 introduced this change, git commit
ec7cc3f74b4236860ce612656aa5be7936d1c594:

linux-5.14.12/drivers/video/fbdev/Kconfig renamed from linux-5.14.11/drivers/video/fbdev/Kconfig +3 -2
@@ -2191,8 +2191,9 @@ config FB_HYPERV
       This framebuffer driver supports Microsoft Hyper-V Synthetic Video.
 
  config FB_SIMPLE
-   bool "Simple framebuffer support"
-   depends on (FB = y) && !DRM_SIMPLEDRM
+   tristate "Simple framebuffer support"
+   depends on FB
+   depends on !DRM_SIMPLEDRM
     select FB_CFB_FILLRECT
     select FB_CFB_COPYAREA
     select FB_CFB_IMAGEBLIT

However if you enable CONFIG_DRM_SIMPLEDRM=y along with it, the system will show a black screen on boot while logging these messages:

[drm] Initialized simpledrm 1.0.0 20200625 for simple-framebuffer.0 on minor 0
simple-framebuffer simple-framebuffer.0: [drm] *ERROR* fbdev: Failed to setup generic emulation (ret=-22)
fbcon: Taking over console

When CONFIG_DRM_SIMPLEDRM is disabled it proceeds to boot normally:

simple-framebuffer simple-framebuffer.0: framebuffer at 0xe1000000, 0x300000 bytes
simple-framebuffer simple-framebuffer.0: format=a8r8g8b8, mode=1024x768x32, linelength=4096
fbcon: Deferring console take-over
simple-framebuffer simple-framebuffer.0: fb0: simplefb registered!

Quoted 4 lines

This is discussed here: https://bugzilla.kernel.org/show_bug.cgi?id=214723

I really don't know what to make of it but I definitely don't like this situation.

You might need commit b693e42921e0 ("drm/fbdev: Clamp fbdev surface size if too large"), which is only in -rc6.

Alternatively, make sure that fbdev overallocation has been disabled. The config that is attached to that bug report indicate that it's enabled.

CONFIG_DRM_FBDEV_OVERALLOC=300

Temporarily set this value to 100 for now.

Sorry for any problems with simpledrm. It's still new and we're fixing the bug that it exposes.

BTW, you also have to make your bootloader pass the graphics mode to Linux. (GRUB_GFXPAYLOAD_LINUX="keep" for GRUB [1]).

Best regards
Thomas

[1] https://www.gnu.org/software/grub/manual/grub/html_node/gfxpayload.html

Quoted 4 lines

Best regards,
Artem

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer