[U-Boot] [PATCH V5 1/4] lcd: add clear and draw bitmap declaration

Che-Liang Chiou clchiou at chromium.org
Fri Oct 21 11:07:03 CEST 2011


The functions for clearing and drawing bitmaps on the screen were not
exposed publicly and are made public in this patch in preparation for
implementing the display interface of api_public.h.

Signed-off-by: Che-Liang Chiou <clchiou at chromium.org>
---

Changes in V5
  Remove inline extern declaration from cmd_bmp.c

Changes in V4
  Remove support of video device, which is untested and will leave to
  future work

Changes in V3
  Rebase to ToT

Changes in V2
  Fix style errors


 common/cmd_bmp.c |    4 +---
 common/lcd.c     |   14 ++++++++++----
 include/lcd.h    |    2 ++
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c
index 23fc82f..682f395 100644
--- a/common/cmd_bmp.c
+++ b/common/cmd_bmp.c
@@ -237,9 +237,7 @@ static int bmp_display(ulong addr, int x, int y)
 	}
 
 #if defined(CONFIG_LCD)
-	extern int lcd_display_bitmap (ulong, int, int);
-
-	ret = lcd_display_bitmap ((unsigned long)bmp, x, y);
+	ret = lcd_display_bitmap((ulong)bmp, x, y);
 #elif defined(CONFIG_VIDEO)
 	extern int video_display_bitmap (ulong, int, int);
 
diff --git a/common/lcd.c b/common/lcd.c
index d9cb8ca..6d91310 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -353,7 +353,14 @@ int drv_lcd_init (void)
 }
 
 /*----------------------------------------------------------------------*/
-static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static
+int do_lcd_clear(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+{
+	lcd_clear();
+	return 0;
+}
+
+void lcd_clear(void)
 {
 #if LCD_BPP == LCD_MONOCHROME
 	/* Setting the palette */
@@ -413,7 +419,7 @@ static int lcd_init (void *lcdbase)
 
 	lcd_ctrl_init (lcdbase);
 	lcd_is_enabled = 1;
-	lcd_clear (NULL, 1, 1, NULL);	/* dummy args */
+	lcd_clear();
 	lcd_enable ();
 
 	/* Initialize the console */
diff --git a/include/lcd.h b/include/lcd.h
index 0e098d9..39af14a 100644
--- a/include/lcd.h
+++ b/include/lcd.h
@@ -210,6 +210,8 @@ void	lcd_disable	(void);
 void	lcd_putc	(const char c);
 void	lcd_puts	(const char *s);
 void	lcd_printf	(const char *fmt, ...);
+void	lcd_clear(void);
+int	lcd_display_bitmap(ulong bmp_image, int x, int y);
 
 /* Allow boards to customize the information displayed */
 void lcd_show_board_info(void);
-- 
1.7.3.1



More information about the U-Boot mailing list