diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2007-05-08 03:38:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:28 -0400 |
commit | 70802c60379fb843c485dfd4cab9e8f527d8fe81 (patch) | |
tree | cb7482bc24e878dd31fbf2a0e8da962c0e80e552 /drivers | |
parent | 6314db4110ad79cc666faff2209ed2691259afd9 (diff) |
fbdev: don't show logo if driver or fbcon are modular
It was always intended for the logo to be drawn only if both fbcon and the
driver that is mapped to it are both compiled statically. Currently, if fbcon
is loaded prior to the driver, the logo is not shown. Reverse the order, and
the code may attempt to draw the logo which is __initdata. By accident, this
bug is rarely seen because this method of loading the modules is not common
and secondly, a code in fb_prepare_logo() that checks the height of the logo
(now a random value) rarely succeeds.
Fix by drawing the logo only if both fbcon and the driver are statically
compiled.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Cc: Jean Delvare <khali@linux-fr.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/console/fbcon.c | 15 | ||||
-rw-r--r-- | drivers/video/fbmem.c | 6 |
2 files changed, 19 insertions, 2 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index f1e3e3c00b21..c8b4ae6d7efe 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -107,7 +107,9 @@ static struct display fb_display[MAX_NR_CONSOLES]; | |||
107 | 107 | ||
108 | static signed char con2fb_map[MAX_NR_CONSOLES]; | 108 | static signed char con2fb_map[MAX_NR_CONSOLES]; |
109 | static signed char con2fb_map_boot[MAX_NR_CONSOLES]; | 109 | static signed char con2fb_map_boot[MAX_NR_CONSOLES]; |
110 | #ifndef MODULE | ||
110 | static int logo_height; | 111 | static int logo_height; |
112 | #endif | ||
111 | static int logo_lines; | 113 | static int logo_lines; |
112 | /* logo_shown is an index to vc_cons when >= 0; otherwise follows FBCON_LOGO | 114 | /* logo_shown is an index to vc_cons when >= 0; otherwise follows FBCON_LOGO |
113 | enums. */ | 115 | enums. */ |
@@ -576,6 +578,13 @@ static int fbcon_takeover(int show_logo) | |||
576 | return err; | 578 | return err; |
577 | } | 579 | } |
578 | 580 | ||
581 | #ifdef MODULE | ||
582 | static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, | ||
583 | int cols, int rows, int new_cols, int new_rows) | ||
584 | { | ||
585 | logo_shown = FBCON_LOGO_DONTSHOW; | ||
586 | } | ||
587 | #else | ||
579 | static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, | 588 | static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, |
580 | int cols, int rows, int new_cols, int new_rows) | 589 | int cols, int rows, int new_cols, int new_rows) |
581 | { | 590 | { |
@@ -584,6 +593,11 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, | |||
584 | int cnt, erase = vc->vc_video_erase_char, step; | 593 | int cnt, erase = vc->vc_video_erase_char, step; |
585 | unsigned short *save = NULL, *r, *q; | 594 | unsigned short *save = NULL, *r, *q; |
586 | 595 | ||
596 | if (info->flags & FBINFO_MODULE) { | ||
597 | logo_shown = FBCON_LOGO_DONTSHOW; | ||
598 | return; | ||
599 | } | ||
600 | |||
587 | /* | 601 | /* |
588 | * remove underline attribute from erase character | 602 | * remove underline attribute from erase character |
589 | * if black and white framebuffer. | 603 | * if black and white framebuffer. |
@@ -655,6 +669,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, | |||
655 | vc->vc_top = logo_lines; | 669 | vc->vc_top = logo_lines; |
656 | } | 670 | } |
657 | } | 671 | } |
672 | #endif /* MODULE */ | ||
658 | 673 | ||
659 | #ifdef CONFIG_FB_TILEBLITTING | 674 | #ifdef CONFIG_FB_TILEBLITTING |
660 | static void set_blitting_type(struct vc_data *vc, struct fb_info *info) | 675 | static void set_blitting_type(struct vc_data *vc, struct fb_info *info) |
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 45f38390605b..08c292d9c401 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -418,7 +418,8 @@ int fb_prepare_logo(struct fb_info *info, int rotate) | |||
418 | 418 | ||
419 | memset(&fb_logo, 0, sizeof(struct logo_data)); | 419 | memset(&fb_logo, 0, sizeof(struct logo_data)); |
420 | 420 | ||
421 | if (info->flags & FBINFO_MISC_TILEBLITTING) | 421 | if (info->flags & FBINFO_MISC_TILEBLITTING || |
422 | info->flags & FBINFO_MODULE) | ||
422 | return 0; | 423 | return 0; |
423 | 424 | ||
424 | if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) { | 425 | if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
@@ -483,7 +484,8 @@ int fb_show_logo(struct fb_info *info, int rotate) | |||
483 | struct fb_image image; | 484 | struct fb_image image; |
484 | 485 | ||
485 | /* Return if the frame buffer is not mapped or suspended */ | 486 | /* Return if the frame buffer is not mapped or suspended */ |
486 | if (fb_logo.logo == NULL || info->state != FBINFO_STATE_RUNNING) | 487 | if (fb_logo.logo == NULL || info->state != FBINFO_STATE_RUNNING || |
488 | info->flags & FBINFO_MODULE) | ||
487 | return 0; | 489 | return 0; |
488 | 490 | ||
489 | image.depth = 8; | 491 | image.depth = 8; |