Commit 45ae2546ef157b647d8684845c6554283b80be92
Committed by
Anatolij Gustschin
1 parent
2740e5de4f
Exists in
master
and in
50 other branches
video, cfb_console: make background and foreground color configurable
make CONSOLE_BG_COL/CONSOLE_FG_COL configurable through board config file. Clear video screen in video_init(). Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Anatolij Gustschin <agust@denx.de>
Showing 3 changed files with 30 additions and 18 deletions Side-by-side Diff
README
... | ... | @@ -705,6 +705,11 @@ |
705 | 705 | the "silent" environment variable. See |
706 | 706 | doc/README.silent for more information. |
707 | 707 | |
708 | + CONFIG_SYS_CONSOLE_BG_COL: define the backgroundcolor, default | |
709 | + is 0x00. | |
710 | + CONFIG_SYS_CONSOLE_FG_COL: define the foregroundcolor, default | |
711 | + is 0xa0. | |
712 | + | |
708 | 713 | - Console Baudrate: |
709 | 714 | CONFIG_BAUDRATE - in bps |
710 | 715 | Select one of the baudrates listed in |
drivers/video/cfb_console.c
... | ... | @@ -2108,6 +2108,24 @@ |
2108 | 2108 | return 0; |
2109 | 2109 | } |
2110 | 2110 | |
2111 | +void video_clear(void) | |
2112 | +{ | |
2113 | + if (!video_fb_address) | |
2114 | + return; | |
2115 | +#ifdef VIDEO_HW_RECTFILL | |
2116 | + video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ | |
2117 | + 0, /* dest pos x */ | |
2118 | + 0, /* dest pos y */ | |
2119 | + VIDEO_VISIBLE_COLS, /* frame width */ | |
2120 | + VIDEO_VISIBLE_ROWS, /* frame height */ | |
2121 | + bgx /* fill color */ | |
2122 | + ); | |
2123 | +#else | |
2124 | + memsetl(video_fb_address, | |
2125 | + (VIDEO_VISIBLE_ROWS * VIDEO_LINE_LEN) / sizeof(int), bgx); | |
2126 | +#endif | |
2127 | +} | |
2128 | + | |
2111 | 2129 | static int video_init(void) |
2112 | 2130 | { |
2113 | 2131 | unsigned char color8; |
... | ... | @@ -2194,6 +2212,8 @@ |
2194 | 2212 | } |
2195 | 2213 | eorx = fgx ^ bgx; |
2196 | 2214 | |
2215 | + video_clear(); | |
2216 | + | |
2197 | 2217 | #ifdef CONFIG_VIDEO_LOGO |
2198 | 2218 | /* Plot the logo and get start point of console */ |
2199 | 2219 | debug("Video: Drawing the logo ...\n"); |
... | ... | @@ -2296,23 +2316,5 @@ |
2296 | 2316 | int video_get_screen_columns(void) |
2297 | 2317 | { |
2298 | 2318 | return CONSOLE_COLS; |
2299 | -} | |
2300 | - | |
2301 | -void video_clear(void) | |
2302 | -{ | |
2303 | - if (!video_fb_address) | |
2304 | - return; | |
2305 | -#ifdef VIDEO_HW_RECTFILL | |
2306 | - video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ | |
2307 | - 0, /* dest pos x */ | |
2308 | - 0, /* dest pos y */ | |
2309 | - VIDEO_VISIBLE_COLS, /* frame width */ | |
2310 | - VIDEO_VISIBLE_ROWS, /* frame height */ | |
2311 | - bgx /* fill color */ | |
2312 | - ); | |
2313 | -#else | |
2314 | - memsetl(video_fb_address, | |
2315 | - (VIDEO_VISIBLE_ROWS * VIDEO_LINE_LEN) / sizeof(int), bgx); | |
2316 | -#endif | |
2317 | 2319 | } |
include/video_fb.h
... | ... | @@ -18,8 +18,13 @@ |
18 | 18 | #ifndef _VIDEO_FB_H_ |
19 | 19 | #define _VIDEO_FB_H_ |
20 | 20 | |
21 | +#if defined(CONFIG_SYS_CONSOLE_FG_COL) && defined(CONFIG_SYS_CONSOLE_BG_COL) | |
22 | +#define CONSOLE_BG_COL CONFIG_SYS_CONSOLE_BG_COL | |
23 | +#define CONSOLE_FG_COL CONFIG_SYS_CONSOLE_FG_COL | |
24 | +#else | |
21 | 25 | #define CONSOLE_BG_COL 0x00 |
22 | 26 | #define CONSOLE_FG_COL 0xa0 |
27 | +#endif | |
23 | 28 | |
24 | 29 | /* |
25 | 30 | * Graphic Data Format (GDF) bits for VIDEO_DATA_FORMAT |