aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorPeter Rosin <peda@axentia.se>2018-12-20 13:13:08 -0500
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-12-20 13:13:08 -0500
commit3d8b1933eb1c3c94ef8667996dbff6994d5d552f (patch)
tree35aad5fe47bbbde62423e8e15ef71ce97ba00b32 /drivers/video/fbdev
parente41f184d83a3a1e12abbf00a829d9de579d6b0fe (diff)
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>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/core/fbmem.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 8aec84d888a3..558ed2ed3124 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -506,8 +506,25 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
506 fb_set_logo(info, logo, logo_new, fb_logo.depth); 506 fb_set_logo(info, logo, logo_new, fb_logo.depth);
507 } 507 }
508 508
509#ifdef CONFIG_FB_LOGO_CENTER
510 {
511 int xres = info->var.xres;
512 int yres = info->var.yres;
513
514 if (rotate == FB_ROTATE_CW || rotate == FB_ROTATE_CCW) {
515 xres = info->var.yres;
516 yres = info->var.xres;
517 }
518
519 while (n && (n * (logo->width + 8) - 8 > xres))
520 --n;
521 image.dx = (xres - n * (logo->width + 8) - 8) / 2;
522 image.dy = y ?: (yres - logo->height) / 2;
523 }
524#else
509 image.dx = 0; 525 image.dx = 0;
510 image.dy = y; 526 image.dy = y;
527#endif
511 image.width = logo->width; 528 image.width = logo->width;
512 image.height = logo->height; 529 image.height = logo->height;
513 530
@@ -604,6 +621,7 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
604{ 621{
605 int depth = fb_get_color_depth(&info->var, &info->fix); 622 int depth = fb_get_color_depth(&info->var, &info->fix);
606 unsigned int yres; 623 unsigned int yres;
624 int height;
607 625
608 memset(&fb_logo, 0, sizeof(struct logo_data)); 626 memset(&fb_logo, 0, sizeof(struct logo_data));
609 627
@@ -665,7 +683,12 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
665 } 683 }
666 } 684 }
667 685
668 return fb_prepare_extra_logos(info, fb_logo.logo->height, yres); 686 height = fb_logo.logo->height;
687#ifdef CONFIG_FB_LOGO_CENTER
688 height += (yres - fb_logo.logo->height) / 2;
689#endif
690
691 return fb_prepare_extra_logos(info, height, yres);
669} 692}
670 693
671int fb_show_logo(struct fb_info *info, int rotate) 694int fb_show_logo(struct fb_info *info, int rotate)