From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastian Ruppert Date: Fri, 14 Sep 2012 10:29:02 +0200 Subject: [U-Boot] [PATCH v4 4/6] video: cfb_console: add function to plot the logo area black In-Reply-To: <20120902005045.46f464fc@wker> References: <20120902005045.46f464fc@wker> Message-ID: <1347611344-7483-4-git-send-email-Bastian.Ruppert@Sewerin.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Signed-off-by: Bastian Ruppert CC: Anatolij Gustschin CC: Tom Rini CC: Stefano Babic --- drivers/video/cfb_console.c | 46 +++++++++++++++++++++++++++++++++++++++--- 1 files changed, 42 insertions(+), 4 deletions(-) diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 3ae420b..c3e36c4 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -1486,7 +1486,39 @@ int video_display_bitmap(ulong bmp_image, int x, int y) #ifdef CONFIG_VIDEO_LOGO -void logo_plot(void *screen, int width, int x, int y) +static void plot_logo_or_black(void *screen, int width, int x, int y, \ + int black); + +static void logo_plot(void *screen, int width, int x, int y) +{ + plot_logo_or_black(screen, width, x, y, 0); +} + +static void logo_black(void) +{ + plot_logo_or_black(video_fb_address, \ + VIDEO_COLS, \ + video_logo_xpos, \ + video_logo_ypos, \ + 1); +} + +static int do_clrlogo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + if (argc != 1) + return cmd_usage(cmdtp); + + logo_black(); + return 0; +} + +U_BOOT_CMD( + clrlogo, 1, 0, do_clrlogo, + "fill the boot logo area with black", + " " + ); + +static void plot_logo_or_black(void *screen, int width, int x, int y, int black) { int xcount, i; @@ -1544,9 +1576,15 @@ void logo_plot(void *screen, int width, int x, int y) #endif xcount = VIDEO_LOGO_WIDTH; while (xcount--) { - r = logo_red[*source - VIDEO_LOGO_LUT_OFFSET]; - g = logo_green[*source - VIDEO_LOGO_LUT_OFFSET]; - b = logo_blue[*source - VIDEO_LOGO_LUT_OFFSET]; + if (black) { + r = 0x00; + g = 0x00; + b = 0x00; + } else { + r = logo_red[*source - VIDEO_LOGO_LUT_OFFSET]; + g = logo_green[*source - VIDEO_LOGO_LUT_OFFSET]; + b = logo_blue[*source - VIDEO_LOGO_LUT_OFFSET]; + } switch (VIDEO_DATA_FORMAT) { case GDF__8BIT_INDEX: -- 1.7.0.4