Patchwork [U-Boot,V1,4/7] lcd: add option for board specific splash screen preparation

login
register
mail settings
Submitter Nikita Kiryanov
Date Jan. 29, 2013, 12:42 p.m.
Message ID <1359463349-11649-5-git-send-email-nikita@compulab.co.il>
Download mbox | patch
Permalink /patch/216518/
State Superseded
Delegated to: Tom Rini
Headers show

Comments

Nikita Kiryanov - Jan. 29, 2013, 12:42 p.m.
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.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 README        |    8 ++++++++
 common/lcd.c  |   15 +++++++++++++++
 include/lcd.h |    1 +
 3 files changed, 24 insertions(+)
Wolfgang Denk - Jan. 29, 2013, 1:46 p.m.
Dear Nikita Kiryanov,

In message <1359463349-11649-5-git-send-email-nikita@compulab.co.il> you wrote:
> 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.
> 
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>

You should add the video custodian on Cc: for such patches.

[Done here].

Best regards,

Wolfgang Denk
Nikita Kiryanov - Jan. 29, 2013, 2:44 p.m.
Hi Wolfgang Denk,

On 01/29/2013 03:46 PM, Wolfgang Denk wrote:
> Dear Nikita Kiryanov,
>
> In message <1359463349-11649-5-git-send-email-nikita@compulab.co.il> you wrote:
>> 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.
>>
>> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
>> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
>
> You should add the video custodian on Cc: for such patches.
>
> [Done here].

Will do...
I did Cc Anatolij when running git send-patch though...
It's possible that it was dropped by mailman (see this discussion:
http://www.mail-archive.com/u-boot@lists.denx.de/msg103585.html)
but he should still get the email.

Anyway, I'll start using the Cc line in the patches as requested..

>
> Best regards,
>
> Wolfgang Denk
>

Patch

diff --git a/README b/README
index a336476..89694d7 100644
--- a/README
+++ b/README
@@ -1550,6 +1550,14 @@  CBFS (Coreboot Filesystem) support
 			=> vertically centered image
 			   at x = dspWidth - bmpWidth - 9
 
+		CONFIG_SPLASH_SCREEN_PREPARE
+
+		If this option is set then the board_splash_screen_prepare()
+		function, which must be defined in your code, is called as part
+		of the splash screen display sequence. It gives the board an
+		opportunity to prepare the splash image data before it is
+		processed and sent to the frame buffer by U-Boot.
+
 - Gzip compressed BMP image support: CONFIG_VIDEO_BMP_GZIP
 
 		If this option is set, additionally to standard BMP
diff --git a/common/lcd.c b/common/lcd.c
index 104125d..bb8a7d2 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -1034,6 +1034,18 @@  int lcd_display_bitmap(ulong bmp_image, int x, int y)
 }
 #endif
 
+#ifdef CONFIG_SPLASH_SCREEN_PREPARE
+static inline int splash_screen_prepare(void)
+{
+	return board_splash_screen_prepare();
+}
+#else
+static inline int splash_screen_prepare(void)
+{
+	return 0;
+}
+#endif
+
 static void *lcd_logo(void)
 {
 #ifdef CONFIG_SPLASH_SCREEN
@@ -1045,6 +1057,9 @@  static void *lcd_logo(void)
 		int x = 0, y = 0;
 		do_splash = 0;
 
+		if (splash_screen_prepare())
+			return (void *)gd->fb_base;
+
 		addr = simple_strtoul (s, NULL, 16);
 		/*
 		 * In order for the fields of bmp header to be properly aligned
diff --git a/include/lcd.h b/include/lcd.h
index c24164a..4ac4ddd 100644
--- a/include/lcd.h
+++ b/include/lcd.h
@@ -47,6 +47,7 @@  extern struct vidinfo panel_info;
 
 extern void lcd_ctrl_init (void *lcdbase);
 extern void lcd_enable (void);
+extern int board_splash_screen_prepare(void);
 
 /* setcolreg used in 8bpp/16bpp; initcolregs used in monochrome */
 extern void lcd_setcolreg (ushort regno,