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

Urs Fässler
2015-07-03T08:45:25Z

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

Signed-off-by: Urs Fässler <urs.fassler@bytesatwork.ch>
---
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