[PATCH 2/2] fbdev: use largest logo if possible

From: Urs FÃssler
Date: Tue Jul 07 2015 - 10:24:39 EST


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

Signed-off-by: Urs FÃssler <urs.fassler@xxxxxxxxxxxxxx>
---
drivers/video/fbdev/core/fbmem.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 0705d88..319f168 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -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;
--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/