Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: extract fb_show_logo_line()

The Cell Broadband Engine contains a 64-bit PowerPC core with 2 hardware
threads (called PPEs) and 8 Synergistic Processing Engines (called SPEs).
When booting Linux, 2 penguins logos are shown on the graphical console by
the standard frame buffer console logo code.

To emphasize the existence of the SPEs (which can be used under Linux), we
added a second row of (smaller) helper penguin logos, one for each SPE.

A sample screenshot can be found at
http://www.kernel.org/pub/linux/kernel/people/geoff/cell/debian-penguin-shot.png
(or on the ps3linux T-shirts we wore at OLS :-)

This patch:

Extract the code to draw one line of logos into fb_show_logo_line()

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-By: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Geert Uytterhoeven and committed by
Linus Torvalds
90da63e5 b6e8f00f

+23 -16
+23 -16
drivers/video/fbmem.c
··· 470 470 return fb_logo.logo->height; 471 471 } 472 472 473 - int fb_show_logo(struct fb_info *info, int rotate) 473 + static int fb_show_logo_line(struct fb_info *info, int rotate, 474 + const struct linux_logo *logo, int y, 475 + unsigned int n) 474 476 { 475 477 u32 *palette = NULL, *saved_pseudo_palette = NULL; 476 478 unsigned char *logo_new = NULL, *logo_rotate = NULL; 477 479 struct fb_image image; 478 480 479 481 /* Return if the frame buffer is not mapped or suspended */ 480 - if (fb_logo.logo == NULL || info->state != FBINFO_STATE_RUNNING || 482 + if (logo == NULL || info->state != FBINFO_STATE_RUNNING || 481 483 info->flags & FBINFO_MODULE) 482 484 return 0; 483 485 484 486 image.depth = 8; 485 - image.data = fb_logo.logo->data; 487 + image.data = logo->data; 486 488 487 489 if (fb_logo.needs_cmapreset) 488 - fb_set_logocmap(info, fb_logo.logo); 490 + fb_set_logocmap(info, logo); 489 491 490 492 if (fb_logo.needs_truepalette || 491 493 fb_logo.needs_directpalette) { ··· 496 494 return 0; 497 495 498 496 if (fb_logo.needs_truepalette) 499 - fb_set_logo_truepalette(info, fb_logo.logo, palette); 497 + fb_set_logo_truepalette(info, logo, palette); 500 498 else 501 - fb_set_logo_directpalette(info, fb_logo.logo, palette); 499 + fb_set_logo_directpalette(info, logo, palette); 502 500 503 501 saved_pseudo_palette = info->pseudo_palette; 504 502 info->pseudo_palette = palette; 505 503 } 506 504 507 505 if (fb_logo.depth <= 4) { 508 - logo_new = kmalloc(fb_logo.logo->width * fb_logo.logo->height, 509 - GFP_KERNEL); 506 + logo_new = kmalloc(logo->width * logo->height, GFP_KERNEL); 510 507 if (logo_new == NULL) { 511 508 kfree(palette); 512 509 if (saved_pseudo_palette) ··· 513 512 return 0; 514 513 } 515 514 image.data = logo_new; 516 - fb_set_logo(info, fb_logo.logo, logo_new, fb_logo.depth); 515 + fb_set_logo(info, logo, logo_new, fb_logo.depth); 517 516 } 518 517 519 518 image.dx = 0; 520 - image.dy = 0; 521 - image.width = fb_logo.logo->width; 522 - image.height = fb_logo.logo->height; 519 + image.dy = y; 520 + image.width = logo->width; 521 + image.height = logo->height; 523 522 524 523 if (rotate) { 525 - logo_rotate = kmalloc(fb_logo.logo->width * 526 - fb_logo.logo->height, GFP_KERNEL); 524 + logo_rotate = kmalloc(logo->width * 525 + logo->height, GFP_KERNEL); 527 526 if (logo_rotate) 528 527 fb_rotate_logo(info, logo_rotate, &image, rotate); 529 528 } 530 529 531 - fb_do_show_logo(info, &image, rotate, num_online_cpus()); 530 + fb_do_show_logo(info, &image, rotate, n); 532 531 533 532 kfree(palette); 534 533 if (saved_pseudo_palette != NULL) 535 534 info->pseudo_palette = saved_pseudo_palette; 536 535 kfree(logo_new); 537 536 kfree(logo_rotate); 538 - return fb_logo.logo->height; 537 + return logo->height; 538 + } 539 + 540 + int fb_show_logo(struct fb_info *info, int rotate) 541 + { 542 + return fb_show_logo_line(info, rotate, fb_logo.logo, 0, 543 + num_online_cpus()); 539 544 } 540 545 #else 541 546 int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; }