fbdev: fbmem: add config option to center the bootup logo
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> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
This commit is contained in:

committed by
Bartlomiej Zolnierkiewicz

parent
e41f184d83
commit
3d8b1933eb
@@ -506,8 +506,25 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
|
|||||||
fb_set_logo(info, logo, logo_new, fb_logo.depth);
|
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.dx = 0;
|
||||||
image.dy = y;
|
image.dy = y;
|
||||||
|
#endif
|
||||||
image.width = logo->width;
|
image.width = logo->width;
|
||||||
image.height = logo->height;
|
image.height = logo->height;
|
||||||
|
|
||||||
@@ -604,6 +621,7 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
|
|||||||
{
|
{
|
||||||
int depth = fb_get_color_depth(&info->var, &info->fix);
|
int depth = fb_get_color_depth(&info->var, &info->fix);
|
||||||
unsigned int yres;
|
unsigned int yres;
|
||||||
|
int height;
|
||||||
|
|
||||||
memset(&fb_logo, 0, sizeof(struct logo_data));
|
memset(&fb_logo, 0, sizeof(struct logo_data));
|
||||||
|
|
||||||
@@ -665,7 +683,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)
|
int fb_show_logo(struct fb_info *info, int rotate)
|
||||||
|
@@ -10,6 +10,15 @@ menuconfig LOGO
|
|||||||
|
|
||||||
if 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
|
config FB_LOGO_EXTRA
|
||||||
bool
|
bool
|
||||||
depends on FB=y
|
depends on FB=y
|
||||||
|
Reference in New Issue
Block a user