linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Add possibility to specify the number of displayed logos
@ 2019-08-26 19:58 Peter Rosin
  2019-08-26 19:58 ` [PATCH v2 1/3] fbdev: fix numbering of fbcon options Peter Rosin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Peter Rosin @ 2019-08-26 19:58 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Bartlomiej Zolnierkiewicz, Jonathan Corbet,
	dri-devel, linux-fbdev, linux-doc, Matthew Wilcox

Hi!

The first patch fixes the fact that there are two items numbered "4" in
the list of fbcon options. This bug is a teenager...

The second patch extends that list with a new option that allows the
user to display any number of logos (that fits on the screen). I need it
to limit the display to only one logo instead of one for each CPU core.

Changes since v1

- do not needlessly export fb_logo_count [Matthew Wilcox]
- added patch 3/3, which removes the export of fb_center_logo

Cheers,
Peter

Peter Rosin (3):
  fbdev: fix numbering of fbcon options
  fbdev: fbmem: allow overriding the number of bootup logos
  fbdev: fbmem: avoid exporting fb_center_logo

 Documentation/fb/fbcon.rst       | 13 +++++++++----
 drivers/video/fbdev/core/fbcon.c |  7 +++++++
 drivers/video/fbdev/core/fbmem.c |  5 +++--
 include/linux/fb.h               |  1 +
 4 files changed, 20 insertions(+), 6 deletions(-)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/3] fbdev: fix numbering of fbcon options
  2019-08-26 19:58 [PATCH v2 0/3] Add possibility to specify the number of displayed logos Peter Rosin
@ 2019-08-26 19:58 ` Peter Rosin
  2019-08-26 19:58 ` [PATCH v2 2/3] fbdev: fbmem: allow overriding the number of bootup logos Peter Rosin
  2019-08-26 19:59 ` [PATCH v2 3/3] fbdev: fbmem: avoid exporting fb_center_logo Peter Rosin
  2 siblings, 0 replies; 7+ messages in thread
From: Peter Rosin @ 2019-08-26 19:58 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Bartlomiej Zolnierkiewicz, Jonathan Corbet,
	dri-devel, linux-fbdev, linux-doc, Matthew Wilcox

Three shall be the number thou shalt count, and the number of the
counting shall be three. Four shalt thou not count...

One! Two! Five!

Fixes: efb985f6b265 ("[PATCH] fbcon: Console Rotation - Add framebuffer console documentation")
Signed-off-by: Peter Rosin <peda@axentia.se>
---
 Documentation/fb/fbcon.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/fb/fbcon.rst b/Documentation/fb/fbcon.rst
index ebca41785abe..65ba40255137 100644
--- a/Documentation/fb/fbcon.rst
+++ b/Documentation/fb/fbcon.rst
@@ -127,7 +127,7 @@ C. Boot options
 	is typically located on the same video card.  Thus, the consoles that
 	are controlled by the VGA console will be garbled.
 
-4. fbcon=rotate:<n>
+5. fbcon=rotate:<n>
 
 	This option changes the orientation angle of the console display. The
 	value 'n' accepts the following:
@@ -152,21 +152,21 @@ C. Boot options
 	Actually, the underlying fb driver is totally ignorant of console
 	rotation.
 
-5. fbcon=margin:<color>
+6. fbcon=margin:<color>
 
 	This option specifies the color of the margins. The margins are the
 	leftover area at the right and the bottom of the screen that are not
 	used by text. By default, this area will be black. The 'color' value
 	is an integer number that depends on the framebuffer driver being used.
 
-6. fbcon=nodefer
+7. fbcon=nodefer
 
 	If the kernel is compiled with deferred fbcon takeover support, normally
 	the framebuffer contents, left in place by the firmware/bootloader, will
 	be preserved until there actually is some text is output to the console.
 	This option causes fbcon to bind immediately to the fbdev device.
 
-7. fbcon=logo-pos:<location>
+8. fbcon=logo-pos:<location>
 
 	The only possible 'location' is 'center' (without quotes), and when
 	given, the bootup logo is moved from the default top-left corner
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] fbdev: fbmem: allow overriding the number of bootup logos
  2019-08-26 19:58 [PATCH v2 0/3] Add possibility to specify the number of displayed logos Peter Rosin
  2019-08-26 19:58 ` [PATCH v2 1/3] fbdev: fix numbering of fbcon options Peter Rosin
@ 2019-08-26 19:58 ` Peter Rosin
  2019-08-27  8:36   ` Geert Uytterhoeven
  2019-08-26 19:59 ` [PATCH v2 3/3] fbdev: fbmem: avoid exporting fb_center_logo Peter Rosin
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Rosin @ 2019-08-26 19:58 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Bartlomiej Zolnierkiewicz, Jonathan Corbet,
	dri-devel, linux-fbdev, linux-doc, Matthew Wilcox

Probably most useful if you only want one logo regardless of how many
CPU cores you have.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 Documentation/fb/fbcon.rst       | 5 +++++
 drivers/video/fbdev/core/fbcon.c | 7 +++++++
 drivers/video/fbdev/core/fbmem.c | 4 +++-
 include/linux/fb.h               | 1 +
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/Documentation/fb/fbcon.rst b/Documentation/fb/fbcon.rst
index 65ba40255137..9f0b399d8d4e 100644
--- a/Documentation/fb/fbcon.rst
+++ b/Documentation/fb/fbcon.rst
@@ -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. Zero 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
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index c9235a2f42f8..be4bc5540aad 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -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_strtoul(options, &options, 0);
+			continue;
+		}
 	}
 	return 1;
 }
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 64dd732021d8..a7d8022db516 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -56,6 +56,8 @@ EXPORT_SYMBOL(num_registered_fb);
 bool fb_center_logo __read_mostly;
 EXPORT_SYMBOL(fb_center_logo);
 
+unsigned int fb_logo_count __read_mostly;
+
 static struct fb_info *get_fb_info(unsigned int idx)
 {
 	struct fb_info *fb_info;
@@ -689,7 +691,7 @@ int fb_show_logo(struct fb_info *info, int rotate)
 	int y;
 
 	y = fb_show_logo_line(info, rotate, fb_logo.logo, 0,
-			      num_online_cpus());
+			      fb_logo_count ?: num_online_cpus());
 	y = fb_show_extra_logos(info, y, rotate);
 
 	return y;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 303771264644..5f2b05406262 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -630,6 +630,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 unsigned int fb_logo_count;
 extern struct class *fb_class;
 
 #define for_each_registered_fb(i)		\
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/3] fbdev: fbmem: avoid exporting fb_center_logo
  2019-08-26 19:58 [PATCH v2 0/3] Add possibility to specify the number of displayed logos Peter Rosin
  2019-08-26 19:58 ` [PATCH v2 1/3] fbdev: fix numbering of fbcon options Peter Rosin
  2019-08-26 19:58 ` [PATCH v2 2/3] fbdev: fbmem: allow overriding the number of bootup logos Peter Rosin
@ 2019-08-26 19:59 ` Peter Rosin
  2 siblings, 0 replies; 7+ messages in thread
From: Peter Rosin @ 2019-08-26 19:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Bartlomiej Zolnierkiewicz, Jonathan Corbet,
	dri-devel, linux-fbdev, linux-doc, Matthew Wilcox

The variable is only ever used from fbcon.c which is linked into the
same module. Therefore, the export is not needed.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/video/fbdev/core/fbmem.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index a7d8022db516..17e250a515b0 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -54,7 +54,6 @@ int num_registered_fb __read_mostly;
 EXPORT_SYMBOL(num_registered_fb);
 
 bool fb_center_logo __read_mostly;
-EXPORT_SYMBOL(fb_center_logo);
 
 unsigned int fb_logo_count __read_mostly;
 
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 2/3] fbdev: fbmem: allow overriding the number of bootup logos
  2019-08-26 19:58 ` [PATCH v2 2/3] fbdev: fbmem: allow overriding the number of bootup logos Peter Rosin
@ 2019-08-27  8:36   ` Geert Uytterhoeven
  2019-08-27  8:54     ` Peter Rosin
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2019-08-27  8:36 UTC (permalink / raw)
  To: Peter Rosin
  Cc: linux-kernel, Bartlomiej Zolnierkiewicz, Jonathan Corbet,
	dri-devel, linux-fbdev, linux-doc, Matthew Wilcox

Hi Peter,

On Mon, Aug 26, 2019 at 10:46 PM Peter Rosin <peda@axentia.se> wrote:
> Probably most useful if you only want one logo regardless of how many
> CPU cores you have.
>
> Signed-off-by: Peter Rosin <peda@axentia.se>

Thanks for your patch!

> --- a/Documentation/fb/fbcon.rst
> +++ b/Documentation/fb/fbcon.rst
> @@ -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. Zero gives the
> +       default, which is the number of online cpus.

Isn't that a bit unexpected for the user?
What about making -1 the default (auto), and zero meaning no logos?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 2/3] fbdev: fbmem: allow overriding the number of bootup logos
  2019-08-27  8:36   ` Geert Uytterhoeven
@ 2019-08-27  8:54     ` Peter Rosin
  2019-08-27  9:18       ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Rosin @ 2019-08-27  8:54 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-kernel, Bartlomiej Zolnierkiewicz, Jonathan Corbet,
	dri-devel, linux-fbdev, linux-doc, Matthew Wilcox

On 2019-08-27 10:36, Geert Uytterhoeven wrote:
> Hi Peter,
> 
> On Mon, Aug 26, 2019 at 10:46 PM Peter Rosin <peda@axentia.se> wrote:
>> Probably most useful if you only want one logo regardless of how many
>> CPU cores you have.
>>
>> Signed-off-by: Peter Rosin <peda@axentia.se>
> 
> Thanks for your patch!
> 
>> --- a/Documentation/fb/fbcon.rst
>> +++ b/Documentation/fb/fbcon.rst
>> @@ -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. Zero gives the
>> +       default, which is the number of online cpus.
> 
> Isn't that a bit unexpected for the user?
> What about making -1 the default (auto), and zero meaning no logos?

I just naively assumed there was some other mechanism to disable it.

Sigh, I'll take a look. v3 coming up...

Cheers,
Peter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 2/3] fbdev: fbmem: allow overriding the number of bootup logos
  2019-08-27  8:54     ` Peter Rosin
@ 2019-08-27  9:18       ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2019-08-27  9:18 UTC (permalink / raw)
  To: Peter Rosin
  Cc: linux-kernel, Bartlomiej Zolnierkiewicz, Jonathan Corbet,
	dri-devel, linux-fbdev, linux-doc, Matthew Wilcox

Hi Peter,

On Tue, Aug 27, 2019 at 10:54 AM Peter Rosin <peda@axentia.se> wrote:
> On 2019-08-27 10:36, Geert Uytterhoeven wrote:
> > On Mon, Aug 26, 2019 at 10:46 PM Peter Rosin <peda@axentia.se> wrote:
> >> Probably most useful if you only want one logo regardless of how many
> >> CPU cores you have.
> >>
> >> Signed-off-by: Peter Rosin <peda@axentia.se>
> >
> > Thanks for your patch!
> >
> >> --- a/Documentation/fb/fbcon.rst
> >> +++ b/Documentation/fb/fbcon.rst
> >> @@ -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. Zero gives the
> >> +       default, which is the number of online cpus.
> >
> > Isn't that a bit unexpected for the user?
> > What about making -1 the default (auto), and zero meaning no logos?
>
> I just naively assumed there was some other mechanism to disable it.

That was my first thought, too, but I couldn't find one.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-27  9:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26 19:58 [PATCH v2 0/3] Add possibility to specify the number of displayed logos Peter Rosin
2019-08-26 19:58 ` [PATCH v2 1/3] fbdev: fix numbering of fbcon options Peter Rosin
2019-08-26 19:58 ` [PATCH v2 2/3] fbdev: fbmem: allow overriding the number of bootup logos Peter Rosin
2019-08-27  8:36   ` Geert Uytterhoeven
2019-08-27  8:54     ` Peter Rosin
2019-08-27  9:18       ` Geert Uytterhoeven
2019-08-26 19:59 ` [PATCH v2 3/3] fbdev: fbmem: avoid exporting fb_center_logo Peter Rosin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).