Commit 581bb41980a38c6ddac40f07ec1c8dcd37aca8f6
Committed by
Tom Rini
1 parent
bcc6cc9b37
Exists in
master
and in
53 other branches
lcd: add option for board specific splash screen preparation
Currently there is no logical place to put the code that prepares the splash image data. The splash image data should be ready in memory before bmp_display() is called, and after the environment is ready (since lcd.c looks for the splash image in an address specified by the environment variable "splashimage"). Our window of opportunity in board_init_r() is therefore: between env_relocate() and bmp_display(), and from the available options only the lcd related functions in drv_lcd_init() seem appropriate for such lcd oriented code. Add the option to prepare the splash image data in lcd_logo() right before it is sent to be displayed. Cc: Anatolij Gustschin <agust@denx.de> Cc: Jeroen Hofstee <jeroen@myspectrum.nl> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Showing 3 changed files with 24 additions and 0 deletions Side-by-side Diff
README
... | ... | @@ -1550,6 +1550,14 @@ |
1550 | 1550 | => vertically centered image |
1551 | 1551 | at x = dspWidth - bmpWidth - 9 |
1552 | 1552 | |
1553 | + CONFIG_SPLASH_SCREEN_PREPARE | |
1554 | + | |
1555 | + If this option is set then the board_splash_screen_prepare() | |
1556 | + function, which must be defined in your code, is called as part | |
1557 | + of the splash screen display sequence. It gives the board an | |
1558 | + opportunity to prepare the splash image data before it is | |
1559 | + processed and sent to the frame buffer by U-Boot. | |
1560 | + | |
1553 | 1561 | - Gzip compressed BMP image support: CONFIG_VIDEO_BMP_GZIP |
1554 | 1562 | |
1555 | 1563 | If this option is set, additionally to standard BMP |
common/lcd.c
... | ... | @@ -1034,6 +1034,18 @@ |
1034 | 1034 | } |
1035 | 1035 | #endif |
1036 | 1036 | |
1037 | +#ifdef CONFIG_SPLASH_SCREEN_PREPARE | |
1038 | +static inline int splash_screen_prepare(void) | |
1039 | +{ | |
1040 | + return board_splash_screen_prepare(); | |
1041 | +} | |
1042 | +#else | |
1043 | +static inline int splash_screen_prepare(void) | |
1044 | +{ | |
1045 | + return 0; | |
1046 | +} | |
1047 | +#endif | |
1048 | + | |
1037 | 1049 | static void *lcd_logo(void) |
1038 | 1050 | { |
1039 | 1051 | #ifdef CONFIG_SPLASH_SCREEN |
... | ... | @@ -1044,6 +1056,9 @@ |
1044 | 1056 | if (do_splash && (s = getenv("splashimage")) != NULL) { |
1045 | 1057 | int x = 0, y = 0; |
1046 | 1058 | do_splash = 0; |
1059 | + | |
1060 | + if (splash_screen_prepare()) | |
1061 | + return (void *)gd->fb_base; | |
1047 | 1062 | |
1048 | 1063 | addr = simple_strtoul (s, NULL, 16); |
1049 | 1064 | #ifdef CONFIG_SPLASH_SCREEN_ALIGN |
include/lcd.h