From 02110903a83539da35cf6b1bbd853ce0351f7c95 Mon Sep 17 00:00:00 2001 From: Che-Liang Chiou Date: Thu, 20 Oct 2011 23:07:03 +0000 Subject: lcd: add clear and draw bitmap declaration 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 Acked-by: Mike Frysinger Signed-off-by: Anatolij Gustschin --- common/cmd_bmp.c | 4 +--- common/lcd.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'common') 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..20e97b9 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -78,7 +78,6 @@ static inline void lcd_putc_xy (ushort x, ushort y, uchar c); static int lcd_init (void *lcdbase); -static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]); static void *lcd_logo (void); static int lcd_getbgcolor (void); @@ -353,7 +352,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 */ @@ -394,12 +400,10 @@ static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[] console_col = 0; console_row = 0; - - return (0); } U_BOOT_CMD( - cls, 1, 1, lcd_clear, + cls, 1, 1, do_lcd_clear, "clear screen", "" ); @@ -413,7 +417,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 */ -- cgit v1.1 From c270730f580e85ddab82e981abf8a518f78ae803 Mon Sep 17 00:00:00 2001 From: Che-Liang Chiou Date: Thu, 20 Oct 2011 23:04:20 +0000 Subject: tools: logo: split bmp arrays from bmp_logo.h The generated header bmp_logo.h is useful even outside common/lcd.c for the logo dimension. However, the problem is, the generated bmp_logo.h cannot be included multiple times because bmp_logo_palette[] and bmp_logo_bitmap[] are defined in the bmp_logo.h. This patch fixes this by defining these arrays in another header bmp_logo_data.h and in bmp_logo.h only declaring these arrays. Signed-off-by: Che-Liang Chiou Acked-by: Mike Frysinger Signed-off-by: Anatolij Gustschin --- common/lcd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'common') diff --git a/common/lcd.c b/common/lcd.c index 20e97b9..504b8f6 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -63,6 +63,7 @@ /************************************************************************/ #ifdef CONFIG_LCD_LOGO # include /* Get logo data, width and height */ +# include # if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET) && (LCD_BPP != LCD_COLOR16) # error Default Color Map overlaps with Logo Color Map # endif -- cgit v1.1 From d3983ee85325d2be730830ebcf82585ee7cd2ecb Mon Sep 17 00:00:00 2001 From: Che-Liang Chiou Date: Fri, 21 Oct 2011 17:04:21 +0800 Subject: font: split font data from video_font.h While video_font.h is useful even without referencing the font data, it is not possible to be included multiple times because it defines font data array right in the header. This patch splits the font data array into video_font_data.h and so now video_font.h can be included multiple times. This at least solves the code duplication in board/mcc200/lcd.c. Signed-off-by: Che-Liang Chiou Acked-by: Mike Frysinger --- common/lcd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'common') diff --git a/common/lcd.c b/common/lcd.c index 504b8f6..6313ec0 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -57,6 +57,7 @@ /* ** FONT DATA */ /************************************************************************/ #include /* Get font data, width and height */ +#include /************************************************************************/ /* ** LOGO DATA */ -- cgit v1.1