aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r--drivers/video/fbmem.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 44cf0e4f52e9..8ce98a2f6f37 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -376,37 +376,33 @@ static void fb_rotate_logo(struct fb_info *info, u8 *dst,
376} 376}
377 377
378static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, 378static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
379 int rotate) 379 int rotate, unsigned int num)
380{ 380{
381 int x; 381 unsigned int x;
382 382
383 if (rotate == FB_ROTATE_UR) { 383 if (rotate == FB_ROTATE_UR) {
384 for (x = 0; x < num_online_cpus() && 384 for (x = 0;
385 x * (fb_logo.logo->width + 8) <= 385 x < num && image->dx + image->width <= info->var.xres;
386 info->var.xres - fb_logo.logo->width; x++) { 386 x++) {
387 info->fbops->fb_imageblit(info, image); 387 info->fbops->fb_imageblit(info, image);
388 image->dx += fb_logo.logo->width + 8; 388 image->dx += image->width + 8;
389 } 389 }
390 } else if (rotate == FB_ROTATE_UD) { 390 } else if (rotate == FB_ROTATE_UD) {
391 for (x = 0; x < num_online_cpus() && 391 for (x = 0; x < num && image->dx >= 0; x++) {
392 x * (fb_logo.logo->width + 8) <=
393 info->var.xres - fb_logo.logo->width; x++) {
394 info->fbops->fb_imageblit(info, image); 392 info->fbops->fb_imageblit(info, image);
395 image->dx -= fb_logo.logo->width + 8; 393 image->dx -= image->width + 8;
396 } 394 }
397 } else if (rotate == FB_ROTATE_CW) { 395 } else if (rotate == FB_ROTATE_CW) {
398 for (x = 0; x < num_online_cpus() && 396 for (x = 0;
399 x * (fb_logo.logo->width + 8) <= 397 x < num && image->dy + image->height <= info->var.yres;
400 info->var.yres - fb_logo.logo->width; x++) { 398 x++) {
401 info->fbops->fb_imageblit(info, image); 399 info->fbops->fb_imageblit(info, image);
402 image->dy += fb_logo.logo->width + 8; 400 image->dy += image->height + 8;
403 } 401 }
404 } else if (rotate == FB_ROTATE_CCW) { 402 } else if (rotate == FB_ROTATE_CCW) {
405 for (x = 0; x < num_online_cpus() && 403 for (x = 0; x < num && image->dy >= 0; x++) {
406 x * (fb_logo.logo->width + 8) <=
407 info->var.yres - fb_logo.logo->width; x++) {
408 info->fbops->fb_imageblit(info, image); 404 info->fbops->fb_imageblit(info, image);
409 image->dy -= fb_logo.logo->width + 8; 405 image->dy -= image->height + 8;
410 } 406 }
411 } 407 }
412} 408}
@@ -532,7 +528,7 @@ int fb_show_logo(struct fb_info *info, int rotate)
532 fb_rotate_logo(info, logo_rotate, &image, rotate); 528 fb_rotate_logo(info, logo_rotate, &image, rotate);
533 } 529 }
534 530
535 fb_do_show_logo(info, &image, rotate); 531 fb_do_show_logo(info, &image, rotate, num_online_cpus());
536 532
537 kfree(palette); 533 kfree(palette);
538 if (saved_pseudo_palette != NULL) 534 if (saved_pseudo_palette != NULL)