Boot Console on LCD working

From: Pattrick Hueper <pattyh_at_gmx.net>
Date: Mon, 23 Feb 2004 15:20:26 +0100

Hi,

after the LCD is working, i got the Boot Console to show up on the LCD
(including Logo ;-))!

it is a bit of a hack, maybe one of the more experienced linux
developers can have a look at it and recommend improvements:

Here is the diff:

Index: drivers/video/mq1100fb.c
===================================================================
RCS file: /cvs/linux/kernel26/drivers/video/mq1100fb.c,v
retrieving revision 1.17
diff -r1.17 mq1100fb.c
34a35,39
> #ifdef CONFIG_FRAMEBUFFER_CONSOLE
> extern int fb_console_init(void);
> #endif
>
>
48,53c53,54
< union {
< /* The RGB palette */
< struct mq1100fb_rgb palette[256];
< /* Notifier block (used until init complete) */
< struct notifier_block notify;
< };

---
 >       /* The RGB palette */
 >       struct mq1100fb_rgb palette[256];
418c419
<       debug ("frame buffer device %dx%d-%dbpp\n",
---
 >     debug ("frame buffer device %dx%d-%dbpp\n",
422a424,426
 > static struct notifier_block notify;
 > static struct mq1100fb_info *info;
 >
427,428d430
<       struct mq1100fb_info *info;
<       info = container_of(self, struct mq1100fb_info, notify);
430c432
<       /* Check if this is lcd_module we expect */
---
 >     /* Check if this is lcd_module we expect */
440a443,447
 >     #ifdef CONFIG_FRAMEBUFFER_CONSOLE
 >         // init is done, now we can make us the active console
 >           fb_console_init();
 >     #endif
 >
444d450
<
447d452
<       struct mq1100fb_info *info;
481,484c486,489
<               info->notify.notifier_call = mq1100fb_lcd_notify;
<               info->notify.next = NULL;
<               info->notify.priority = 0;
<               notifier_chain_register (&lcd_module_chain, &info->notify);
---
 >               notify.notifier_call = mq1100fb_lcd_notify;
 >               notify.next = NULL;
 >               notify.priority = 0;
 >               notifier_chain_register (&lcd_module_chain, &notify);
506c511
<               notifier_chain_unregister (&lcd_module_chain, 
&info->notify);
---
 >               notifier_chain_unregister (&lcd_module_chain, &notify);
=====================================================================
Here is what i did and why:
- i found, that i needed to call fb_console_init() after the framebuffer 
was inited, thus i entered the call in #ifdef FRAMEBUFFER_CONSOLE into
mq1100fb_lcd_notify() after mq11fb_finish_init
- that turned the console on, but gave a panic immediately after... i 
found that the problem is the union in the info struct, since the 
palette is written to when the console comes up, the notify struct gets 
overwritten... thus i used a static struct for notify and info (since 
info is needed in mq1100fb_lcd_notify...)
- then when booting the console is shown on the LCD...
Questions:
- is there another way of getting the fb to be a console, than calling 
fb_console_init, how can i register the fb to become the tty0???
- the static structs seem pretty ugly to me (especially "info"), but i 
found no way to pass arguments into notifier struct...
Cheers, Patty
Received on Mon Feb 23 2004 - 14:20:29 EST

This archive was generated by hypermail 2.2.0 : Mon Jul 25 2005 - 17:19:25 EDT