]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
fbdev: fbmem: allow overriding the number of bootup logos
authorPeter Rosin <peda@axentia.se>
Tue, 27 Aug 2019 11:09:21 +0000 (11:09 +0000)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fri, 3 Jan 2020 13:27:40 +0000 (14:27 +0100)
Probably most useful if you want no logo at all, or if you only want one
logo regardless of how many CPU cores you have.

Signed-off-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190827110854.12574-3-peda@axentia.se
Documentation/fb/fbcon.rst
drivers/video/fbdev/core/fbcon.c
drivers/video/fbdev/core/fbmem.c
include/linux/fb.h

index 65ba402551374b85ad5a5cd51665ade4b8be031b..e57a3d1d085ad6e5dc0c43cc582456e2eec56c36 100644 (file)
@@ -174,6 +174,11 @@ C. Boot options
        displayed due to multiple CPUs, the collected line of logos is moved
        as a whole.
 
+9. fbcon=logo-count:<n>
+
+       The value 'n' overrides the number of bootup logos. 0 disables the
+       logo, and -1 gives the default which is the number of online CPUs.
+
 C. Attaching, Detaching and Unloading
 
 Before going on to how to attach, detach and unload the framebuffer console, an
index c9235a2f42f8900a14b1cb9ab7ef7e8b28dc041c..bb6ae995c2e573bdfcf32c6eb722d361763668ea 100644 (file)
@@ -536,6 +536,13 @@ static int __init fb_console_setup(char *this_opt)
                                fb_center_logo = true;
                        continue;
                }
+
+               if (!strncmp(options, "logo-count:", 11)) {
+                       options += 11;
+                       if (*options)
+                               fb_logo_count = simple_strtol(options, &options, 0);
+                       continue;
+               }
        }
        return 1;
 }
index 7ddeb90337bcae7b4804875599b0c6f3a155deb6..7ce21009f85deea6a188c6e52f66cc6d53182787 100644 (file)
@@ -56,6 +56,8 @@ EXPORT_SYMBOL(num_registered_fb);
 bool fb_center_logo __read_mostly;
 EXPORT_SYMBOL(fb_center_logo);
 
+int fb_logo_count __read_mostly = -1;
+
 static struct fb_info *get_fb_info(unsigned int idx)
 {
        struct fb_info *fb_info;
@@ -620,7 +622,7 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
        memset(&fb_logo, 0, sizeof(struct logo_data));
 
        if (info->flags & FBINFO_MISC_TILEBLITTING ||
-           info->fbops->owner)
+           info->fbops->owner || !fb_logo_count)
                return 0;
 
        if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
@@ -686,10 +688,14 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
 
 int fb_show_logo(struct fb_info *info, int rotate)
 {
+       unsigned int count;
        int y;
 
-       y = fb_show_logo_line(info, rotate, fb_logo.logo, 0,
-                             num_online_cpus());
+       if (!fb_logo_count)
+               return 0;
+
+       count = fb_logo_count < 0 ? num_online_cpus() : fb_logo_count;
+       y = fb_show_logo_line(info, rotate, fb_logo.logo, 0, count);
        y = fb_show_extra_logos(info, y, rotate);
 
        return y;
index 6557fabdea6275171996f3a9a1a7d5e6459e5901..3b4b2f0c6994d7742a0aed7b6fe53f1e474ed91e 100644 (file)
@@ -625,6 +625,7 @@ extern int fb_new_modelist(struct fb_info *info);
 extern struct fb_info *registered_fb[FB_MAX];
 extern int num_registered_fb;
 extern bool fb_center_logo;
+extern int fb_logo_count;
 extern struct class *fb_class;
 
 #define for_each_registered_fb(i)              \