Commit 448d4797 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

fbdev: fb_do_show_logo() updates

fb_do_show_logo() updates:
  - Use width and height of the passed image instead of the global variable
    fb_logo
  - Explicitly pass the number of logos to draw
Signed-off-by: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: default avatarGeoff Levand <geoffrey.levand@am.sony.com>
Acked-By: default avatarJames Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 250038f5
...@@ -376,37 +376,33 @@ static void fb_rotate_logo(struct fb_info *info, u8 *dst, ...@@ -376,37 +376,33 @@ static void fb_rotate_logo(struct fb_info *info, u8 *dst,
} }
static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
int rotate) int rotate, unsigned int num)
{ {
int x; unsigned int x;
if (rotate == FB_ROTATE_UR) { if (rotate == FB_ROTATE_UR) {
for (x = 0; x < num_online_cpus() && for (x = 0;
x * (fb_logo.logo->width + 8) <= x < num && image->dx + image->width <= info->var.xres;
info->var.xres - fb_logo.logo->width; x++) { x++) {
info->fbops->fb_imageblit(info, image); info->fbops->fb_imageblit(info, image);
image->dx += fb_logo.logo->width + 8; image->dx += image->width + 8;
} }
} else if (rotate == FB_ROTATE_UD) { } else if (rotate == FB_ROTATE_UD) {
for (x = 0; x < num_online_cpus() && for (x = 0; x < num && image->dx >= 0; x++) {
x * (fb_logo.logo->width + 8) <=
info->var.xres - fb_logo.logo->width; x++) {
info->fbops->fb_imageblit(info, image); info->fbops->fb_imageblit(info, image);
image->dx -= fb_logo.logo->width + 8; image->dx -= image->width + 8;
} }
} else if (rotate == FB_ROTATE_CW) { } else if (rotate == FB_ROTATE_CW) {
for (x = 0; x < num_online_cpus() && for (x = 0;
x * (fb_logo.logo->width + 8) <= x < num && image->dy + image->height <= info->var.yres;
info->var.yres - fb_logo.logo->width; x++) { x++) {
info->fbops->fb_imageblit(info, image); info->fbops->fb_imageblit(info, image);
image->dy += fb_logo.logo->width + 8; image->dy += image->height + 8;
} }
} else if (rotate == FB_ROTATE_CCW) { } else if (rotate == FB_ROTATE_CCW) {
for (x = 0; x < num_online_cpus() && for (x = 0; x < num && image->dy >= 0; x++) {
x * (fb_logo.logo->width + 8) <=
info->var.yres - fb_logo.logo->width; x++) {
info->fbops->fb_imageblit(info, image); info->fbops->fb_imageblit(info, image);
image->dy -= fb_logo.logo->width + 8; image->dy -= image->height + 8;
} }
} }
} }
...@@ -532,7 +528,7 @@ int fb_show_logo(struct fb_info *info, int rotate) ...@@ -532,7 +528,7 @@ int fb_show_logo(struct fb_info *info, int rotate)
fb_rotate_logo(info, logo_rotate, &image, rotate); fb_rotate_logo(info, logo_rotate, &image, rotate);
} }
fb_do_show_logo(info, &image, rotate); fb_do_show_logo(info, &image, rotate, num_online_cpus());
kfree(palette); kfree(palette);
if (saved_pseudo_palette != NULL) if (saved_pseudo_palette != NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment