diff options
author | Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> | 2007-07-17 07:05:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:23:13 -0400 |
commit | 90da63e54604fd515c17014a0a7f332a018a0a11 (patch) | |
tree | 709386f14950b53b89ebb3d37e97d302efb0ad10 /drivers | |
parent | b6e8f00fcd56b426371334d722d1f3fb251b7290 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/fbmem.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 7f3a0cca0fd4..717684bde486 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -470,22 +470,24 @@ int fb_prepare_logo(struct fb_info *info, int rotate) | |||
470 | return fb_logo.logo->height; | 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 | u32 *palette = NULL, *saved_pseudo_palette = NULL; | 477 | u32 *palette = NULL, *saved_pseudo_palette = NULL; |
476 | unsigned char *logo_new = NULL, *logo_rotate = NULL; | 478 | unsigned char *logo_new = NULL, *logo_rotate = NULL; |
477 | struct fb_image image; | 479 | struct fb_image image; |
478 | 480 | ||
479 | /* Return if the frame buffer is not mapped or suspended */ | 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 | info->flags & FBINFO_MODULE) | 483 | info->flags & FBINFO_MODULE) |
482 | return 0; | 484 | return 0; |
483 | 485 | ||
484 | image.depth = 8; | 486 | image.depth = 8; |
485 | image.data = fb_logo.logo->data; | 487 | image.data = logo->data; |
486 | 488 | ||
487 | if (fb_logo.needs_cmapreset) | 489 | if (fb_logo.needs_cmapreset) |
488 | fb_set_logocmap(info, fb_logo.logo); | 490 | fb_set_logocmap(info, logo); |
489 | 491 | ||
490 | if (fb_logo.needs_truepalette || | 492 | if (fb_logo.needs_truepalette || |
491 | fb_logo.needs_directpalette) { | 493 | fb_logo.needs_directpalette) { |
@@ -494,17 +496,16 @@ int fb_show_logo(struct fb_info *info, int rotate) | |||
494 | return 0; | 496 | return 0; |
495 | 497 | ||
496 | if (fb_logo.needs_truepalette) | 498 | if (fb_logo.needs_truepalette) |
497 | fb_set_logo_truepalette(info, fb_logo.logo, palette); | 499 | fb_set_logo_truepalette(info, logo, palette); |
498 | else | 500 | else |
499 | fb_set_logo_directpalette(info, fb_logo.logo, palette); | 501 | fb_set_logo_directpalette(info, logo, palette); |
500 | 502 | ||
501 | saved_pseudo_palette = info->pseudo_palette; | 503 | saved_pseudo_palette = info->pseudo_palette; |
502 | info->pseudo_palette = palette; | 504 | info->pseudo_palette = palette; |
503 | } | 505 | } |
504 | 506 | ||
505 | if (fb_logo.depth <= 4) { | 507 | if (fb_logo.depth <= 4) { |
506 | logo_new = kmalloc(fb_logo.logo->width * fb_logo.logo->height, | 508 | logo_new = kmalloc(logo->width * logo->height, GFP_KERNEL); |
507 | GFP_KERNEL); | ||
508 | if (logo_new == NULL) { | 509 | if (logo_new == NULL) { |
509 | kfree(palette); | 510 | kfree(palette); |
510 | if (saved_pseudo_palette) | 511 | if (saved_pseudo_palette) |
@@ -512,29 +513,35 @@ int fb_show_logo(struct fb_info *info, int rotate) | |||
512 | return 0; | 513 | return 0; |
513 | } | 514 | } |
514 | image.data = logo_new; | 515 | image.data = logo_new; |
515 | fb_set_logo(info, fb_logo.logo, logo_new, fb_logo.depth); | 516 | fb_set_logo(info, logo, logo_new, fb_logo.depth); |
516 | } | 517 | } |
517 | 518 | ||
518 | image.dx = 0; | 519 | image.dx = 0; |
519 | image.dy = 0; | 520 | image.dy = y; |
520 | image.width = fb_logo.logo->width; | 521 | image.width = logo->width; |
521 | image.height = fb_logo.logo->height; | 522 | image.height = logo->height; |
522 | 523 | ||
523 | if (rotate) { | 524 | if (rotate) { |
524 | logo_rotate = kmalloc(fb_logo.logo->width * | 525 | logo_rotate = kmalloc(logo->width * |
525 | fb_logo.logo->height, GFP_KERNEL); | 526 | logo->height, GFP_KERNEL); |
526 | if (logo_rotate) | 527 | if (logo_rotate) |
527 | fb_rotate_logo(info, logo_rotate, &image, rotate); | 528 | fb_rotate_logo(info, logo_rotate, &image, rotate); |
528 | } | 529 | } |
529 | 530 | ||
530 | fb_do_show_logo(info, &image, rotate, num_online_cpus()); | 531 | fb_do_show_logo(info, &image, rotate, n); |
531 | 532 | ||
532 | kfree(palette); | 533 | kfree(palette); |
533 | if (saved_pseudo_palette != NULL) | 534 | if (saved_pseudo_palette != NULL) |
534 | info->pseudo_palette = saved_pseudo_palette; | 535 | info->pseudo_palette = saved_pseudo_palette; |
535 | kfree(logo_new); | 536 | kfree(logo_new); |
536 | kfree(logo_rotate); | 537 | kfree(logo_rotate); |
537 | return fb_logo.logo->height; | 538 | return logo->height; |
539 | } | ||
540 | |||
541 | int fb_show_logo(struct fb_info *info, int rotate) | ||
542 | { | ||
543 | return fb_show_logo_line(info, rotate, fb_logo.logo, 0, | ||
544 | num_online_cpus()); | ||
538 | } | 545 | } |
539 | #else | 546 | #else |
540 | int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; } | 547 | int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; } |