Skip to contentSkip to conversation

video/logo: add option to return largest logo for a given resolution

PATCH New Urs Fässler 1 participant 3 messages Jul 7, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover video/logo: add option to return largest logo for a given resolution

With this patches, the largest boot logo for a given display resolution is used. We need that functionality since it is common that a product has variants which differ only minimal in the hardware. Thus, we have the same kernel binary but different device trees for different hardware / displays.
This patches allow use to show a full screen boot logo for every hardware variant.

This is a rework of the patch from 3 Jul 2015 which respects the runtime-check on m68k.

Urs Fässler (2):
logo: add option to return largest logo for a given resolution
fbdev: use largest logo if possible

 drivers/video/fbdev/core/fbmem.c | 21 ++++++----
 drivers/video/logo/Kconfig       |  7 ++++
 drivers/video/logo/logo.c        | 86 ++++++++++++++++++++++++++++++++--------
 include/linux/linux_logo.h       |  4 ++
 4 files changed, 94 insertions(+), 24 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH v2 1/2 logo: add option to return largest logo for a given resolution

New method to return the largest (in number of pixels) logo for a given resolution.
One use case is for embedded systems when one kernel binary is compiled but used on different machines (i.e. different device trees) with different display resolutions.

---
 drivers/video/logo/Kconfig |  7 ++++
 drivers/video/logo/logo.c  | 86 +++++++++++++++++++++++++++++++++++++---------
 include/linux/linux_logo.h |  4 +++
 3 files changed, 80 insertions(+), 17 deletions(-)
drivers/video/logo/Kconfig +7 -0
index 0037104..72bd185 100644
@@ -15,6 +15,13 @@ config FB_LOGO_EXTRA
 	depends on FB=y
 	default y if SPU_BASE
 
+config FB_LOGO_LARGEST
+	bool "Use largest"
+	default n
+	help
+	  Returns the largest available bootup logo that fits the given
+	  resolution.
+
 config LOGO_LINUX_MONO
 	bool "Standard black and white Linux logo"
 	default y
drivers/video/logo/logo.c +69 -17

148 lines not on this page · raw message

include/linux/linux_logo.h +4 -0
index ca5bd91..f497e97 100644
@@ -49,6 +49,10 @@ extern const struct linux_logo logo_m32r_clut224;
 extern const struct linux_logo logo_spe_clut224;
 
 extern const struct linux_logo *fb_find_logo(int depth);
+#ifdef CONFIG_FB_LOGO_LARGEST
+extern const struct linux_logo *fb_find_logo_largest(int depth,
+				unsigned int width, unsigned int height);
+#endif
 #ifdef CONFIG_FB_LOGO_EXTRA
 extern void fb_append_extra_logo(const struct linux_logo *logo,
 				 unsigned int n);
Signature · 1 line
2.1.4
#2 lore raw

PATCH v2 2/2 fbdev: use largest logo if possible

In reply to Urs Fässler

If CONFIG_FB_LOGO_LARGEST is set, fbdev uses the largest boot logo to display.

---
 drivers/video/fbdev/core/fbmem.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/video/fbdev/core/fbmem.c +14 -7
index 0705d88..319f168 100644
@@ -595,7 +595,7 @@ static inline int fb_show_extra_logos(struct fb_info *info, int y, int rotate)
 int fb_prepare_logo(struct fb_info *info, int rotate)
 {
 	int depth = fb_get_color_depth(&info->var, &info->fix);
-	unsigned int yres;
+	unsigned int xres, yres;
 
 	memset(&fb_logo, 0, sizeof(struct logo_data));
 
@@ -616,18 +616,25 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
 		depth = 4;
 	}
 
-	/* Return if no suitable logo was found */
+	if (rotate = FB_ROTATE_UR || rotate = FB_ROTATE_UD) {
+		xres = info->var.xres;
+		yres = info->var.yres;
+	} else {
+		xres = info->var.yres;
+		yres = info->var.xres;
+	}
+
+#ifdef CONFIG_FB_LOGO_LARGEST
+	fb_logo.logo = fb_find_logo_largest(depth, xres, yres);
+#else
 	fb_logo.logo = fb_find_logo(depth);
+#endif
 
+	/* Return if no suitable logo was found */
 	if (!fb_logo.logo) {
 		return 0;
 	}
 
-	if (rotate = FB_ROTATE_UR || rotate = FB_ROTATE_UD)
-		yres = info->var.yres;
-	else
-		yres = info->var.xres;
-
 	if (fb_logo.logo->height > yres) {
 		fb_logo.logo = NULL;
 		return 0;
Signature · 1 line
2.1.4