linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] add config option to center the bootup logo
@ 2018-11-26 21:57 Peter Rosin
  2018-11-26 21:57 ` [PATCH 1/2] fbdev: fbmem: make fb_show_logo_line return the end instead of the height Peter Rosin
  2018-11-26 21:57 ` [PATCH 2/2] fbdev: fbmem: add config option to center the bootup logo Peter Rosin
  0 siblings, 2 replies; 15+ messages in thread
From: Peter Rosin @ 2018-11-26 21:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Bartlomiej Zolnierkiewicz, dri-devel, linux-fbdev

Hi!

I'm using these patches to get early display output at the center of
the screen. Maybe someone else will also find that useful?

Cheers,
Peter

Peter Rosin (2):
  fbdev: fbmem: make fb_show_logo_line return the end instead of the
    height
  fbdev: fbmem: add config option to center the bootup logo

 drivers/video/fbdev/core/fbmem.c | 31 +++++++++++++++++++++++++++----
 drivers/video/logo/Kconfig       |  9 +++++++++
 2 files changed, 36 insertions(+), 4 deletions(-)

-- 
2.11.0


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

* [PATCH 1/2] fbdev: fbmem: make fb_show_logo_line return the end instead of the height
  2018-11-26 21:57 [PATCH 0/2] add config option to center the bootup logo Peter Rosin
@ 2018-11-26 21:57 ` Peter Rosin
  2018-12-20 17:37   ` Bartlomiej Zolnierkiewicz
  2018-11-26 21:57 ` [PATCH 2/2] fbdev: fbmem: add config option to center the bootup logo Peter Rosin
  1 sibling, 1 reply; 15+ messages in thread
From: Peter Rosin @ 2018-11-26 21:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Bartlomiej Zolnierkiewicz, dri-devel, linux-fbdev

In preparation for allowing centering of the bootup logo, make
fb_show_logo_line return where the next free framebuffer line is,
instead of returning the height of the shown logo.

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

diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 861bf8081619..43d4047f472a 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -521,7 +521,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
 		info->pseudo_palette = saved_pseudo_palette;
 	kfree(logo_new);
 	kfree(logo_rotate);
-	return logo->height;
+	return image.dy + logo->height;
 }
 
 
@@ -573,8 +573,8 @@ static int fb_show_extra_logos(struct fb_info *info, int y, int rotate)
 	unsigned int i;
 
 	for (i = 0; i < fb_logo_ex_num; i++)
-		y += fb_show_logo_line(info, rotate,
-				       fb_logo_ex[i].logo, y, fb_logo_ex[i].n);
+		y = fb_show_logo_line(info, rotate,
+				      fb_logo_ex[i].logo, y, fb_logo_ex[i].n);
 
 	return y;
 }
-- 
2.11.0


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

* [PATCH 2/2] fbdev: fbmem: add config option to center the bootup logo
  2018-11-26 21:57 [PATCH 0/2] add config option to center the bootup logo Peter Rosin
  2018-11-26 21:57 ` [PATCH 1/2] fbdev: fbmem: make fb_show_logo_line return the end instead of the height Peter Rosin
@ 2018-11-26 21:57 ` Peter Rosin
  2018-12-20 17:38   ` Bartlomiej Zolnierkiewicz
  2019-01-06  9:33   ` Geert Uytterhoeven
  1 sibling, 2 replies; 15+ messages in thread
From: Peter Rosin @ 2018-11-26 21:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Bartlomiej Zolnierkiewicz, dri-devel, linux-fbdev

If there are extra logos (CONFIG_FB_LOGO_EXTRA) the heights of these
extra logos are not considered when centering the first logo vertically.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/video/fbdev/core/fbmem.c | 25 ++++++++++++++++++++++++-
 drivers/video/logo/Kconfig       |  9 +++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 43d4047f472a..fdbad029e5e6 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -502,8 +502,25 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
 		fb_set_logo(info, logo, logo_new, fb_logo.depth);
 	}
 
+#ifdef CONFIG_FB_LOGO_CENTER
+	{
+		int xres = info->var.xres;
+		int yres = info->var.yres;
+
+		if (rotate == FB_ROTATE_CW || rotate == FB_ROTATE_CCW) {
+			xres = info->var.yres;
+			yres = info->var.xres;
+		}
+
+		while (n && (n * (logo->width + 8) - 8 > xres))
+			--n;
+		image.dx = (xres - n * (logo->width + 8) - 8) / 2;
+		image.dy = y ?: (yres - logo->height) / 2;
+	}
+#else
 	image.dx = 0;
 	image.dy = y;
+#endif
 	image.width = logo->width;
 	image.height = logo->height;
 
@@ -600,6 +617,7 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
 {
 	int depth = fb_get_color_depth(&info->var, &info->fix);
 	unsigned int yres;
+	int height;
 
 	memset(&fb_logo, 0, sizeof(struct logo_data));
 
@@ -661,7 +679,12 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
  		}
  	}
 
-	return fb_prepare_extra_logos(info, fb_logo.logo->height, yres);
+	height = fb_logo.logo->height;
+#ifdef CONFIG_FB_LOGO_CENTER
+	height += (yres - fb_logo.logo->height) / 2;
+#endif
+
+	return fb_prepare_extra_logos(info, height, yres);
 }
 
 int fb_show_logo(struct fb_info *info, int rotate)
diff --git a/drivers/video/logo/Kconfig b/drivers/video/logo/Kconfig
index d1f6196c8b9a..1e972c4e88b1 100644
--- a/drivers/video/logo/Kconfig
+++ b/drivers/video/logo/Kconfig
@@ -10,6 +10,15 @@ menuconfig LOGO
 
 if LOGO
 
+config FB_LOGO_CENTER
+	bool "Center the logo"
+	depends on FB=y
+	help
+	  When this option is selected, the bootup logo is centered both
+	  horizontally and vertically. If more than one logo is displayed
+	  due to multiple CPUs, the collected line of logos is centered
+	  as a whole.
+
 config FB_LOGO_EXTRA
 	bool
 	depends on FB=y
-- 
2.11.0


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

* Re: [PATCH 1/2] fbdev: fbmem: make fb_show_logo_line return the end instead of the height
  2018-11-26 21:57 ` [PATCH 1/2] fbdev: fbmem: make fb_show_logo_line return the end instead of the height Peter Rosin
@ 2018-12-20 17:37   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 15+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-12-20 17:37 UTC (permalink / raw)
  To: Peter Rosin; +Cc: linux-kernel, dri-devel, linux-fbdev


On 11/26/2018 10:57 PM, Peter Rosin wrote:
> In preparation for allowing centering of the bootup logo, make
> fb_show_logo_line return where the next free framebuffer line is,
> instead of returning the height of the shown logo.
> 
> Signed-off-by: Peter Rosin <peda@axentia.se>

Patch queued for 4.21, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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

* Re: [PATCH 2/2] fbdev: fbmem: add config option to center the bootup logo
  2018-11-26 21:57 ` [PATCH 2/2] fbdev: fbmem: add config option to center the bootup logo Peter Rosin
@ 2018-12-20 17:38   ` Bartlomiej Zolnierkiewicz
  2019-01-06  9:33   ` Geert Uytterhoeven
  1 sibling, 0 replies; 15+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-12-20 17:38 UTC (permalink / raw)
  To: Peter Rosin; +Cc: linux-kernel, dri-devel, linux-fbdev


On 11/26/2018 10:57 PM, Peter Rosin wrote:
> If there are extra logos (CONFIG_FB_LOGO_EXTRA) the heights of these
> extra logos are not considered when centering the first logo vertically.
> 
> Signed-off-by: Peter Rosin <peda@axentia.se>

Patch queued for 4.21, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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

* Re: [PATCH 2/2] fbdev: fbmem: add config option to center the bootup logo
  2018-11-26 21:57 ` [PATCH 2/2] fbdev: fbmem: add config option to center the bootup logo Peter Rosin
  2018-12-20 17:38   ` Bartlomiej Zolnierkiewicz
@ 2019-01-06  9:33   ` Geert Uytterhoeven
  2019-01-07  8:26     ` [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line, option Peter Rosin
  1 sibling, 1 reply; 15+ messages in thread
From: Geert Uytterhoeven @ 2019-01-06  9:33 UTC (permalink / raw)
  To: Peter Rosin
  Cc: linux-kernel, Bartlomiej Zolnierkiewicz, dri-devel, linux-fbdev

Hi Peter,

On Mon, Nov 26, 2018 at 10:59 PM Peter Rosin <peda@axentia.se> wrote:
> If there are extra logos (CONFIG_FB_LOGO_EXTRA) the heights of these
> extra logos are not considered when centering the first logo vertically.
>
> Signed-off-by: Peter Rosin <peda@axentia.se>

> --- a/drivers/video/logo/Kconfig
> +++ b/drivers/video/logo/Kconfig
> @@ -10,6 +10,15 @@ menuconfig LOGO
>
>  if LOGO
>
> +config FB_LOGO_CENTER
> +       bool "Center the logo"
> +       depends on FB=y
> +       help
> +         When this option is selected, the bootup logo is centered both
> +         horizontally and vertically. If more than one logo is displayed
> +         due to multiple CPUs, the collected line of logos is centered
> +         as a whole.
> +

Isn't a kernel command line option more suitable to configure the position
of the logo?

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] 15+ messages in thread

* [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line, option
  2019-01-06  9:33   ` Geert Uytterhoeven
@ 2019-01-07  8:26     ` Peter Rosin
  2019-01-07  8:40       ` Geert Uytterhoeven
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Rosin @ 2019-01-07  8:26 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Geert Uytterhoeven, linux-kernel, dri-devel, linux-fbdev,
	Jonathan Corbet, Linux Documentation List

On 2019-01-06 10:33, Geert Uytterhoeven wrote:
> Hi Peter,
> 
> On Mon, Nov 26, 2018 at 10:59 PM Peter Rosin <peda@axentia.se> wrote:
>> If there are extra logos (CONFIG_FB_LOGO_EXTRA) the heights of these
>> extra logos are not considered when centering the first logo vertically.
>>
>> Signed-off-by: Peter Rosin <peda@axentia.se>
> 
>> --- a/drivers/video/logo/Kconfig
>> +++ b/drivers/video/logo/Kconfig
>> @@ -10,6 +10,15 @@ menuconfig LOGO
>>
>>  if LOGO
>>
>> +config FB_LOGO_CENTER
>> +       bool "Center the logo"
>> +       depends on FB=y
>> +       help
>> +         When this option is selected, the bootup logo is centered both
>> +         horizontally and vertically. If more than one logo is displayed
>> +         due to multiple CPUs, the collected line of logos is centered
>> +         as a whole.
>> +
> 
> Isn't a kernel command line option more suitable to configure the position
> of the logo?

That didn't occur to me previously, but it does make sense now that you
mention it. This is on top of v5.0-rc1, and if applied before v5.0 we
can avoid possible regressions for folks who might start to rely on
CONFIG_FB_LOGO_CENTER if v5.0 is released w/o this.

Cheers,
Peter

From de7353ab519ba9b5c9ea3f62d607bb8e94b687cc Mon Sep 17 00:00:00 2001
From: Peter Rosin <peda@axentia.se>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Peter Rosin <peda@axentia.se>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Cc: linux-doc@vger.kernel.org
To: linux-kernel@vger.kernel.org
Date: Mon, 7 Jan 2019 08:35:26 +0100
Subject: [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line
 option

A command line option is much more flexible than a config option and
the supporting code is small. Gets rid of #ifdefs in the code too...

Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Peter Rosin <peda@axentia.se>
---
 Documentation/fb/fbcon.txt       |  6 ++++++
 drivers/video/fbdev/core/fbcon.c |  5 +++++
 drivers/video/fbdev/core/fbmem.c | 19 ++++++++++---------
 drivers/video/logo/Kconfig       |  9 ---------
 include/linux/fb.h               |  1 +
 5 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/Documentation/fb/fbcon.txt b/Documentation/fb/fbcon.txt
index 62af30511a95..fb5fa0a8d553 100644
--- a/Documentation/fb/fbcon.txt
+++ b/Documentation/fb/fbcon.txt
@@ -163,6 +163,12 @@ C. Boot options
 	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=center-logo
+
+	When this option is selected, the bootup logo is centered both
+	horizontally and vertically. If more than one logo is displayed due to
+	multiple CPUs, the collected line of logos is centered as a whole.
+
 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 8976190b6c1f..552cfee63d76 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -510,6 +510,11 @@ static int __init fb_console_setup(char *this_opt)
 			continue;
 		}
 #endif
+
+		if (!strcmp(options, "center-logo")) {
+			fb_center_logo = true;
+			continue;
+		}
 	}
 	return 1;
 }
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 558ed2ed3124..cb43a2258c51 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -53,6 +53,9 @@ EXPORT_SYMBOL(registered_fb);
 int num_registered_fb __read_mostly;
 EXPORT_SYMBOL(num_registered_fb);
 
+bool fb_center_logo __read_mostly;
+EXPORT_SYMBOL(fb_center_logo);
+
 static struct fb_info *get_fb_info(unsigned int idx)
 {
 	struct fb_info *fb_info;
@@ -506,8 +509,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
 		fb_set_logo(info, logo, logo_new, fb_logo.depth);
 	}
 
-#ifdef CONFIG_FB_LOGO_CENTER
-	{
+	if (fb_center_logo) {
 		int xres = info->var.xres;
 		int yres = info->var.yres;
 
@@ -520,11 +522,11 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
 			--n;
 		image.dx = (xres - n * (logo->width + 8) - 8) / 2;
 		image.dy = y ?: (yres - logo->height) / 2;
+	} else {
+		image.dx = 0;
+		image.dy = y;
 	}
-#else
-	image.dx = 0;
-	image.dy = y;
-#endif
+
 	image.width = logo->width;
 	image.height = logo->height;
 
@@ -684,9 +686,8 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
  	}
 
 	height = fb_logo.logo->height;
-#ifdef CONFIG_FB_LOGO_CENTER
-	height += (yres - fb_logo.logo->height) / 2;
-#endif
+	if (fb_center_logo)
+		height += (yres - fb_logo.logo->height) / 2;
 
 	return fb_prepare_extra_logos(info, height, yres);
 }
diff --git a/drivers/video/logo/Kconfig b/drivers/video/logo/Kconfig
index 1e972c4e88b1..d1f6196c8b9a 100644
--- a/drivers/video/logo/Kconfig
+++ b/drivers/video/logo/Kconfig
@@ -10,15 +10,6 @@ menuconfig LOGO
 
 if LOGO
 
-config FB_LOGO_CENTER
-	bool "Center the logo"
-	depends on FB=y
-	help
-	  When this option is selected, the bootup logo is centered both
-	  horizontally and vertically. If more than one logo is displayed
-	  due to multiple CPUs, the collected line of logos is centered
-	  as a whole.
-
 config FB_LOGO_EXTRA
 	bool
 	depends on FB=y
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 7cdd31a69719..f52ef0ad6781 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -653,6 +653,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 struct class *fb_class;
 
 #define for_each_registered_fb(i)		\
-- 
2.11.0


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

* Re: [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line, option
  2019-01-07  8:26     ` [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line, option Peter Rosin
@ 2019-01-07  8:40       ` Geert Uytterhoeven
  2019-01-07  8:59         ` Peter Rosin
  0 siblings, 1 reply; 15+ messages in thread
From: Geert Uytterhoeven @ 2019-01-07  8:40 UTC (permalink / raw)
  To: Peter Rosin
  Cc: Bartlomiej Zolnierkiewicz, linux-kernel, dri-devel, linux-fbdev,
	Jonathan Corbet, Linux Documentation List

Hi Peter,

On Mon, Jan 7, 2019 at 9:26 AM Peter Rosin <peda@axentia.se> wrote:
> On 2019-01-06 10:33, Geert Uytterhoeven wrote:
> > On Mon, Nov 26, 2018 at 10:59 PM Peter Rosin <peda@axentia.se> wrote:
> >> If there are extra logos (CONFIG_FB_LOGO_EXTRA) the heights of these
> >> extra logos are not considered when centering the first logo vertically.
> >>
> >> Signed-off-by: Peter Rosin <peda@axentia.se>
> >
> >> --- a/drivers/video/logo/Kconfig
> >> +++ b/drivers/video/logo/Kconfig
> >> @@ -10,6 +10,15 @@ menuconfig LOGO
> >>
> >>  if LOGO
> >>
> >> +config FB_LOGO_CENTER
> >> +       bool "Center the logo"
> >> +       depends on FB=y
> >> +       help
> >> +         When this option is selected, the bootup logo is centered both
> >> +         horizontally and vertically. If more than one logo is displayed
> >> +         due to multiple CPUs, the collected line of logos is centered
> >> +         as a whole.
> >> +
> >
> > Isn't a kernel command line option more suitable to configure the position
> > of the logo?
>
> That didn't occur to me previously, but it does make sense now that you
> mention it. This is on top of v5.0-rc1, and if applied before v5.0 we
> can avoid possible regressions for folks who might start to rely on
> CONFIG_FB_LOGO_CENTER if v5.0 is released w/o this.
>
> Cheers,
> Peter
>
> From de7353ab519ba9b5c9ea3f62d607bb8e94b687cc Mon Sep 17 00:00:00 2001
> From: Peter Rosin <peda@axentia.se>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Peter Rosin <peda@axentia.se>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-fbdev@vger.kernel.org
> Cc: linux-doc@vger.kernel.org
> To: linux-kernel@vger.kernel.org
> Date: Mon, 7 Jan 2019 08:35:26 +0100
> Subject: [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line
>  option
>
> A command line option is much more flexible than a config option and
> the supporting code is small. Gets rid of #ifdefs in the code too...
>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Peter Rosin <peda@axentia.se>

Thanks for your patch!

> --- a/Documentation/fb/fbcon.txt
> +++ b/Documentation/fb/fbcon.txt
> @@ -163,6 +163,12 @@ C. Boot options
>         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=center-logo
> +
> +       When this option is selected, the bootup logo is centered both
> +       horizontally and vertically. If more than one logo is displayed due to
> +       multiple CPUs, the collected line of logos is centered as a whole.
> +

What about making this more generic, than an option specific for centering?
Else people want fbcon=left-logo or fbcon=right-logo soon?

    fbcon=logo-pos:<pos>

With <pos> being "center", "left", "top", "right", "bottom", and combinations
like "top,center"? Or is that complicating stuff too much?

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] 15+ messages in thread

* Re: [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line, option
  2019-01-07  8:40       ` Geert Uytterhoeven
@ 2019-01-07  8:59         ` Peter Rosin
  2019-01-07  9:02           ` Peter Rosin
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Rosin @ 2019-01-07  8:59 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Bartlomiej Zolnierkiewicz, linux-kernel, dri-devel, linux-fbdev,
	Jonathan Corbet, Linux Documentation List

On 2019-01-07 09:40, Geert Uytterhoeven wrote:
> Hi Peter,
> 
> On Mon, Jan 7, 2019 at 9:26 AM Peter Rosin <peda@axentia.se> wrote:
>> On 2019-01-06 10:33, Geert Uytterhoeven wrote:
>>> On Mon, Nov 26, 2018 at 10:59 PM Peter Rosin <peda@axentia.se> wrote:
>>>> If there are extra logos (CONFIG_FB_LOGO_EXTRA) the heights of these
>>>> extra logos are not considered when centering the first logo vertically.
>>>>
>>>> Signed-off-by: Peter Rosin <peda@axentia.se>
>>>
>>>> --- a/drivers/video/logo/Kconfig
>>>> +++ b/drivers/video/logo/Kconfig
>>>> @@ -10,6 +10,15 @@ menuconfig LOGO
>>>>
>>>>  if LOGO
>>>>
>>>> +config FB_LOGO_CENTER
>>>> +       bool "Center the logo"
>>>> +       depends on FB=y
>>>> +       help
>>>> +         When this option is selected, the bootup logo is centered both
>>>> +         horizontally and vertically. If more than one logo is displayed
>>>> +         due to multiple CPUs, the collected line of logos is centered
>>>> +         as a whole.
>>>> +
>>>
>>> Isn't a kernel command line option more suitable to configure the position
>>> of the logo?
>>
>> That didn't occur to me previously, but it does make sense now that you
>> mention it. This is on top of v5.0-rc1, and if applied before v5.0 we
>> can avoid possible regressions for folks who might start to rely on
>> CONFIG_FB_LOGO_CENTER if v5.0 is released w/o this.
>>
>> Cheers,
>> Peter
>>
>> From de7353ab519ba9b5c9ea3f62d607bb8e94b687cc Mon Sep 17 00:00:00 2001
>> From: Peter Rosin <peda@axentia.se>
>> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>> Cc: Jonathan Corbet <corbet@lwn.net>
>> Cc: Peter Rosin <peda@axentia.se>
>> Cc: dri-devel@lists.freedesktop.org
>> Cc: linux-fbdev@vger.kernel.org
>> Cc: linux-doc@vger.kernel.org
>> To: linux-kernel@vger.kernel.org
>> Date: Mon, 7 Jan 2019 08:35:26 +0100
>> Subject: [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line
>>  option
>>
>> A command line option is much more flexible than a config option and
>> the supporting code is small. Gets rid of #ifdefs in the code too...
>>
>> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> Signed-off-by: Peter Rosin <peda@axentia.se>
> 
> Thanks for your patch!
> 
>> --- a/Documentation/fb/fbcon.txt
>> +++ b/Documentation/fb/fbcon.txt
>> @@ -163,6 +163,12 @@ C. Boot options
>>         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=center-logo
>> +
>> +       When this option is selected, the bootup logo is centered both
>> +       horizontally and vertically. If more than one logo is displayed due to
>> +       multiple CPUs, the collected line of logos is centered as a whole.
>> +
> 
> What about making this more generic, than an option specific for centering?
> Else people want fbcon=left-logo or fbcon=right-logo soon?
> 
>     fbcon=logo-pos:<pos>
> 
> With <pos> being "center", "left", "top", "right", "bottom", and combinations
> like "top,center"? Or is that complicating stuff too much?

I'm not too keen on implementing all that when I have zero use for it. I can
however rename the trigger for the existing fb_center_logo bool to

	fbcon=logo-pos:center

and add a check for "top,left" to reset the bool to false. Then the other
variants can be added later by whomever and when needed.

Is that good enough?

Cheers,
Peter

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

* Re: [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line, option
  2019-01-07  8:59         ` Peter Rosin
@ 2019-01-07  9:02           ` Peter Rosin
  2019-01-07  9:11             ` Geert Uytterhoeven
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Rosin @ 2019-01-07  9:02 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Bartlomiej Zolnierkiewicz, linux-kernel, dri-devel, linux-fbdev,
	Jonathan Corbet, Linux Documentation List

On 2019-01-07 09:59, Peter Rosin wrote:
> On 2019-01-07 09:40, Geert Uytterhoeven wrote:
>> Hi Peter,
>>
>> On Mon, Jan 7, 2019 at 9:26 AM Peter Rosin <peda@axentia.se> wrote:
>>> On 2019-01-06 10:33, Geert Uytterhoeven wrote:
>>>> On Mon, Nov 26, 2018 at 10:59 PM Peter Rosin <peda@axentia.se> wrote:
>>>>> If there are extra logos (CONFIG_FB_LOGO_EXTRA) the heights of these
>>>>> extra logos are not considered when centering the first logo vertically.
>>>>>
>>>>> Signed-off-by: Peter Rosin <peda@axentia.se>
>>>>
>>>>> --- a/drivers/video/logo/Kconfig
>>>>> +++ b/drivers/video/logo/Kconfig
>>>>> @@ -10,6 +10,15 @@ menuconfig LOGO
>>>>>
>>>>>  if LOGO
>>>>>
>>>>> +config FB_LOGO_CENTER
>>>>> +       bool "Center the logo"
>>>>> +       depends on FB=y
>>>>> +       help
>>>>> +         When this option is selected, the bootup logo is centered both
>>>>> +         horizontally and vertically. If more than one logo is displayed
>>>>> +         due to multiple CPUs, the collected line of logos is centered
>>>>> +         as a whole.
>>>>> +
>>>>
>>>> Isn't a kernel command line option more suitable to configure the position
>>>> of the logo?
>>>
>>> That didn't occur to me previously, but it does make sense now that you
>>> mention it. This is on top of v5.0-rc1, and if applied before v5.0 we
>>> can avoid possible regressions for folks who might start to rely on
>>> CONFIG_FB_LOGO_CENTER if v5.0 is released w/o this.
>>>
>>> Cheers,
>>> Peter
>>>
>>> From de7353ab519ba9b5c9ea3f62d607bb8e94b687cc Mon Sep 17 00:00:00 2001
>>> From: Peter Rosin <peda@axentia.se>
>>> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>> Cc: Peter Rosin <peda@axentia.se>
>>> Cc: dri-devel@lists.freedesktop.org
>>> Cc: linux-fbdev@vger.kernel.org
>>> Cc: linux-doc@vger.kernel.org
>>> To: linux-kernel@vger.kernel.org
>>> Date: Mon, 7 Jan 2019 08:35:26 +0100
>>> Subject: [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line
>>>  option
>>>
>>> A command line option is much more flexible than a config option and
>>> the supporting code is small. Gets rid of #ifdefs in the code too...
>>>
>>> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>> Signed-off-by: Peter Rosin <peda@axentia.se>
>>
>> Thanks for your patch!
>>
>>> --- a/Documentation/fb/fbcon.txt
>>> +++ b/Documentation/fb/fbcon.txt
>>> @@ -163,6 +163,12 @@ C. Boot options
>>>         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=center-logo
>>> +
>>> +       When this option is selected, the bootup logo is centered both
>>> +       horizontally and vertically. If more than one logo is displayed due to
>>> +       multiple CPUs, the collected line of logos is centered as a whole.
>>> +
>>
>> What about making this more generic, than an option specific for centering?
>> Else people want fbcon=left-logo or fbcon=right-logo soon?
>>
>>     fbcon=logo-pos:<pos>
>>
>> With <pos> being "center", "left", "top", "right", "bottom", and combinations
>> like "top,center"? Or is that complicating stuff too much?
> 
> I'm not too keen on implementing all that when I have zero use for it. I can
> however rename the trigger for the existing fb_center_logo bool to
> 
> 	fbcon=logo-pos:center
> 
> and add a check for "top,left" to reset the bool to false. Then the other
> variants can be added later by whomever and when needed.
> 
> Is that good enough?

Ouch, I just realized that using a comma is a no-go, as that is already
separating fbcon suboptions, so I suggest top-left instead.

Cheers,
Peter

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

* Re: [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line, option
  2019-01-07  9:02           ` Peter Rosin
@ 2019-01-07  9:11             ` Geert Uytterhoeven
  2019-01-07 10:35               ` [PATCH v2] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd, line option Peter Rosin
  0 siblings, 1 reply; 15+ messages in thread
From: Geert Uytterhoeven @ 2019-01-07  9:11 UTC (permalink / raw)
  To: Peter Rosin
  Cc: Bartlomiej Zolnierkiewicz, linux-kernel, dri-devel, linux-fbdev,
	Jonathan Corbet, Linux Documentation List

Hi Peter,

On Mon, Jan 7, 2019 at 10:03 AM Peter Rosin <peda@axentia.se> wrote:
> On 2019-01-07 09:59, Peter Rosin wrote:
> > On 2019-01-07 09:40, Geert Uytterhoeven wrote:
> >> On Mon, Jan 7, 2019 at 9:26 AM Peter Rosin <peda@axentia.se> wrote:
> >>> On 2019-01-06 10:33, Geert Uytterhoeven wrote:
> >>>> On Mon, Nov 26, 2018 at 10:59 PM Peter Rosin <peda@axentia.se> wrote:
> >>>>> If there are extra logos (CONFIG_FB_LOGO_EXTRA) the heights of these
> >>>>> extra logos are not considered when centering the first logo vertically.
> >>>>>
> >>>>> Signed-off-by: Peter Rosin <peda@axentia.se>
> >>>>
> >>>>> --- a/drivers/video/logo/Kconfig
> >>>>> +++ b/drivers/video/logo/Kconfig
> >>>>> @@ -10,6 +10,15 @@ menuconfig LOGO
> >>>>>
> >>>>>  if LOGO
> >>>>>
> >>>>> +config FB_LOGO_CENTER
> >>>>> +       bool "Center the logo"
> >>>>> +       depends on FB=y
> >>>>> +       help
> >>>>> +         When this option is selected, the bootup logo is centered both
> >>>>> +         horizontally and vertically. If more than one logo is displayed
> >>>>> +         due to multiple CPUs, the collected line of logos is centered
> >>>>> +         as a whole.
> >>>>> +
> >>>>
> >>>> Isn't a kernel command line option more suitable to configure the position
> >>>> of the logo?
> >>>
> >>> That didn't occur to me previously, but it does make sense now that you
> >>> mention it. This is on top of v5.0-rc1, and if applied before v5.0 we
> >>> can avoid possible regressions for folks who might start to rely on
> >>> CONFIG_FB_LOGO_CENTER if v5.0 is released w/o this.
> >>>
> >>> Cheers,
> >>> Peter
> >>>
> >>> From de7353ab519ba9b5c9ea3f62d607bb8e94b687cc Mon Sep 17 00:00:00 2001
> >>> From: Peter Rosin <peda@axentia.se>
> >>> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> >>> Cc: Jonathan Corbet <corbet@lwn.net>
> >>> Cc: Peter Rosin <peda@axentia.se>
> >>> Cc: dri-devel@lists.freedesktop.org
> >>> Cc: linux-fbdev@vger.kernel.org
> >>> Cc: linux-doc@vger.kernel.org
> >>> To: linux-kernel@vger.kernel.org
> >>> Date: Mon, 7 Jan 2019 08:35:26 +0100
> >>> Subject: [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line
> >>>  option
> >>>
> >>> A command line option is much more flexible than a config option and
> >>> the supporting code is small. Gets rid of #ifdefs in the code too...
> >>>
> >>> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> >>> Signed-off-by: Peter Rosin <peda@axentia.se>
> >>
> >> Thanks for your patch!
> >>
> >>> --- a/Documentation/fb/fbcon.txt
> >>> +++ b/Documentation/fb/fbcon.txt
> >>> @@ -163,6 +163,12 @@ C. Boot options
> >>>         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=center-logo
> >>> +
> >>> +       When this option is selected, the bootup logo is centered both
> >>> +       horizontally and vertically. If more than one logo is displayed due to
> >>> +       multiple CPUs, the collected line of logos is centered as a whole.
> >>> +
> >>
> >> What about making this more generic, than an option specific for centering?
> >> Else people want fbcon=left-logo or fbcon=right-logo soon?
> >>
> >>     fbcon=logo-pos:<pos>
> >>
> >> With <pos> being "center", "left", "top", "right", "bottom", and combinations
> >> like "top,center"? Or is that complicating stuff too much?
> >
> > I'm not too keen on implementing all that when I have zero use for it. I can
> > however rename the trigger for the existing fb_center_logo bool to
> >
> >       fbcon=logo-pos:center
> >
> > and add a check for "top,left" to reset the bool to false. Then the other
> > variants can be added later by whomever and when needed.
> >
> > Is that good enough?
>
> Ouch, I just realized that using a comma is a no-go, as that is already
> separating fbcon suboptions, so I suggest top-left instead.

Sure, sounds fine to me.  I just want to avoid having a parameter system
that complicates future extension.
I think you can drop the check for top-left, as the bool defaults to false.

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] 15+ messages in thread

* [PATCH v2] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd, line option
  2019-01-07  9:11             ` Geert Uytterhoeven
@ 2019-01-07 10:35               ` Peter Rosin
  2019-01-16 16:45                 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Rosin @ 2019-01-07 10:35 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Geert Uytterhoeven, linux-kernel, dri-devel, linux-fbdev,
	Jonathan Corbet, Linux Documentation List

On 2019-01-07 10:11, Geert Uytterhoeven wrote:
> Hi Peter,
> 
> On Mon, Jan 7, 2019 at 10:03 AM Peter Rosin <peda@axentia.se> wrote:
>> On 2019-01-07 09:59, Peter Rosin wrote:
>>> On 2019-01-07 09:40, Geert Uytterhoeven wrote:
>>>> On Mon, Jan 7, 2019 at 9:26 AM Peter Rosin <peda@axentia.se> wrote:
>>>>> On 2019-01-06 10:33, Geert Uytterhoeven wrote:
>>>>>> On Mon, Nov 26, 2018 at 10:59 PM Peter Rosin <peda@axentia.se> wrote:
>>>>>>> If there are extra logos (CONFIG_FB_LOGO_EXTRA) the heights of these
>>>>>>> extra logos are not considered when centering the first logo vertically.
>>>>>>>
>>>>>>> Signed-off-by: Peter Rosin <peda@axentia.se>
>>>>>>
>>>>>>> --- a/drivers/video/logo/Kconfig
>>>>>>> +++ b/drivers/video/logo/Kconfig
>>>>>>> @@ -10,6 +10,15 @@ menuconfig LOGO
>>>>>>>
>>>>>>>  if LOGO
>>>>>>>
>>>>>>> +config FB_LOGO_CENTER
>>>>>>> +       bool "Center the logo"
>>>>>>> +       depends on FB=y
>>>>>>> +       help
>>>>>>> +         When this option is selected, the bootup logo is centered both
>>>>>>> +         horizontally and vertically. If more than one logo is displayed
>>>>>>> +         due to multiple CPUs, the collected line of logos is centered
>>>>>>> +         as a whole.
>>>>>>> +
>>>>>>
>>>>>> Isn't a kernel command line option more suitable to configure the position
>>>>>> of the logo?
>>>>>
>>>>> That didn't occur to me previously, but it does make sense now that you
>>>>> mention it. This is on top of v5.0-rc1, and if applied before v5.0 we
>>>>> can avoid possible regressions for folks who might start to rely on
>>>>> CONFIG_FB_LOGO_CENTER if v5.0 is released w/o this.
>>>>>
>>>>> Cheers,
>>>>> Peter
>>>>>
>>>>> From de7353ab519ba9b5c9ea3f62d607bb8e94b687cc Mon Sep 17 00:00:00 2001
>>>>> From: Peter Rosin <peda@axentia.se>
>>>>> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>>>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>>>> Cc: Peter Rosin <peda@axentia.se>
>>>>> Cc: dri-devel@lists.freedesktop.org
>>>>> Cc: linux-fbdev@vger.kernel.org
>>>>> Cc: linux-doc@vger.kernel.org
>>>>> To: linux-kernel@vger.kernel.org
>>>>> Date: Mon, 7 Jan 2019 08:35:26 +0100
>>>>> Subject: [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line
>>>>>  option
>>>>>
>>>>> A command line option is much more flexible than a config option and
>>>>> the supporting code is small. Gets rid of #ifdefs in the code too...
>>>>>
>>>>> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>>>> Signed-off-by: Peter Rosin <peda@axentia.se>
>>>>
>>>> Thanks for your patch!
>>>>
>>>>> --- a/Documentation/fb/fbcon.txt
>>>>> +++ b/Documentation/fb/fbcon.txt
>>>>> @@ -163,6 +163,12 @@ C. Boot options
>>>>>         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=center-logo
>>>>> +
>>>>> +       When this option is selected, the bootup logo is centered both
>>>>> +       horizontally and vertically. If more than one logo is displayed due to
>>>>> +       multiple CPUs, the collected line of logos is centered as a whole.
>>>>> +
>>>>
>>>> What about making this more generic, than an option specific for centering?
>>>> Else people want fbcon=left-logo or fbcon=right-logo soon?
>>>>
>>>>     fbcon=logo-pos:<pos>
>>>>
>>>> With <pos> being "center", "left", "top", "right", "bottom", and combinations
>>>> like "top,center"? Or is that complicating stuff too much?
>>>
>>> I'm not too keen on implementing all that when I have zero use for it. I can
>>> however rename the trigger for the existing fb_center_logo bool to
>>>
>>>       fbcon=logo-pos:center
>>>
>>> and add a check for "top,left" to reset the bool to false. Then the other
>>> variants can be added later by whomever and when needed.
>>>
>>> Is that good enough?
>>
>> Ouch, I just realized that using a comma is a no-go, as that is already
>> separating fbcon suboptions, so I suggest top-left instead.
> 
> Sure, sounds fine to me.  I just want to avoid having a parameter system
> that complicates future extension.
> I think you can drop the check for top-left, as the bool defaults to false.

Right. So, here's an update...

Again, it would probably be best if this went in before 5.0 is released.

Changes since v1:
- rename from fbcon=center-logo option to fbcon=logo-pos:center (and adjust
  the help text accordingly).

Cheers,
Peter

From ebfb2feb7ea4298ac9c222e6ea6f9c9a92452084 Mon Sep 17 00:00:00 2001
From: Peter Rosin <peda@axentia.se>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Peter Rosin <peda@axentia.se>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Cc: linux-doc@vger.kernel.org
To: linux-kernel@vger.kernel.org
Date: Mon, 7 Jan 2019 08:35:26 +0100
Subject: [PATCH v2] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd
 line option

A command line option is much more flexible than a config option and
the supporting code is small. Gets rid of #ifdefs in the code too...

Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Peter Rosin <peda@axentia.se>
---
 Documentation/fb/fbcon.txt       |  8 ++++++++
 drivers/video/fbdev/core/fbcon.c |  7 +++++++
 drivers/video/fbdev/core/fbmem.c | 19 ++++++++++---------
 drivers/video/logo/Kconfig       |  9 ---------
 include/linux/fb.h               |  1 +
 5 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/Documentation/fb/fbcon.txt b/Documentation/fb/fbcon.txt
index 62af30511a95..60a5ec04e8f0 100644
--- a/Documentation/fb/fbcon.txt
+++ b/Documentation/fb/fbcon.txt
@@ -163,6 +163,14 @@ C. Boot options
 	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>
+
+	The only possible 'location' is 'center' (without quotes), and when
+	given, the bootup logo is moved from the default top-left corner
+	location to the center of the framebuffer. If more than one logo is
+	displayed due to multiple CPUs, the collected line of logos is moved
+	as a whole.
+
 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 8976190b6c1f..bfa1360ec750 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -510,6 +510,13 @@ static int __init fb_console_setup(char *this_opt)
 			continue;
 		}
 #endif
+
+		if (!strncmp(options, "logo-pos:", 9)) {
+			options += 9;
+			if (!strcmp(options, "center"))
+				fb_center_logo = true;
+			continue;
+		}
 	}
 	return 1;
 }
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 558ed2ed3124..cb43a2258c51 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -53,6 +53,9 @@ EXPORT_SYMBOL(registered_fb);
 int num_registered_fb __read_mostly;
 EXPORT_SYMBOL(num_registered_fb);
 
+bool fb_center_logo __read_mostly;
+EXPORT_SYMBOL(fb_center_logo);
+
 static struct fb_info *get_fb_info(unsigned int idx)
 {
 	struct fb_info *fb_info;
@@ -506,8 +509,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
 		fb_set_logo(info, logo, logo_new, fb_logo.depth);
 	}
 
-#ifdef CONFIG_FB_LOGO_CENTER
-	{
+	if (fb_center_logo) {
 		int xres = info->var.xres;
 		int yres = info->var.yres;
 
@@ -520,11 +522,11 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
 			--n;
 		image.dx = (xres - n * (logo->width + 8) - 8) / 2;
 		image.dy = y ?: (yres - logo->height) / 2;
+	} else {
+		image.dx = 0;
+		image.dy = y;
 	}
-#else
-	image.dx = 0;
-	image.dy = y;
-#endif
+
 	image.width = logo->width;
 	image.height = logo->height;
 
@@ -684,9 +686,8 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
  	}
 
 	height = fb_logo.logo->height;
-#ifdef CONFIG_FB_LOGO_CENTER
-	height += (yres - fb_logo.logo->height) / 2;
-#endif
+	if (fb_center_logo)
+		height += (yres - fb_logo.logo->height) / 2;
 
 	return fb_prepare_extra_logos(info, height, yres);
 }
diff --git a/drivers/video/logo/Kconfig b/drivers/video/logo/Kconfig
index 1e972c4e88b1..d1f6196c8b9a 100644
--- a/drivers/video/logo/Kconfig
+++ b/drivers/video/logo/Kconfig
@@ -10,15 +10,6 @@ menuconfig LOGO
 
 if LOGO
 
-config FB_LOGO_CENTER
-	bool "Center the logo"
-	depends on FB=y
-	help
-	  When this option is selected, the bootup logo is centered both
-	  horizontally and vertically. If more than one logo is displayed
-	  due to multiple CPUs, the collected line of logos is centered
-	  as a whole.
-
 config FB_LOGO_EXTRA
 	bool
 	depends on FB=y
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 7cdd31a69719..f52ef0ad6781 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -653,6 +653,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 struct class *fb_class;
 
 #define for_each_registered_fb(i)		\
-- 
2.11.0


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

* Re: [PATCH v2] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd, line option
  2019-01-07 10:35               ` [PATCH v2] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd, line option Peter Rosin
@ 2019-01-16 16:45                 ` Bartlomiej Zolnierkiewicz
  2019-01-17 13:40                   ` Peter Rosin
  0 siblings, 1 reply; 15+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2019-01-16 16:45 UTC (permalink / raw)
  To: Peter Rosin
  Cc: Geert Uytterhoeven, linux-kernel, dri-devel, linux-fbdev,
	Jonathan Corbet, Linux Documentation List


On 01/07/2019 11:35 AM, Peter Rosin wrote:
> On 2019-01-07 10:11, Geert Uytterhoeven wrote:
>> Hi Peter,
>>
>> On Mon, Jan 7, 2019 at 10:03 AM Peter Rosin <peda@axentia.se> wrote:
>>> On 2019-01-07 09:59, Peter Rosin wrote:
>>>> On 2019-01-07 09:40, Geert Uytterhoeven wrote:
>>>>> On Mon, Jan 7, 2019 at 9:26 AM Peter Rosin <peda@axentia.se> wrote:
>>>>>> On 2019-01-06 10:33, Geert Uytterhoeven wrote:
>>>>>>> On Mon, Nov 26, 2018 at 10:59 PM Peter Rosin <peda@axentia.se> wrote:
>>>>>>>> If there are extra logos (CONFIG_FB_LOGO_EXTRA) the heights of these
>>>>>>>> extra logos are not considered when centering the first logo vertically.
>>>>>>>>
>>>>>>>> Signed-off-by: Peter Rosin <peda@axentia.se>
>>>>>>>
>>>>>>>> --- a/drivers/video/logo/Kconfig
>>>>>>>> +++ b/drivers/video/logo/Kconfig
>>>>>>>> @@ -10,6 +10,15 @@ menuconfig LOGO
>>>>>>>>
>>>>>>>>  if LOGO
>>>>>>>>
>>>>>>>> +config FB_LOGO_CENTER
>>>>>>>> +       bool "Center the logo"
>>>>>>>> +       depends on FB=y
>>>>>>>> +       help
>>>>>>>> +         When this option is selected, the bootup logo is centered both
>>>>>>>> +         horizontally and vertically. If more than one logo is displayed
>>>>>>>> +         due to multiple CPUs, the collected line of logos is centered
>>>>>>>> +         as a whole.
>>>>>>>> +
>>>>>>>
>>>>>>> Isn't a kernel command line option more suitable to configure the position
>>>>>>> of the logo?
>>>>>>
>>>>>> That didn't occur to me previously, but it does make sense now that you
>>>>>> mention it. This is on top of v5.0-rc1, and if applied before v5.0 we
>>>>>> can avoid possible regressions for folks who might start to rely on
>>>>>> CONFIG_FB_LOGO_CENTER if v5.0 is released w/o this.
>>>>>>
>>>>>> Cheers,
>>>>>> Peter
>>>>>>
>>>>>> From de7353ab519ba9b5c9ea3f62d607bb8e94b687cc Mon Sep 17 00:00:00 2001
>>>>>> From: Peter Rosin <peda@axentia.se>
>>>>>> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>>>>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>>>>> Cc: Peter Rosin <peda@axentia.se>
>>>>>> Cc: dri-devel@lists.freedesktop.org
>>>>>> Cc: linux-fbdev@vger.kernel.org
>>>>>> Cc: linux-doc@vger.kernel.org
>>>>>> To: linux-kernel@vger.kernel.org
>>>>>> Date: Mon, 7 Jan 2019 08:35:26 +0100
>>>>>> Subject: [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line
>>>>>>  option
>>>>>>
>>>>>> A command line option is much more flexible than a config option and
>>>>>> the supporting code is small. Gets rid of #ifdefs in the code too...
>>>>>>
>>>>>> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>>>>> Signed-off-by: Peter Rosin <peda@axentia.se>
>>>>>
>>>>> Thanks for your patch!
>>>>>
>>>>>> --- a/Documentation/fb/fbcon.txt
>>>>>> +++ b/Documentation/fb/fbcon.txt
>>>>>> @@ -163,6 +163,12 @@ C. Boot options
>>>>>>         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=center-logo
>>>>>> +
>>>>>> +       When this option is selected, the bootup logo is centered both
>>>>>> +       horizontally and vertically. If more than one logo is displayed due to
>>>>>> +       multiple CPUs, the collected line of logos is centered as a whole.
>>>>>> +
>>>>>
>>>>> What about making this more generic, than an option specific for centering?
>>>>> Else people want fbcon=left-logo or fbcon=right-logo soon?
>>>>>
>>>>>     fbcon=logo-pos:<pos>
>>>>>
>>>>> With <pos> being "center", "left", "top", "right", "bottom", and combinations
>>>>> like "top,center"? Or is that complicating stuff too much?
>>>>
>>>> I'm not too keen on implementing all that when I have zero use for it. I can
>>>> however rename the trigger for the existing fb_center_logo bool to
>>>>
>>>>       fbcon=logo-pos:center
>>>>
>>>> and add a check for "top,left" to reset the bool to false. Then the other
>>>> variants can be added later by whomever and when needed.
>>>>
>>>> Is that good enough?
>>>
>>> Ouch, I just realized that using a comma is a no-go, as that is already
>>> separating fbcon suboptions, so I suggest top-left instead.
>>
>> Sure, sounds fine to me.  I just want to avoid having a parameter system
>> that complicates future extension.
>> I think you can drop the check for top-left, as the bool defaults to false.
> 
> Right. So, here's an update...
> 
> Again, it would probably be best if this went in before 5.0 is released.
> 
> Changes since v1:
> - rename from fbcon=center-logo option to fbcon=logo-pos:center (and adjust
>   the help text accordingly).
> 
> Cheers,
> Peter
> 
> From ebfb2feb7ea4298ac9c222e6ea6f9c9a92452084 Mon Sep 17 00:00:00 2001
> From: Peter Rosin <peda@axentia.se>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Peter Rosin <peda@axentia.se>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-fbdev@vger.kernel.org
> Cc: linux-doc@vger.kernel.org
> To: linux-kernel@vger.kernel.org
> Date: Mon, 7 Jan 2019 08:35:26 +0100
> Subject: [PATCH v2] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd
>  line option
> 
> A command line option is much more flexible than a config option and
> the supporting code is small. Gets rid of #ifdefs in the code too...
> 
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Peter Rosin <peda@axentia.se>

Patch queued for 5.0, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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

* Re: [PATCH v2] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd, line option
  2019-01-16 16:45                 ` Bartlomiej Zolnierkiewicz
@ 2019-01-17 13:40                   ` Peter Rosin
  2019-01-17 14:23                     ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Rosin @ 2019-01-17 13:40 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Geert Uytterhoeven, linux-kernel, dri-devel, linux-fbdev,
	Jonathan Corbet, Linux Documentation List

On 2019-01-16 17:45, Bartlomiej Zolnierkiewicz wrote:
> On 01/07/2019 11:35 AM, Peter Rosin wrote:
>> Right. So, here's an update...
>>
>> Again, it would probably be best if this went in before 5.0 is released.
>>
>> Changes since v1:
>> - rename from fbcon=center-logo option to fbcon=logo-pos:center (and adjust
>>   the help text accordingly).
>>
>> Cheers,
>> Peter
>>
>> From ebfb2feb7ea4298ac9c222e6ea6f9c9a92452084 Mon Sep 17 00:00:00 2001
>> From: Peter Rosin <peda@axentia.se>
>> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>> Cc: Jonathan Corbet <corbet@lwn.net>
>> Cc: Peter Rosin <peda@axentia.se>
>> Cc: dri-devel@lists.freedesktop.org
>> Cc: linux-fbdev@vger.kernel.org
>> Cc: linux-doc@vger.kernel.org
>> To: linux-kernel@vger.kernel.org
>> Date: Mon, 7 Jan 2019 08:35:26 +0100
>> Subject: [PATCH v2] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd
>>  line option
>>
>> A command line option is much more flexible than a config option and
>> the supporting code is small. Gets rid of #ifdefs in the code too...
>>
>> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> Signed-off-by: Peter Rosin <peda@axentia.se>
> 
> Patch queued for 5.0, thanks.

Hmm, I see the patch on the fbdev-for-next branch, but that sounds
like stuff destined for 5.1? Maybe you simply don't have any
fbdev-for-current or fbdev-fixes branch or something like that?

Just checking to make sure we're on the same page...

Cheers,
Peter

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

* Re: [PATCH v2] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd, line option
  2019-01-17 13:40                   ` Peter Rosin
@ 2019-01-17 14:23                     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 15+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2019-01-17 14:23 UTC (permalink / raw)
  To: Peter Rosin
  Cc: Geert Uytterhoeven, linux-kernel, dri-devel, linux-fbdev,
	Jonathan Corbet, Linux Documentation List


On 01/17/2019 02:40 PM, Peter Rosin wrote:
> On 2019-01-16 17:45, Bartlomiej Zolnierkiewicz wrote:
>> On 01/07/2019 11:35 AM, Peter Rosin wrote:
>>> Right. So, here's an update...
>>>
>>> Again, it would probably be best if this went in before 5.0 is released.
>>>
>>> Changes since v1:
>>> - rename from fbcon=center-logo option to fbcon=logo-pos:center (and adjust
>>>   the help text accordingly).
>>>
>>> Cheers,
>>> Peter
>>>
>>> From ebfb2feb7ea4298ac9c222e6ea6f9c9a92452084 Mon Sep 17 00:00:00 2001
>>> From: Peter Rosin <peda@axentia.se>
>>> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>> Cc: Peter Rosin <peda@axentia.se>
>>> Cc: dri-devel@lists.freedesktop.org
>>> Cc: linux-fbdev@vger.kernel.org
>>> Cc: linux-doc@vger.kernel.org
>>> To: linux-kernel@vger.kernel.org
>>> Date: Mon, 7 Jan 2019 08:35:26 +0100
>>> Subject: [PATCH v2] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd
>>>  line option
>>>
>>> A command line option is much more flexible than a config option and
>>> the supporting code is small. Gets rid of #ifdefs in the code too...
>>>
>>> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>> Signed-off-by: Peter Rosin <peda@axentia.se>
>>
>> Patch queued for 5.0, thanks.
> 
> Hmm, I see the patch on the fbdev-for-next branch, but that sounds
> like stuff destined for 5.1? Maybe you simply don't have any
> fbdev-for-current or fbdev-fixes branch or something like that?

Yes. the single public fbdev branch has been sufficient for now
(there is no active fbdev development and patches for -rcX kernels
are even more rare). OTOH there is no problem with adding -fixes
branch once needed..

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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

end of thread, other threads:[~2019-01-17 14:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-26 21:57 [PATCH 0/2] add config option to center the bootup logo Peter Rosin
2018-11-26 21:57 ` [PATCH 1/2] fbdev: fbmem: make fb_show_logo_line return the end instead of the height Peter Rosin
2018-12-20 17:37   ` Bartlomiej Zolnierkiewicz
2018-11-26 21:57 ` [PATCH 2/2] fbdev: fbmem: add config option to center the bootup logo Peter Rosin
2018-12-20 17:38   ` Bartlomiej Zolnierkiewicz
2019-01-06  9:33   ` Geert Uytterhoeven
2019-01-07  8:26     ` [PATCH] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line, option Peter Rosin
2019-01-07  8:40       ` Geert Uytterhoeven
2019-01-07  8:59         ` Peter Rosin
2019-01-07  9:02           ` Peter Rosin
2019-01-07  9:11             ` Geert Uytterhoeven
2019-01-07 10:35               ` [PATCH v2] fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd, line option Peter Rosin
2019-01-16 16:45                 ` Bartlomiej Zolnierkiewicz
2019-01-17 13:40                   ` Peter Rosin
2019-01-17 14:23                     ` Bartlomiej Zolnierkiewicz

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).